Skip to content

Commit bf7e17b

Browse files
authored
Reduce faker's shadowed jar size
1 parent 7690ad7 commit bf7e17b

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

CHANGELOG.adoc

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222

2323
* https://github.com/serpro69/kotlin-faker/pull/161[#161] Fix empty lists as parameter values
2424

25+
[discrete]
26+
=== Other
27+
28+
* https://github.com/serpro69/kotlin-faker/pull/168[#168] Reduce faker's shadowed jar size
29+
2530
====
2631
2732
.[1.12.0] - 2022-10-16

core/build.gradle.kts

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies {
1717
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.4.2")
1818
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.4")
1919
implementation("org.yaml:snakeyaml:1.33")
20-
implementation("com.ibm.icu:icu4j:71.1")
20+
shadow("com.ibm.icu:icu4j:71.1")
2121
shadow(kotlin("stdlib-jdk8"))
2222
shadow(kotlin("reflect"))
2323
shadow("org.slf4j:slf4j-api:2.0.3")
@@ -34,7 +34,7 @@ tasks.processResources.get().dependsOn(tasks["yaml2json"])
3434

3535
configurations {
3636
create("integrationImplementation") { extendsFrom(testImplementation.get()) }
37-
create("integrationRuntimeOnly") { extendsFrom(testRuntimeOnly.get()) }
37+
create("integrationRuntimeOnly") { extendsFrom(testRuntimeOnly.get(), configurations.getByName("shadow")) }
3838
}
3939

4040
sourceSets {
@@ -71,18 +71,18 @@ tasks.withType<Jar> {
7171
}
7272

7373
val shadowJar by tasks.getting(ShadowJar::class) {
74+
minimize()
7475
archiveBaseName.set(rootProject.name)
7576
archiveClassifier.set("")
7677
relocate("com.fasterxml", "faker.com.fasterxml")
7778
relocate("org.yaml", "faker.org.yaml")
78-
relocate("com.ibm.icu", "faker.com.ibm.icu")
79+
exclude("**/locales/*.yml") // jar already contains json files
7980
dependencies {
8081
exclude("module-info.class")
8182
include {
8283
it.name.startsWith(project.group.toString()) ||
8384
it.name.startsWith("com.fasterxml") ||
84-
it.name.startsWith("org.yaml") ||
85-
it.name.startsWith("com.ibm.icu")
85+
it.name.startsWith("org.yaml")
8686
}
8787
}
8888
manifest {

0 commit comments

Comments
 (0)