build.gradle.kts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. plugins {
  2. alias(libs.plugins.android.application)
  3. alias(libs.plugins.kotlin)
  4. publishing
  5. signing
  6. }
  7. android {
  8. namespace = "app.revanced.integrations"
  9. compileSdk = 33
  10. applicationVariants.all {
  11. outputs.all {
  12. this as com.android.build.gradle.internal.api.ApkVariantOutputImpl
  13. outputFileName = "${rootProject.name}-$versionName.apk"
  14. }
  15. }
  16. defaultConfig {
  17. applicationId = "app.revanced.integrations"
  18. minSdk = 23
  19. targetSdk = 33
  20. multiDexEnabled = false
  21. versionName = version as String
  22. }
  23. buildTypes {
  24. release {
  25. isMinifyEnabled = true
  26. proguardFiles(
  27. getDefaultProguardFile("proguard-android-optimize.txt"),
  28. "proguard-rules.pro",
  29. )
  30. }
  31. }
  32. compileOptions {
  33. sourceCompatibility = JavaVersion.VERSION_11
  34. targetCompatibility = JavaVersion.VERSION_11
  35. }
  36. kotlinOptions {
  37. jvmTarget = JavaVersion.VERSION_11.toString()
  38. }
  39. }
  40. dependencies {
  41. compileOnly(libs.appcompat)
  42. compileOnly(libs.annotation)
  43. compileOnly(libs.okhttp)
  44. compileOnly(libs.retrofit)
  45. compileOnly(project(":stub"))
  46. }
  47. tasks {
  48. val assembleReleaseSignApk by registering {
  49. dependsOn("assembleRelease")
  50. val apk = layout.buildDirectory.file("outputs/apk/release/${rootProject.name}-$version.apk")
  51. inputs.file(apk).withPropertyName("input")
  52. outputs.file(apk.map { it.asFile.resolveSibling("${it.asFile.name}.asc") })
  53. doLast {
  54. signing {
  55. useGpgCmd()
  56. sign(*inputs.files.files.toTypedArray())
  57. }
  58. }
  59. }
  60. // Needed by gradle-semantic-release-plugin.
  61. // Tracking: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435.
  62. publish {
  63. dependsOn(assembleReleaseSignApk)
  64. }
  65. }