From cdf22510b09a727484b20e6f9e24afea7570f2f9 Mon Sep 17 00:00:00 2001 From: shalousun <836575280@qq.com> Date: Fri, 22 Mar 2024 01:40:03 +0800 Subject: [PATCH] add: skipSigning while publishToMavenLocal --- Makefile | 3 +++ build.gradle | 33 +++++++++++++++++++-------------- 2 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..eed1950 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ + +publishToMavenLocal: + gradle publishToMavenLocal -PskipSigning \ No newline at end of file diff --git a/build.gradle b/build.gradle index 7d6ba0f..359765c 100644 --- a/build.gradle +++ b/build.gradle @@ -41,6 +41,15 @@ task javadocJar(type: Jar) { from javadoc } +task sourcesJar(type: Jar) { + archiveClassifier = 'sources' + from sourceSets.main.allSource +} + +artifacts { + archives javadocJar, sourcesJar +} + javadoc { configure(options) { tags( @@ -52,16 +61,6 @@ javadoc { } } -task sourcesJar(type: Jar) { - archiveClassifier = 'sources' - from sourceSets.main.allSource -} - -artifacts { - archives javadocJar, sourcesJar -} - - // publish to https://plugins.gradle.org/ gradlePlugin { website = 'https://github.com/TongchengOpenSource/smart-doc-gradle-plugin' @@ -85,10 +84,6 @@ publishing { artifactId project.name version "${version}" from components.java - // more goes in here - artifact sourcesJar { - classifier "sources" - } } } repositories { @@ -103,3 +98,13 @@ publishing { } } } + +signing { + sign publishing.publications +} + +if (project.hasProperty('skipSigning') || project.gradle.startParameter.taskNames.any { it.contains("publish") }) { + signing { + required { false } + } +}