Skip to content

Commit

Permalink
feat: update jar sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nopock committed Nov 9, 2023
1 parent 67730b8 commit 44a2f01
Show file tree
Hide file tree
Showing 15 changed files with 102 additions and 585 deletions.
96 changes: 50 additions & 46 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import org.jetbrains.gradle.ext.runConfigurations
import org.jetbrains.gradle.ext.settings

plugins {
kotlin("jvm") version "1.9.10"
kotlin("kapt") version "1.9.10"
id("maven-publish")
id("io.sentry.jvm.gradle") version "3.12.0"
id("com.github.johnrengelman.shadow") version "7.1.2"
kotlin("jvm") version "1.9.10"
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.7"
id("org.jetbrains.dokka") version "1.9.0"
kotlin("kapt") version "1.9.10"
id("com.google.protobuf") version "0.9.4" apply false
}

Expand All @@ -39,7 +39,6 @@ allprojects {
apply(plugin = "maven-publish")
apply(plugin = "kotlin")
apply(plugin = "com.github.johnrengelman.shadow")
apply(plugin = "com.github.johnrengelman.shadow")
apply(plugin = "org.jetbrains.gradle.plugin.idea-ext")
apply(plugin = "org.jetbrains.dokka")
apply(plugin = "org.jetbrains.kotlin.kapt")
Expand All @@ -53,35 +52,59 @@ allprojects {
maven("https://jitpack.io")
}

dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("reflect")) // Add this line

val dependencies = listOf(
"org.mongodb:mongo-java-driver:3.12.11",
"io.lettuce:lettuce-core:6.2.4.RELEASE",
"com.google.code.gson:gson:2.9.0",
"io.sentry:sentry:6.29.0",
"com.konghq:unirest-java:3.13.6:standalone",
"com.github.docker-java:docker-java:3.3.4",
"com.github.robinbraemer:CloudflareAPI:1.4.1",
"com.google.guava:guava:31.0.1-jre",
"commons-io:commons-io:2.11.0"
)

dependencies.forEach { dep ->
if (!name.contains("api") || name.contains("core")) {
implementation(dep)
fun applyGlobalDepends(scope: DependencyHandlerScope, shade: Boolean = false) {
scope {
if (!shade) {
compileOnly(kotlin("stdlib"))
compileOnly(kotlin("reflect")) // Add this line

compileOnly("org.mongodb:mongo-java-driver:3.12.11")
compileOnly("io.lettuce:lettuce-core:6.2.4.RELEASE")
compileOnly("io.sentry:sentry:6.29.0")
compileOnly("com.konghq:unirest-java:3.13.6:standalone")

// Docker
compileOnly("com.github.docker-java:docker-java:3.3.4")

// Cloudflare
compileOnly("com.github.robinbraemer:CloudflareAPI:1.4.1")

compileOnly("com.google.guava:guava:31.0.1-jre")
compileOnly("commons-io:commons-io:2.11.0")
} else {
compileOnly(dep)
}
}
implementation(kotlin("stdlib"))
implementation(kotlin("reflect")) // Add this line

implementation("org.mongodb:mongo-java-driver:3.12.11")
implementation("io.lettuce:lettuce-core:6.2.4.RELEASE")
implementation("com.google.code.gson:gson:2.9.0")
implementation("io.sentry:sentry:6.29.0")
implementation("com.konghq:unirest-java:3.13.6:standalone")

// Docker
implementation("com.github.docker-java:docker-java:3.3.4")

// Cloudflare
implementation("com.github.robinbraemer:CloudflareAPI:1.4.1")

testImplementation(kotlin("test"))
implementation("com.google.guava:guava:31.0.1-jre")
implementation("commons-io:commons-io:2.11.0")
}
}
}

dependencies {
// Generate documentation
dokkaPlugin("org.jetbrains.dokka:versioning-plugin:1.9.0")

if (name.contains("api") || name.contains("protocol") || name.contains("minecraft-platform") || name == "paper-core") {
applyGlobalDepends(this)
} else if ((name.contains("core") && !name.contains("paper") && !name.contains("nms")) || name.contains("backend")) {
applyGlobalDepends(this, true)
} else {
compileOnly(kotlin("stdlib"))
compileOnly(kotlin("reflect")) // Add this line
}
}

