From 5295b1ed689e4203f08fd1792569da9a9193358a Mon Sep 17 00:00:00 2001 From: Jared Date: Sun, 11 Jun 2023 04:08:28 +0200 Subject: [PATCH] add common code to sources and javadoc jars --- fabric/build.gradle | 16 +++++++++++----- forge/build.gradle | 6 ++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/fabric/build.gradle b/fabric/build.gradle index e7d04df..5dff9fb 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -17,7 +17,7 @@ dependencies { } loom { - if(project(":common").file("src/main/resources/${mod_id}.accesswidener").exists()){ + if (project(":common").file("src/main/resources/${mod_id}.accesswidener").exists()) { accessWidenerPath.set(project(":common").file("src/main/resources/${mod_id}.accesswidener")) } mixin { @@ -39,13 +39,19 @@ loom { } } -processResources { - from project(":common").sourceSets.main.resources -} - tasks.withType(JavaCompile).configureEach { source(project(":common").sourceSets.main.allSource) } +tasks.withType(Javadoc).configureEach { + source(project(":common").sourceSets.main.allJava) +} +tasks.named("sourcesJar", Jar) { + from(project(":common").sourceSets.main.allSource) +} + +processResources { + from project(":common").sourceSets.main.resources +} publishing { publications { diff --git a/forge/build.gradle b/forge/build.gradle index 4b943c9..f83fc46 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -81,6 +81,12 @@ dependencies { tasks.withType(JavaCompile).configureEach { source(project(":common").sourceSets.main.allSource) } +tasks.withType(Javadoc).configureEach { + source(project(":common").sourceSets.main.allJava) +} +tasks.named("sourcesJar", Jar) { + from(project(":common").sourceSets.main.allSource) +} processResources { from project(":common").sourceSets.main.resources