diff --git a/build.gradle b/build.gradle index ecb6fed..cbd6300 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { } group 'me.epic' -version '1.2.6-SNAPSHOT' +version '1.2.7-SNAPSHOT' description "Epic's Spigot Lib" compileJava.options.encoding = "UTF-8" @@ -18,6 +18,7 @@ jar.enabled = false subprojects { java { + withSourcesJar() withJavadocJar() } @@ -75,11 +76,26 @@ shadowJar { relocate 'com.jeff_media.morepersistentdatatypes', 'me.epic.morepersistentdatatypes' } +tasks.register('combineSourcesJar', Jar) { + archiveClassifier.set("sources") + + // Collect all source directories from submodules + def packages = subprojects.collect { project -> + project.file("src/main/java") + } + + // Include the source files in the combined sources JAR + from(packages) { + include '**/*.java' + } +} + publishing { publications { shadow(MavenPublication) { publication -> project.shadow.component(publication) publication.artifact(aggregateJavadocJar) + publication.artifact(combineSourcesJar) } } repositories {