tasks.withType<ShadowJar> {
Expand All @@ -93,21 +116,6 @@ allprojects {
relocate("co.aikar.commands", "${project.group}.commands")
relocate("co.aikar.locales", "${project.group}.locales")
relocate("co.aikar.locales", "${project.group}.locales")

val packagesToExclude = listOf(
"retrofit",
"retrofit2",
"reactor",
"org",
"okio",
"okhttp3",
"io",
"google",
"eu",
"com"
)

this.exclude(packagesToExclude)
}

tasks.withType<DokkaTaskPartial>().configureEach {
Expand Down Expand Up @@ -157,11 +165,7 @@ allprojects {
duplicatesStrategy = DuplicatesStrategy.WARN // or DuplicatesStrategy.FAIL
}

tasks["build"]
.dependsOn(
"shadowJar",
"publishMavenJavaPublicationToMavenLocalRepository",
)
tasks["build"].dependsOn("shadowJar")
}

kotlin {
Expand Down
13 changes: 6 additions & 7 deletions independent/api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
dependencies {

implementation("org.reflections:reflections:0.10.2")
implementation("com.github.ben-manes.caffeine:caffeine:3.1.8")
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
implementation("co.aikar:acf-core:0.5.1-SNAPSHOT")
implementation("de.mkammerer:argon2-jvm:2.11")
compileOnly("org.reflections:reflections:0.10.2")
compileOnly("com.github.ben-manes.caffeine:caffeine:3.1.8")
compileOnly("com.squareup.retrofit2:retrofit:2.9.0")
compileOnly("com.squareup.retrofit2:converter-gson:2.9.0")
compileOnly("co.aikar:acf-core:0.5.1-SNAPSHOT")
compileOnly("de.mkammerer:argon2-jvm:2.11")
}
2 changes: 0 additions & 2 deletions independent/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
dependencies {
}
12 changes: 6 additions & 6 deletions independent/protocol-stub/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ plugins {
dependencies {
protobuf(project(":independent:protocol"))

api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${rootProject.ext["coroutinesVersion"]}")
compileOnly("org.jetbrains.kotlinx:kotlinx-coroutines-core:${rootProject.ext["coroutinesVersion"]}")

api("io.grpc:grpc-stub:${rootProject.ext["grpcVersion"]}")
api("io.grpc:grpc-protobuf:${rootProject.ext["grpcVersion"]}")
api("com.google.protobuf:protobuf-java-util:${rootProject.ext["protobufVersion"]}")
api("com.google.protobuf:protobuf-kotlin:${rootProject.ext["protobufVersion"]}")
api("io.grpc:grpc-kotlin-stub:${rootProject.ext["grpcKotlinVersion"]}")
compileOnly("io.grpc:grpc-stub:${rootProject.ext["grpcVersion"]}")
compileOnly("io.grpc:grpc-protobuf:${rootProject.ext["grpcVersion"]}")
compileOnly("com.google.protobuf:protobuf-java-util:${rootProject.ext["protobufVersion"]}")
compileOnly("com.google.protobuf:protobuf-kotlin:${rootProject.ext["protobufVersion"]}")
compileOnly("io.grpc:grpc-kotlin-stub:${rootProject.ext["grpcKotlinVersion"]}")
}


Expand Down
14 changes: 7 additions & 7 deletions mc-commons/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ dependencies {
compileOnly("net.kyori:adventure-key:4.14.0")
compileOnly("net.kyori:adventure-text-minimessage:4.10.1")

implementation("co.aikar:acf-core:0.5.1-SNAPSHOT")
implementation(project(":independent:independent-api"))
compileOnly("co.aikar:acf-core:0.5.1-SNAPSHOT")
compileOnly(project(":independent:independent-api"))

implementation("io.grpc:grpc-netty:${rootProject.ext["grpcVersion"]}")
implementation(project(":independent:protocol-stub"))
implementation("io.grpc:grpc-protobuf:${rootProject.ext["grpcVersion"]}")
implementation("com.google.protobuf:protobuf-java-util:${rootProject.ext["protobufVersion"]}")
implementation("io.grpc:grpc-kotlin-stub:${rootProject.ext["grpcKotlinVersion"]}")
compileOnly("io.grpc:grpc-netty:${rootProject.ext["grpcVersion"]}")
compileOnly(project(":independent:protocol-stub"))
compileOnly("io.grpc:grpc-protobuf:${rootProject.ext["grpcVersion"]}")
compileOnly("com.google.protobuf:protobuf-java-util:${rootProject.ext["protobufVersion"]}")
compileOnly("io.grpc:grpc-kotlin-stub:${rootProject.ext["grpcKotlinVersion"]}")
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit 44a2f01

Please sign in to comment.