Skip to content

Commit cb0c04c

Browse files
committed
Refactor build configurations and downgrade to JDK 11
Moved 'createGithubPublication' block under 'publications' for code readability. JDK language level has been set to 11 for both project JDK and compiler settings to ensure consistency and avoid potential compilation issues.
1 parent 6550d56 commit cb0c04c

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

build.gradle.kts

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,13 @@ dependencies {
2222
kotlin.jvmToolchain { languageVersion.set(JavaLanguageVersion.of(11)) }
2323

2424
tasks {
25-
withType<KotlinCompile<*>>().all {
26-
kotlinOptions { freeCompilerArgs += listOf("-opt-in=kotlin.RequiresOptIn") }
27-
}
25+
withType<KotlinCompile<*>>().all { kotlinOptions { freeCompilerArgs += listOf("-opt-in=kotlin.RequiresOptIn") } }
2826
}
2927

3028
testing.suites {
3129
val test by getting(JvmTestSuite::class) { useJUnitJupiter() }
3230
}
3331

34-
publishing {
35-
publications {
36-
createGithubPublication("Github") {
37-
from(components["java"])
38-
suppressAllPomMetadataWarnings()
39-
}
40-
}
41-
repositories { github { domain = "kotlin-graphics/mary" } }
42-
}
43-
44-
4532
java {
4633
withJavadocJar()
4734
withSourcesJar()
@@ -50,17 +37,17 @@ java {
5037

5138
configure<PublishingExtension> {
5239
publications {
40+
createGithubPublication("Github") {
41+
from(components["java"])
42+
suppressAllPomMetadataWarnings()
43+
}
5344
create<MavenPublication>("mavenCentral") {
5445
groupId = "io.github.kotlin-graphics"
5546
artifactId = "kotlin-unsigned"
5647
from(components["java"])
5748
versionMapping {
58-
usage("java-api") {
59-
fromResolutionOf("runtimeClasspath")
60-
}
61-
usage("java-runtime") {
62-
fromResolutionResult()
63-
}
49+
usage("java-api") { fromResolutionOf("runtimeClasspath") }
50+
usage("java-runtime") { fromResolutionResult() }
6451
}
6552
pom {
6653
name.set("kotlin-unsigned")
@@ -93,13 +80,13 @@ configure<PublishingExtension> {
9380
}
9481
}
9582
repositories {
83+
github { domain = "kotlin-graphics/mary" }
9684
maven {
9785
name = "mavenCentral"
9886
credentials {
9987
username = project.properties["NEXUS_USERNAME"].toString()
10088
password = project.properties["NEXUS_PASSWORD"].toString()
10189
}
102-
10390
url = uri("https://s01.oss.sonatype.org/content/repositories/releases/")
10491
}
10592
}

0 commit comments

Comments
 (0)