Update dependencies, fix build with Java 9+

This commit is contained in:
comp500 2022-01-20 01:55:44 +00:00
parent afb574d82d
commit aff921f67e
3 changed files with 27 additions and 25 deletions

View File

@ -1,9 +1,9 @@
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath("com.guardsquare:proguard-gradle:7.0.0") {
classpath("com.guardsquare:proguard-gradle:7.1.0") {
exclude("com.android.tools.build")
}
}
@ -12,11 +12,11 @@ buildscript {
plugins {
java
application
id("com.github.johnrengelman.shadow") version "6.1.0"
id("com.palantir.git-version") version "0.12.3"
id("com.github.johnrengelman.shadow") version "7.1.2"
id("com.palantir.git-version") version "0.13.0"
id("com.github.breadmoirai.github-release") version "2.2.12"
kotlin("jvm") version "1.4.21"
id("com.github.jk1.dependency-license-report") version "1.16"
kotlin("jvm") version "1.6.10"
id("com.github.jk1.dependency-license-report") version "2.0"
`maven-publish`
}
@ -26,19 +26,19 @@ java {
val shrinkClasspath: Configuration by configurations.creating
repositories {
mavenCentral()
}
dependencies {
implementation("commons-cli:commons-cli:1.4")
shrinkClasspath("commons-cli:commons-cli:1.4")
implementation("com.moandjiezana.toml:toml4j:0.7.2")
implementation("com.google.code.gson:gson:2.8.1")
implementation("com.squareup.okio:okio:2.9.0")
implementation("com.google.code.gson:gson:2.8.9")
implementation("com.squareup.okio:okio:3.0.0")
implementation(kotlin("stdlib-jdk8"))
}
repositories {
jcenter()
}
application {
mainClassName = "link.infra.packwiz.installer.RequiresBootstrap"
}
@ -60,24 +60,17 @@ licenseReport {
filters = arrayOf<com.github.jk1.license.filter.DependencyFilter>(com.github.jk1.license.filter.LicenseBundleNormalizer())
}
// TODO: build relocated jar for minecraft launcher lib, non-relocated jar for packwiz-installer
//tasks.register<com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation>("relocateShadowJar") {
// target = tasks.shadowJar.get()
// prefix = "link.infra.packwiz.deps"
//}
// Commons CLI and Minimal JSON are already included in packwiz-installer-bootstrap
tasks.shadowJar {
dependencies {
exclude(dependency("commons-cli:commons-cli:1.4"))
exclude(dependency("com.eclipsesource.minimal-json:minimal-json:0.9.5"))
// TODO: exclude meta inf files
// TODO: exclude unnecessary meta inf files
}
exclude("**/*.kotlin_metadata")
exclude("**/*.kotlin_builtins")
exclude("META-INF/maven/**/*")
exclude("META-INF/proguard/**/*")
//dependsOn(tasks.named("relocateShadowJar"))
}
tasks.register<proguard.gradle.ProGuardTask>("shrinkJar") {
@ -88,13 +81,22 @@ tasks.register<proguard.gradle.ProGuardTask>("shrinkJar") {
libraryjars("${System.getProperty("java.home")}/lib/rt.jar")
libraryjars("${System.getProperty("java.home")}/lib/jce.jar")
} else {
throw RuntimeException("Compiling with Java 9+ not supported!")
// Use jmods for Java 9+
val mods = listOf("java.base", "java.logging", "java.desktop", "java.sql")
for (mod in mods) {
libraryjars(mapOf(
"jarfilter" to "!**.jar",
"filter" to "!module-info.class"
), "${System.getProperty("java.home")}/jmods/$mod.jmod")
}
}
keep("class link.infra.packwiz.installer.** { *; }")
dontoptimize()
dontobfuscate()
dontwarn("org.codehaus.mojo.animal_sniffer.*")
// TODO: repackage commons CLI
}
// Used for vscode launch.json

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -3,11 +3,11 @@
packwiz-installer itself is under the MIT license, except for Murmur2Lib and bundled dependencies as follows:
- Murmur2Lib: Apache 2.0 ([Source](https://github.com/prasanthj/hasher/blob/master/src/main/java/hasher/Murmur2.java))
- Google Gson 2.8.1: Apache 2.0 ([Source](https://github.com/google/gson))
- Okio 2.9.0: Apache 2.0 ([Source](https://github.com/square/okio/))
- 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/))
- Commons CLI 1.4: 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))
- Kotlin Standard Library 1.4.21: 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))
## Associated notices