Skip to content

Commit 3d59340

Browse files
committed
fix: kotlin is now relocated for okhttp3
1 parent 54e5b9b commit 3d59340

File tree

8 files changed

+33
-68
lines changed

8 files changed

+33
-68
lines changed

api/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ plugins {
55

66
`maven-publish`
77
alias(libs.plugins.openapi.generator)
8-
kotlin("jvm")
98
}
109

1110
java {
@@ -39,6 +38,7 @@ tasks.named<ShadowJar>("shadowJar") {
3938
relocate("org.bouncycastle", "app.simplecloud.api.shaded.v${versionPath}.bouncycastle")
4039
relocate("org.intellij", "app.simplecloud.api.shaded.v${versionPath}.intellij")
4140
relocate("org.jetbrains", "app.simplecloud.api.shaded.v${versionPath}.jetbrains")
41+
relocate("kotlin", "app.simplecloud.api.shaded.v${versionPath}.kotlin")
4242

4343
relocate("google", "app.simplecloud.api.shaded.v${versionPath}.google")
4444
relocate("native", "app.simplecloud.api.shaded.v${versionPath}.native")

build.gradle.kts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
`signing`
1010
}
1111

12-
val baseVersion = "0.1.0-platform.4"
12+
val baseVersion = "0.1.0-platform.5"
1313
val commitHash = System.getenv("COMMIT_HASH")
1414
val isSnapshot = commitHash != null
1515

@@ -42,6 +42,32 @@ subprojects {
4242
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
4343
}
4444

45+
if (project.path.startsWith(":platform:") && project.path != ":platform:shared") {
46+
tasks.named<ShadowJar>("shadowJar") {
47+
dependsOn(":api:shadowJar")
48+
mergeServiceFiles()
49+
50+
exclude("io/nats/**")
51+
exclude("com/google/**")
52+
exclude("build/buf/**")
53+
exclude("okhttp3/**")
54+
exclude("okio/**")
55+
exclude("io/gsonfire/**")
56+
exclude("org/bouncycastle/**")
57+
exclude("org/intellij/**")
58+
exclude("org/jetbrains/**")
59+
exclude("kotlin/**")
60+
exclude("google/**")
61+
exclude("native/**")
62+
exclude("core/**")
63+
exclude("META-INF/*.kotlin_module")
64+
exclude("META-INF/proguard/**")
65+
exclude("META-INF/versions/**")
66+
67+
archiveFileName.set("${project.name}.jar")
68+
}
69+
}
70+
4571
publishing {
4672
repositories {
4773
maven {

platform/bungeecord/build.gradle.kts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2-
31
plugins {
42
alias(libs.plugins.minotaur)
53
}
@@ -10,17 +8,6 @@ dependencies {
108
implementation(project(":api"))
119
}
1210

13-
tasks.named("shadowJar", ShadowJar::class) {
14-
dependsOn(":api:shadowJar")
15-
mergeServiceFiles()
16-
17-
relocate("com.google.protobuf", "app.simplecloud.relocate.google.protobuf")
18-
relocate("com.google.common", "app.simplecloud.relocate.google.common")
19-
relocate("io.grpc", "app.simplecloud.relocate.io.grpc")
20-
21-
archiveFileName.set("${project.name}.jar")
22-
}
23-
2411
modrinth {
2512
token.set(project.findProperty("modrinthToken") as String? ?: System.getenv("MODRINTH_TOKEN"))
2613
projectId.set("JCJKZvY2")

platform/paper/build.gradle.kts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2-
31
dependencies {
42
compileOnly(rootProject.libs.paper.api)
53
implementation(project(":platform:shared"))
@@ -10,13 +8,6 @@ sourceSets.main {
108
java.srcDir(layout.buildDirectory.dir("generated/src/main/java"))
119
}
1210

13-
tasks.named("shadowJar", ShadowJar::class) {
14-
dependsOn(":api:shadowJar")
15-
mergeServiceFiles()
16-
17-
archiveFileName.set("${project.name}.jar")
18-
}
19-
2011
tasks.register("generateArtifactsClass") {
2112
group = "generation"
2213
description = "Generates a Java class containing artifact information"

platform/spigot-legacy/build.gradle.kts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2-
31
plugins {
42
alias(libs.plugins.minotaur)
53
}
@@ -10,17 +8,6 @@ dependencies {
108
implementation(project(":api"))
119
}
1210

13-
tasks.named("shadowJar", ShadowJar::class) {
14-
dependsOn(":api:shadowJar")
15-
mergeServiceFiles()
16-
17-
relocate("com.google.protobuf", "app.simplecloud.relocate.google.protobuf")
18-
relocate("com.google.common", "app.simplecloud.relocate.google.common")
19-
relocate("io.grpc", "app.simplecloud.relocate.io.grpc")
20-
21-
archiveFileName.set("${project.name}.jar")
22-
}
23-
2411
modrinth {
2512
token.set(project.findProperty("modrinthToken") as String? ?: System.getenv("MODRINTH_TOKEN"))
2613
projectId.set("JCJKZvY2")

platform/spigot/build.gradle.kts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2-
31
plugins {
42
alias(libs.plugins.minotaur)
53
}
@@ -10,17 +8,6 @@ dependencies {
108
implementation(project(":api"))
119
}
1210

13-
tasks.named("shadowJar", ShadowJar::class) {
14-
dependsOn(":api:shadowJar")
15-
mergeServiceFiles()
16-
17-
relocate("com.google.protobuf", "app.simplecloud.relocate.google.protobuf")
18-
relocate("com.google.common", "app.simplecloud.relocate.google.common")
19-
relocate("io.grpc", "app.simplecloud.relocate.io.grpc")
20-
21-
archiveFileName.set("${project.name}.jar")
22-
}
23-
2411
modrinth {
2512
token.set(project.findProperty("modrinthToken") as String? ?: System.getenv("MODRINTH_TOKEN"))
2613
projectId.set("JCJKZvY2")

platform/velocity/build.gradle.kts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2-
31
plugins {
42
alias(libs.plugins.minotaur)
53
}
@@ -10,17 +8,6 @@ dependencies {
108
implementation(project(":api"))
119
}
1210

13-
tasks.named("shadowJar", ShadowJar::class) {
14-
dependsOn(":api:shadowJar")
15-
mergeServiceFiles()
16-
17-
relocate("com.google.protobuf", "app.simplecloud.relocate.google.protobuf")
18-
relocate("com.google.common", "app.simplecloud.relocate.google.common")
19-
relocate("io.grpc", "app.simplecloud.relocate.io.grpc")
20-
21-
archiveFileName.set("${project.name}.jar")
22-
}
23-
2411
modrinth {
2512
token.set(project.findProperty("modrinthToken") as String? ?: System.getenv("MODRINTH_TOKEN"))
2613
projectId.set("JCJKZvY2")

settings.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
pluginManagement {
2-
plugins {
3-
kotlin("jvm") version "2.2.20"
4-
}
5-
}
1+
//pluginManagement {
2+
// plugins {
3+
// kotlin("jvm") version "2.2.20"
4+
// }
5+
//}
66
rootProject.name = "cloud-api"
77

88
include(

0 commit comments

Comments
 (0)