Potential gradle publish fix

This commit is contained in:
PiggyPiglet
2026-01-19 16:36:34 +08:00
parent 8116cbb385
commit 9a677d46a1
2 changed files with 21 additions and 11 deletions

View File

@@ -83,21 +83,17 @@ tasks {
from(paper.output)
}
val sourcesJar by registering(Jar::class) {
val combinedSourcesJar by registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
from(paper.allSource)
}
withType<JavaCompile> {
options.encoding = "UTF-8"
options.release = 8
}
val javadocJar = withType<Javadoc> {
val combinedJavadoc by registering(Javadoc::class) {
isFailOnError = false
source = sourceSets.main.get().allJava + paper.allJava
classpath = sourceSets.main.get().compileClasspath + paper.compileClasspath
with(options as StandardJavadocDocletOptions) {
addStringOption("Xdoclint:none", "-quiet")
@@ -106,6 +102,17 @@ tasks {
}
}
val combinedJavadocJar by registering(Jar::class) {
archiveClassifier.set("javadoc")
dependsOn(combinedJavadoc)
from(combinedJavadoc.get().destinationDir)
}
withType<JavaCompile> {
options.encoding = "UTF-8"
options.release = 8
}
withType<ShadowJar> {
configurations = listOf(project.configurations.runtimeClasspath.get())
@@ -145,9 +152,12 @@ tasks {
builtBy(plainJar)
}
artifacts {
archives(sourcesJar)
archives(javadocJar)
artifact(combinedSourcesJar) {
builtBy(combinedSourcesJar)
}
artifact(combinedJavadocJar) {
builtBy(combinedJavadocJar)
}
}
}

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists