diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4c4c406..723de04 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,8 +27,7 @@ jobs: run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew build -# run: ./gradlew shadowJar + run: ./gradlew allJar env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_USERNAME: ${{ github.actor }} diff --git a/README.md b/README.md index b5ac5d5..23bd48a 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,11 @@ It should be noted that the entire library fully depends on [Fairy Framework](ht ### for developer -Please configure your Github Username and Github Token +You can use jar files ending with sources as dependencies, which include both compiled binary files and source code. + +The GitHub Packages repository will open soon. + + ## modules diff --git a/build.gradle.kts b/build.gradle.kts index 588d308..47283bc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,5 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.archivesName import java.time.LocalDateTime import java.time.format.DateTimeFormatter @@ -84,7 +85,6 @@ subprojects { // Configure ShadowJar task tasks.withType(ShadowJar::class) { - archiveClassifier.set("shadow") // Relocate fairy to avoid plugin conflict relocate("io.fairyproject.bootstrap", "${properties("package")}.fairy.bootstrap") relocate("net.kyori", "io.fairyproject.libs.kyori") @@ -94,15 +94,25 @@ subprojects { relocate("com.github.retrooper.packetevents", "io.fairyproject.libs.packetevents") relocate("io.github.retrooper.packetevents", "io.fairyproject.libs.packetevents") relocate("io.fairyproject.bukkit.menu", "${properties("package")}.fairy.menu") + archiveClassifier.set("plugin") } // Configure sourcesJar task tasks.register("sourcesJar") { + from(tasks.named("shadowJar").get().source) from(sourceSets.main.get().allSource) - archiveClassifier.set("all") + archiveClassifier.set("sources") } - tasks.named("build") { - dependsOn("shadowJar", "sourcesJar") + + // Configure javadocJar task + tasks.register("javadocJar") { + dependsOn(tasks.named("javadoc")) + from(tasks.named("javadoc")) + archiveClassifier.set("javadoc") + } + + tasks.register("allJar") { + dependsOn("shadowJar", "sourcesJar", "javadocJar") } } @@ -113,7 +123,7 @@ publishing { create("shadow-${module.capitalize()}") { project.extensions.configure() { component(this@create) - //artifact(tasks.named("shadowJar").get().archiveFile.get()) + artifact(tasks.named("shadowJar").get().source) groupId = group.toString() artifactId = "$module" version = "${properties("version")}-${LocalDateTime.now().format(DateTimeFormatter.ofPattern("dd-MM-yy-hhmmss"))}" @@ -121,17 +131,6 @@ publishing { } } } - // Maven Central -// publications { -// modules.forEach { module -> -// create("maven-${module.capitalize()}") { -// artifact(tasks.named("shadowJar").get().archiveFile.get()) -// groupId = group.toString() -// artifactId = "$module" -// version = "${properties("version")}-${LocalDateTime.now().format(DateTimeFormatter.ofPattern("dd-MM-yy-hhmmss"))}" -// } -// } -// } // GitHub Packages repositories {