Skip to content

Commit c03b24b

Browse files
committed
fix sources task
1 parent 653f0c8 commit c03b24b

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

build.gradle.kts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ subprojects {
5252
java {
5353
sourceCompatibility = JavaVersion.VERSION_1_8
5454
targetCompatibility = JavaVersion.VERSION_1_8
55-
withSourcesJar()
5655
}
5756

5857
fun adjustArchiveFileName(property: Property<String>) {
@@ -64,19 +63,23 @@ subprojects {
6463
adjustArchiveFileName(archiveFileName)
6564
}
6665

67-
//tasks.register("sourcesJar", Jar::class) {
68-
// archiveClassifier.set("sources")
69-
// adjustArchiveFileName(archiveFileName)
70-
//
71-
// from(sourceSets.main.get().allSource)
72-
//}
66+
tasks.register("sourcesJar", Jar::class) {
67+
archiveClassifier.set("sources")
68+
adjustArchiveFileName(archiveFileName)
69+
70+
from(sourceSets.main.get().allSource)
71+
}
7372

7473
var publishToken = System.getenv("PUBLISH_TOKEN")
7574

7675
if (publishToken == null && project.hasProperty("net.labymod.distributor.publish-token")) {
7776
publishToken = project.property("net.labymod.distributor.publish-token").toString()
7877
}
7978

79+
java {
80+
withSourcesJar()
81+
}
82+
8083
publishing {
8184
publications {
8285
create<MavenPublication>(project.name) {

0 commit comments

Comments
 (0)