|
| 1 | +plugins { |
| 2 | + id("java-client.java17") |
| 3 | + alias(libs.plugins.shadow) |
| 4 | +} |
| 5 | + |
| 6 | +group = "io.split.client" |
| 7 | +version = "4.18.3" |
| 8 | +description = "Java SDK for Split" |
| 9 | + |
| 10 | +dependencies { |
| 11 | + api(project(":pluggable-storage")) |
| 12 | + implementation(libs.guava) |
| 13 | + implementation(libs.slf4j.api) |
| 14 | + implementation(libs.httpclient5) |
| 15 | + implementation(libs.gson) |
| 16 | + implementation(libs.snakeyaml) |
| 17 | + |
| 18 | + testImplementation(libs.junit4) |
| 19 | + testRuntimeOnly(libs.junit.vintage.engine) |
| 20 | + testImplementation("org.hamcrest:hamcrest-all:1.3") |
| 21 | + testImplementation("org.mockito:mockito-core:1.10.19") // pinned to 1.x for legacy tests using MockitoJUnitRunner |
| 22 | + testImplementation(libs.slf4j.log4j12) |
| 23 | + testImplementation(libs.commons.lang3) |
| 24 | + testImplementation(libs.awaitility) |
| 25 | + testImplementation(libs.okhttp.mockwebserver) |
| 26 | + |
| 27 | + // Jersey test dependencies |
| 28 | + testImplementation("org.glassfish.jersey.media:jersey-media-sse:2.31") |
| 29 | + testImplementation("org.glassfish.jersey.inject:jersey-hk2:2.31") |
| 30 | + testImplementation("org.glassfish.jersey.containers:jersey-container-grizzly2-http:2.26") |
| 31 | + |
| 32 | + // Powermock (legacy, needed for existing tests) |
| 33 | + testImplementation("org.powermock:powermock-module-junit4:1.7.4") |
| 34 | + testImplementation("org.powermock:powermock-api-mockito:1.7.4") |
| 35 | +} |
| 36 | + |
| 37 | +// Resource filtering for splitversion.properties |
| 38 | +tasks.processResources { |
| 39 | + filesMatching("splitversion.properties") { |
| 40 | + expand("project" to mapOf("version" to project.version)) |
| 41 | + } |
| 42 | +} |
| 43 | + |
| 44 | +// Shaded fat JAR — include transitive deps, relocate to avoid conflicts |
| 45 | +tasks.shadowJar { |
| 46 | + mergeServiceFiles() |
| 47 | + |
| 48 | + // Include only specific artifacts in the shadow jar |
| 49 | + dependencies { |
| 50 | + include(dependency("com.google.guava:guava")) |
| 51 | + include(dependency("com.google.code.gson:gson")) |
| 52 | + include(dependency("org.yaml:snakeyaml")) |
| 53 | + include(dependency("org.apache.httpcomponents.client5:httpclient5")) |
| 54 | + include(dependency("org.apache.httpcomponents.core5:httpcore5")) |
| 55 | + include(dependency("org.apache.httpcomponents.core5:httpcore5-h2")) |
| 56 | + include(dependency("org.checkerframework:checker-qual")) |
| 57 | + include(dependency("commons-codec:commons-codec")) |
| 58 | + include(dependency("com.google.errorprone:error_prone_annotations")) |
| 59 | + include(dependency("com.google.guava:failureaccess")) |
| 60 | + include(dependency("com.google.guava:listenablefuture")) |
| 61 | + include(dependency("com.google.j2objc:j2objc-annotations")) |
| 62 | + } |
| 63 | + |
| 64 | + relocate("org.apache", "split.org.apache") |
| 65 | + relocate("org.checkerframework", "split.org.checkerframework") |
| 66 | + relocate("org.yaml.snakeyaml", "split.org.yaml.snakeyaml") |
| 67 | + relocate("com.google", "split.com.google") |
| 68 | + |
| 69 | + exclude("META-INF/**", "LICENSE", "NOTICE", "/*.txt", "build.properties") |
| 70 | +} |
0 commit comments