Skip to content

Commit

Permalink
Merge pull request #365 from usefulness/renovate/major-clikt
Browse files Browse the repository at this point in the history
Update dependency com.github.ajalt.clikt:clikt to v5
  • Loading branch information
mateuszkwiecinski authored Sep 22, 2024
2 parents 363fae2 + 449afaf commit 0f9befb
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions diffuse/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def fatJarProvider = tasks.register('fatJar', Jar) { task ->
task.dependsOn(tasks.named('jar'))

task.archiveClassifier.set('fat')
task.duplicatesStrategy = DuplicatesStrategy.EXCLUDE

task.manifest {
attributes 'Main-Class': 'com.jakewharton.diffuse.Diffuse'
Expand Down
14 changes: 11 additions & 3 deletions diffuse/src/main/kotlin/com/jakewharton/diffuse/diffuse.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
package com.jakewharton.diffuse

import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.Context
import com.github.ajalt.clikt.core.NoOpCliktCommand
import com.github.ajalt.clikt.core.ParameterHolder
import com.github.ajalt.clikt.core.main
import com.github.ajalt.clikt.core.subcommands
import com.github.ajalt.clikt.parameters.arguments.argument
import com.github.ajalt.clikt.parameters.groups.OptionGroup
Expand Down Expand Up @@ -142,12 +144,14 @@ private class InfoCommand(
inputFs: FileSystem,
outputFs: FileSystem,
output: PrintStream,
) : CliktCommand(name = "info", help = "Display info about a binary.") {
) : CliktCommand(name = "info") {
private val type by binaryType()
private val outputOptions by OutputOptions(outputFs, output)
private val file by argument("FILE", help = "Input file.")
.path(mustExist = true, canBeDir = false, mustBeReadable = true, fileSystem = inputFs)

override fun help(context: Context) = "Display info about a binary."

override fun run() {
val info = when (type) {
BinaryType.Apk -> ApkInfo(file.asInput().toApk())
Expand All @@ -164,7 +168,7 @@ private class DiffCommand(
inputFs: FileSystem,
outputFs: FileSystem,
output: PrintStream,
) : CliktCommand(name = "diff", help = "Display changes between two binaries.") {
) : CliktCommand(name = "diff") {
private val inputOptions by object : OptionGroup("Input options") {
private val type by binaryType()

Expand All @@ -188,6 +192,8 @@ private class DiffCommand(
private val new by argument("NEW", help = "New input file.")
.path(mustExist = true, canBeDir = false, mustBeReadable = true, fileSystem = inputFs)

override fun help(context: Context) = "Display changes between two binaries."

override fun run() {
val diff = inputOptions.parse(old.asInput(), new.asInput())
outputOptions.write(diff)
Expand All @@ -197,7 +203,7 @@ private class DiffCommand(
private class MembersCommand(
inputFs: FileSystem,
private val stdout: PrintStream,
) : CliktCommand(name = "members", help = "List methods or fields of a binary.") {
) : CliktCommand(name = "members") {
private val binary by argument("FILE", help = "Input file.")
.path(mustExist = true, canBeDir = false, mustBeReadable = true, fileSystem = inputFs)

Expand Down Expand Up @@ -237,6 +243,8 @@ private class MembersCommand(
Referenced,
}

override fun help(context: Context) = "List methods or fields of a binary."

override fun run() {
val input = binary.asInput()

Expand Down
8 changes: 0 additions & 8 deletions diffuse/src/main/rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,3 @@
##############
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

##############
### Clikt ###
##############
-keep class com.sun.jna.** { *; }
-keep class * implements com.sun.jna.** { *; }
-keepattributes RuntimeVisibleAnnotations,RuntimeVisibleParameterAnnotations,RuntimeVisibleTypeAnnotations,AnnotationDefault
-dontwarn org.graalvm.**
-dontwarn com.oracle.svm.core.annotate.Delete
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ guava = "31.0.1-jre"
dalvikdx = "14.0.0_r21"
apkparser = "31.6.1"
apksign = "8.6.1"
clikt = "4.4.0"
clikt = "5.0.0"
junit = "5.11.0"
okio = "3.9.1"
byteunits = "0.9.1"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit 0f9befb

Please sign in to comment.