From 3e6e8766f739d9322d54b3460962eab64331296c Mon Sep 17 00:00:00 2001 From: stephengold Date: Sun, 19 May 2024 11:09:56 -0700 Subject: [PATCH] buildscripts: don't use withSourcesJar()---it includes resources --- common.gradle | 6 ++++++ moon-ccbysa/build.gradle | 2 +- nifty/build.gradle | 2 +- x/build.gradle | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/common.gradle b/common.gradle index cb01d38c..d0f11dc6 100644 --- a/common.gradle +++ b/common.gradle @@ -35,3 +35,9 @@ tasks.withType(JavaExec).configureEach { // Java runtime options: //jvmArgs '-Xms512m', '-Xmx512m' // to enlarge the Java heap //jvmArgs '-XX:+UseG1GC', '-XX:MaxGCPauseMillis=10' } + +tasks.register('sourcesJar', Jar) { + archiveClassifier = 'sources' + description 'Creates a JAR of Java sourcecode.' + from sourceSets.main.allJava // default is ".allSource", which include resources +} \ No newline at end of file diff --git a/moon-ccbysa/build.gradle b/moon-ccbysa/build.gradle index 6805c581..38336dee 100644 --- a/moon-ccbysa/build.gradle +++ b/moon-ccbysa/build.gradle @@ -16,7 +16,6 @@ ext { java { withJavadocJar() - withSourcesJar() } jar { archiveBaseName = project.ext.baseName } @@ -35,6 +34,7 @@ tasks.register('pom', Copy) { publishing { publications { maven(MavenPublication) { + artifact sourcesJar artifactId artifact from components.java groupId rootProject.ext.group diff --git a/nifty/build.gradle b/nifty/build.gradle index feccee90..441715fe 100644 --- a/nifty/build.gradle +++ b/nifty/build.gradle @@ -26,7 +26,6 @@ dependencies { java { withJavadocJar() - withSourcesJar() } javadoc { @@ -92,6 +91,7 @@ tasks.register('pomAsc', Copy) { publishing { publications { maven(MavenPublication) { + artifact sourcesJar artifactId artifact from components.java groupId rootProject.ext.group diff --git a/x/build.gradle b/x/build.gradle index a1246ca9..ffdc2461 100644 --- a/x/build.gradle +++ b/x/build.gradle @@ -22,7 +22,6 @@ dependencies { java { withJavadocJar() - withSourcesJar() } // Register publishing tasks: @@ -81,6 +80,7 @@ tasks.register('pomAsc', Copy) { publishing { publications { maven(MavenPublication) { + artifact sourcesJar artifactId artifact from components.java groupId rootProject.ext.group