mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-19 13:06:30 +02:00
Shade and relocate Commons CLI, update to 1.5.0
This commit is contained in:
parent
aff921f67e
commit
7d6346c088
@ -24,15 +24,12 @@ java {
|
|||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
val shrinkClasspath: Configuration by configurations.creating
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("commons-cli:commons-cli:1.4")
|
implementation("commons-cli:commons-cli:1.5.0")
|
||||||
shrinkClasspath("commons-cli:commons-cli:1.4")
|
|
||||||
implementation("com.moandjiezana.toml:toml4j:0.7.2")
|
implementation("com.moandjiezana.toml:toml4j:0.7.2")
|
||||||
implementation("com.google.code.gson:gson:2.8.9")
|
implementation("com.google.code.gson:gson:2.8.9")
|
||||||
implementation("com.squareup.okio:okio:3.0.0")
|
implementation("com.squareup.okio:okio:3.0.0")
|
||||||
@ -60,22 +57,22 @@ licenseReport {
|
|||||||
filters = arrayOf<com.github.jk1.license.filter.DependencyFilter>(com.github.jk1.license.filter.LicenseBundleNormalizer())
|
filters = arrayOf<com.github.jk1.license.filter.DependencyFilter>(com.github.jk1.license.filter.LicenseBundleNormalizer())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commons CLI and Minimal JSON are already included in packwiz-installer-bootstrap
|
|
||||||
tasks.shadowJar {
|
tasks.shadowJar {
|
||||||
dependencies {
|
|
||||||
exclude(dependency("commons-cli:commons-cli:1.4"))
|
|
||||||
exclude(dependency("com.eclipsesource.minimal-json:minimal-json:0.9.5"))
|
|
||||||
// TODO: exclude unnecessary meta inf files
|
|
||||||
}
|
|
||||||
exclude("**/*.kotlin_metadata")
|
exclude("**/*.kotlin_metadata")
|
||||||
exclude("**/*.kotlin_builtins")
|
exclude("**/*.kotlin_builtins")
|
||||||
exclude("META-INF/maven/**/*")
|
exclude("META-INF/maven/**/*")
|
||||||
exclude("META-INF/proguard/**/*")
|
exclude("META-INF/proguard/**/*")
|
||||||
|
|
||||||
|
// Relocate Commons CLI, so that it doesn't clash with old packwiz-installer-bootstrap (that shades it)
|
||||||
|
relocate("org.apache.commons.cli", "link.infra.packwiz.installer.deps.commons-cli")
|
||||||
|
|
||||||
|
// from Commons CLI
|
||||||
|
exclude("META-INF/LICENSE.txt")
|
||||||
|
exclude("META-INF/NOTICE.txt")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register<proguard.gradle.ProGuardTask>("shrinkJar") {
|
tasks.register<proguard.gradle.ProGuardTask>("shrinkJar") {
|
||||||
injars(tasks.shadowJar)
|
injars(tasks.shadowJar)
|
||||||
libraryjars(files(shrinkClasspath.files))
|
|
||||||
outjars("build/libs/" + tasks.shadowJar.get().outputs.files.first().name.removeSuffix(".jar") + "-shrink.jar")
|
outjars("build/libs/" + tasks.shadowJar.get().outputs.files.first().name.removeSuffix(".jar") + "-shrink.jar")
|
||||||
if (System.getProperty("java.version").startsWith("1.")) {
|
if (System.getProperty("java.version").startsWith("1.")) {
|
||||||
libraryjars("${System.getProperty("java.home")}/lib/rt.jar")
|
libraryjars("${System.getProperty("java.home")}/lib/rt.jar")
|
||||||
@ -95,8 +92,6 @@ tasks.register<proguard.gradle.ProGuardTask>("shrinkJar") {
|
|||||||
dontoptimize()
|
dontoptimize()
|
||||||
dontobfuscate()
|
dontobfuscate()
|
||||||
dontwarn("org.codehaus.mojo.animal_sniffer.*")
|
dontwarn("org.codehaus.mojo.animal_sniffer.*")
|
||||||
|
|
||||||
// TODO: repackage commons CLI
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used for vscode launch.json
|
// Used for vscode launch.json
|
||||||
|
@ -8,8 +8,6 @@ public class RequiresBootstrap {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// Very small CLI implementation, because Commons CLI complains on unexpected
|
// Very small CLI implementation, because Commons CLI complains on unexpected
|
||||||
// options
|
// options
|
||||||
// Also so that Commons CLI can be excluded from the shaded JAR, as it is
|
|
||||||
// included in the bootstrap
|
|
||||||
if (Arrays.stream(args).map(str -> {
|
if (Arrays.stream(args).map(str -> {
|
||||||
if (str == null) return "";
|
if (str == null) return "";
|
||||||
if (str.startsWith("--")) {
|
if (str.startsWith("--")) {
|
||||||
|
@ -5,7 +5,7 @@ packwiz-installer itself is under the MIT license, except for Murmur2Lib and bun
|
|||||||
- Murmur2Lib: Apache 2.0 ([Source](https://github.com/prasanthj/hasher/blob/master/src/main/java/hasher/Murmur2.java))
|
- Murmur2Lib: Apache 2.0 ([Source](https://github.com/prasanthj/hasher/blob/master/src/main/java/hasher/Murmur2.java))
|
||||||
- Google Gson 2.8.9: Apache 2.0 ([Source](https://github.com/google/gson))
|
- Google Gson 2.8.9: Apache 2.0 ([Source](https://github.com/google/gson))
|
||||||
- Okio 3.0.0: Apache 2.0 ([Source](https://github.com/square/okio/))
|
- Okio 3.0.0: Apache 2.0 ([Source](https://github.com/square/okio/))
|
||||||
- Commons CLI 1.4: Apache 2.0 ([Source](http://commons.apache.org/proper/commons-cli/))
|
- Commons CLI 1.5: Apache 2.0 ([Source](http://commons.apache.org/proper/commons-cli/))
|
||||||
- Jetbrains Annotations 13.0: Apache 2.0 ([Source](https://github.com/JetBrains/java-annotations))
|
- Jetbrains Annotations 13.0: Apache 2.0 ([Source](https://github.com/JetBrains/java-annotations))
|
||||||
- Kotlin Standard Library 1.6.10: Apache 2.0 ([Source](https://github.com/JetBrains/kotlin))
|
- Kotlin Standard Library 1.6.10: Apache 2.0 ([Source](https://github.com/JetBrains/kotlin))
|
||||||
- toml4j 0.7.2: MIT ([Source](https://github.com/mwanji/toml4j))
|
- toml4j 0.7.2: MIT ([Source](https://github.com/mwanji/toml4j))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user