Skip to content

Commit

Permalink
Upgrade Gradle, upgrade dependencies, bump version to 7.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tvoc-gs committed Nov 29, 2024
1 parent f5352fe commit 174d3f4
Show file tree
Hide file tree
Showing 68 changed files with 3,106 additions and 2,456 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.6.0'
classpath 'com.guardsquare:proguard-gradle:7.6.1'
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion ant/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sourceSets.main {

dependencies {
implementation project(':base')
implementation 'org.apache.ant:ant:1.9.7'
implementation 'org.apache.ant:ant:1.10.15'
}

task fatJar(type: ShadowJar) {
Expand Down
20 changes: 10 additions & 10 deletions base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ plugins {
id 'java-library'
id 'java-test-fixtures'
id 'maven-publish'
id "org.jetbrains.kotlin.jvm" version "$kotlinVersion"
id 'com.adarshr.test-logger' version '3.0.0'
id "org.jetbrains.kotlin.jvm"
id 'com.adarshr.test-logger' version '4.0.0'
id 'jacoco'
id "org.jlleitschuh.gradle.ktlint" version '10.2.1'
id "org.jlleitschuh.gradle.ktlint" version '12.1.2'
}

repositories {
Expand All @@ -21,17 +21,17 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
dependencies {
api "com.guardsquare:proguard-core:${proguardCoreVersion}"
implementation "com.google.code.gson:gson:${gsonVersion}"
implementation 'org.apache.logging.log4j:log4j-api:2.19.0'
implementation 'org.apache.logging.log4j:log4j-core:2.19.0'
implementation 'org.apache.logging.log4j:log4j-api:2.24.2'
implementation 'org.apache.logging.log4j:log4j-core:2.24.2'
implementation 'org.json:json:20231013'

testImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
testImplementation 'dev.zacsweers.kctfork:core:0.5.0-alpha07'
testImplementation 'io.kotest:kotest-runner-junit5-jvm:5.9.0' // for kotest framework
testImplementation 'io.kotest:kotest-assertions-core-jvm:5.9.0' // for kotest core jvm assertions
testImplementation 'io.kotest:kotest-property-jvm:5.9.0' // for kotest property test
testImplementation 'io.mockk:mockk:1.13.11' // for mocking
testImplementation 'dev.zacsweers.kctfork:core:0.6.0'
testImplementation 'io.kotest:kotest-runner-junit5-jvm:5.9.1' // for kotest framework
testImplementation 'io.kotest:kotest-assertions-core-jvm:5.9.1' // for kotest core jvm assertions
testImplementation 'io.kotest:kotest-property-jvm:5.9.1' // for kotest property test
testImplementation 'io.mockk:mockk:1.13.13' // for mocking

testImplementation(testFixtures("com.guardsquare:proguard-core:${proguardCoreVersion}")) {
exclude group: 'com.guardsquare', module: 'proguard-core'
Expand Down
61 changes: 35 additions & 26 deletions base/src/test/kotlin/proguard/AfterInitConfigurationVerifierTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,23 @@ class AfterInitConfigurationVerifierTest : FreeSpec({

"Given a configuration with target specified" - {

val configuration = """
val configuration =
"""
-verbose
-target 6
""".trimIndent().asConfiguration()
""".trimIndent().asConfiguration()

"It should throw an exception if program class pool contains a class with class file version > jdk 11" {
val view = AppView()
view.programClassPool.addClass(FakeClass(CLASS_VERSION_12))

val exception = shouldThrow<RuntimeException> {
AfterInitConfigurationVerifier(configuration).execute(view)
}
val exception =
shouldThrow<RuntimeException> {
AfterInitConfigurationVerifier(configuration).execute(view)
}
exception.message shouldContain "-target can only be used with class file versions <= 55 (Java 11)."
exception.message shouldContain "The input classes contain version 56 class files which cannot be backported to target version (50)."
exception.message shouldContain "The input classes contain version 56 class files which cannot be backported " +
"to target version (50)."
}

"It should not throw an exception if program class pool contains classes with class file version = jdk 11" {
Expand All @@ -72,9 +75,10 @@ class AfterInitConfigurationVerifierTest : FreeSpec({

"Given a configuration with a target specified and classes above Java 11" - {

val configuration = """
val configuration =
"""
-target 17
""".trimIndent().asConfiguration()
""".trimIndent().asConfiguration()

"It should not throw an exception if -target is set but all the classes are already at the targeted version (no backport needed)" {
val view = AppView()
Expand All @@ -93,33 +97,38 @@ class AfterInitConfigurationVerifierTest : FreeSpec({
addClass(FakeClass(CLASS_VERSION_17))
}

val output = getLogOutputOf {
AfterInitConfigurationVerifier(configuration).execute(view)
}
val output =
getLogOutputOf {
AfterInitConfigurationVerifier(configuration).execute(view)
}
output shouldContain "-target is deprecated when using class file above"
}

"It should throw an exception if -target is set and the version of one of the classes version is different from the target version" {
val view = AppView()
with(view.programClassPool) {
addClass(FakeClass(CLASS_VERSION_18))
addClass(FakeClass(CLASS_VERSION_17))
"It should throw an exception if -target is set and the version of one of the classes version is different from" +
"the target version" {
val view = AppView()
with(view.programClassPool) {
addClass(FakeClass(CLASS_VERSION_18))
addClass(FakeClass(CLASS_VERSION_17))
}

val exception =
shouldThrow<RuntimeException> {
AfterInitConfigurationVerifier(configuration).execute(view)
}

exception.message shouldContain "-target can only be used with class file versions <= 55 (Java 11)."
exception.message shouldContain "The input classes contain version 62 class files which cannot be backported " +
"to target version (61)."
}

val exception = shouldThrow<RuntimeException> {
AfterInitConfigurationVerifier(configuration).execute(view)
}

exception.message shouldContain "-target can only be used with class file versions <= 55 (Java 11)."
exception.message shouldContain "The input classes contain version 62 class files which cannot be backported to target version (61)."
}
}

"Given a configuration with no target specified" - {

val configuration = """
val configuration =
"""
-verbose
""".trimIndent().asConfiguration()
""".trimIndent().asConfiguration()

"It should not throw an exception if program class pool contains classes with class file version > jdk 11" {
val view = AppView()
Expand Down
Loading

0 comments on commit 174d3f4

Please sign in to comment.