forked from ReVanced/revanced-cli
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add ReVanced Library subproject (ReVanced#265)
- Loading branch information
Showing
35 changed files
with
874 additions
and
565 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,7 @@ | ||
plugins { | ||
kotlin("jvm") version "1.8.20" | ||
alias(libs.plugins.shadow) | ||
kotlin("jvm") version "1.9.0" apply false | ||
} | ||
|
||
group = "app.revanced" | ||
|
||
dependencies { | ||
implementation(libs.revanced.patcher) | ||
implementation(libs.kotlin.reflect) | ||
implementation(libs.kotlinx.coroutines.core) | ||
implementation(libs.picocli) | ||
implementation(libs.jadb) // Updated fork | ||
implementation(libs.apksig) | ||
implementation(libs.bcpkix.jdk15on) | ||
implementation(libs.jackson.module.kotlin) | ||
testImplementation(libs.kotlin.test) | ||
} | ||
|
||
kotlin { jvmToolchain(11) } | ||
|
||
tasks { | ||
test { | ||
useJUnitPlatform() | ||
testLogging { | ||
events("PASSED", "SKIPPED", "FAILED") | ||
} | ||
} | ||
|
||
processResources { | ||
expand("projectVersion" to project.version) | ||
} | ||
|
||
shadowJar { | ||
manifest { | ||
attributes("Main-Class" to "app.revanced.cli.command.MainCommandKt") | ||
} | ||
minimize { | ||
exclude(dependency("org.jetbrains.kotlin:.*")) | ||
exclude(dependency("org.bouncycastle:.*")) | ||
exclude(dependency("app.revanced:.*")) | ||
} | ||
} | ||
|
||
build { | ||
dependsOn(shadowJar) | ||
} | ||
|
||
// Dummy task to fix the Gradle semantic-release plugin. | ||
// Remove this if you forked it to support building only. | ||
// Tracking issue: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435 | ||
register<DefaultTask>("publish") { | ||
group = "publish" | ||
description = "Dummy task" | ||
dependsOn(build) | ||
} | ||
} | ||
allprojects { | ||
group = "app.revanced" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
plugins { | ||
kotlin("jvm") version "1.9.0" | ||
alias(libs.plugins.shadow) | ||
} | ||
|
||
dependencies { | ||
implementation(project(":revanced-lib")) | ||
implementation(libs.revanced.patcher) | ||
implementation(libs.kotlinx.coroutines.core) | ||
implementation(libs.picocli) | ||
|
||
testImplementation(libs.kotlin.test) | ||
} | ||
|
||
kotlin { jvmToolchain(11) } | ||
|
||
tasks { | ||
test { | ||
useJUnitPlatform() | ||
testLogging { | ||
events("PASSED", "SKIPPED", "FAILED") | ||
} | ||
} | ||
|
||
processResources { | ||
expand("projectVersion" to project.version) | ||
} | ||
|
||
shadowJar { | ||
manifest { | ||
attributes("Main-Class" to "app.revanced.cli.command.MainCommandKt") | ||
} | ||
minimize { | ||
exclude(dependency("org.jetbrains.kotlin:.*")) | ||
exclude(dependency("org.bouncycastle:.*")) | ||
exclude(dependency("app.revanced:.*")) | ||
} | ||
} | ||
|
||
build { | ||
dependsOn(shadowJar) | ||
} | ||
|
||
// Dummy task to fix the Gradle semantic-release plugin. | ||
// Remove this if you forked it to support building only. | ||
// Tracking issue: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435 | ||
register<DefaultTask>("publish") { | ||
group = "publish" | ||
description = "Dummy task" | ||
dependsOn(build) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = "revanced-cli" |
File renamed without changes.
39 changes: 39 additions & 0 deletions
39
revanced-cli/src/main/kotlin/app/revanced/cli/command/MainCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package app.revanced.cli.command | ||
|
||
import app.revanced.cli.command.utility.UtilityCommand | ||
import app.revanced.lib.logging.Logger | ||
import picocli.CommandLine | ||
import picocli.CommandLine.Command | ||
import picocli.CommandLine.IVersionProvider | ||
import java.util.* | ||
|
||
|
||
fun main(args: Array<String>) { | ||
Logger.setDefault() | ||
CommandLine(MainCommand).execute(*args) | ||
} | ||
|
||
private object CLIVersionProvider : IVersionProvider { | ||
override fun getVersion() = arrayOf( | ||
MainCommand::class.java.getResourceAsStream( | ||
"/app/revanced/cli/version.properties" | ||
)?.use { stream -> | ||
Properties().apply { load(stream) }.let { | ||
"ReVanced CLI v${it.getProperty("version")}" | ||
} | ||
} ?: "ReVanced CLI") | ||
} | ||
|
||
@Command( | ||
name = "revanced-cli", | ||
description = ["Command line application to use ReVanced"], | ||
mixinStandardHelpOptions = true, | ||
versionProvider = CLIVersionProvider::class, | ||
subcommands = [ | ||
ListPatchesCommand::class, | ||
PatchCommand::class, | ||
OptionsCommand::class, | ||
UtilityCommand::class, | ||
] | ||
) | ||
private object MainCommand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.