build.gradle.kts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. plugins {
  2. kotlin("jvm") version "1.9.10"
  3. alias(libs.plugins.shadow)
  4. }
  5. group = "app.revanced"
  6. repositories {
  7. mavenCentral()
  8. mavenLocal()
  9. google()
  10. maven { url = uri("https://jitpack.io") }
  11. }
  12. dependencies {
  13. implementation(libs.revanced.patcher)
  14. implementation(libs.revanced.library)
  15. implementation(libs.kotlinx.coroutines.core)
  16. implementation(libs.picocli)
  17. testImplementation(libs.kotlin.test)
  18. }
  19. kotlin { jvmToolchain(11) }
  20. tasks {
  21. test {
  22. useJUnitPlatform()
  23. testLogging {
  24. events("PASSED", "SKIPPED", "FAILED")
  25. }
  26. }
  27. processResources {
  28. expand("projectVersion" to project.version)
  29. }
  30. shadowJar {
  31. manifest {
  32. attributes("Main-Class" to "app.revanced.cli.command.MainCommandKt")
  33. }
  34. minimize {
  35. exclude(dependency("org.jetbrains.kotlin:.*"))
  36. exclude(dependency("org.bouncycastle:.*"))
  37. exclude(dependency("app.revanced:.*"))
  38. }
  39. }
  40. build {
  41. dependsOn(shadowJar)
  42. }
  43. /*
  44. Dummy task to hack gradle-semantic-release-plugin to release this project.
  45. Explanation:
  46. SemVer is a standard for versioning libraries.
  47. For that reason the semantic-release plugin uses the "publish" task to publish libraries.
  48. However, this subproject is not a library, and the "publish" task is not available for this subproject.
  49. Because semantic-release is not designed to handle this case, we need to hack it.
  50. RE: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
  51. */
  52. register<DefaultTask>("publish") {
  53. group = "publishing"
  54. description = "Dummy task to hack gradle-semantic-release-plugin to release ReVanced CLI"
  55. dependsOn(build)
  56. }
  57. }