build.gradle.kts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. import org.jetbrains.kotlin.gradle.dsl.JvmTarget
  2. plugins {
  3. alias(libs.plugins.kotlin)
  4. alias(libs.plugins.binary.compatibility.validator)
  5. `maven-publish`
  6. signing
  7. }
  8. group = "app.revanced"
  9. tasks {
  10. processResources {
  11. expand("projectVersion" to project.version)
  12. }
  13. test {
  14. useJUnitPlatform()
  15. testLogging {
  16. events("PASSED", "SKIPPED", "FAILED")
  17. }
  18. }
  19. }
  20. repositories {
  21. mavenCentral()
  22. google()
  23. maven {
  24. // A repository must be specified for some reason. "registry" is a dummy.
  25. url = uri("https://maven.pkg.github.com/revanced/registry")
  26. credentials {
  27. username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
  28. password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
  29. }
  30. }
  31. }
  32. dependencies {
  33. // TODO: Convert project to KMP.
  34. compileOnly(libs.android) {
  35. // Exclude, otherwise the org.w3c.dom API breaks.
  36. exclude(group = "xerces", module = "xmlParserAPIs")
  37. }
  38. implementation(libs.apktool.lib)
  39. implementation(libs.kotlin.reflect)
  40. implementation(libs.kotlinx.coroutines.core)
  41. implementation(libs.multidexlib2)
  42. implementation(libs.smali)
  43. implementation(libs.xpp3)
  44. testImplementation(libs.mockk)
  45. testImplementation(libs.kotlin.test)
  46. }
  47. kotlin {
  48. compilerOptions {
  49. jvmTarget.set(JvmTarget.JVM_11)
  50. }
  51. }
  52. java {
  53. targetCompatibility = JavaVersion.VERSION_11
  54. withSourcesJar()
  55. }
  56. publishing {
  57. repositories {
  58. maven {
  59. name = "GitHubPackages"
  60. url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
  61. credentials {
  62. username = System.getenv("GITHUB_ACTOR")
  63. password = System.getenv("GITHUB_TOKEN")
  64. }
  65. }
  66. }
  67. publications {
  68. create<MavenPublication>("revanced-patcher-publication") {
  69. from(components["java"])
  70. version = project.version.toString()
  71. pom {
  72. name = "ReVanced Patcher"
  73. description = "Patcher used by ReVanced."
  74. url = "https://revanced.app"
  75. licenses {
  76. license {
  77. name = "GNU General Public License v3.0"
  78. url = "https://www.gnu.org/licenses/gpl-3.0.en.html"
  79. }
  80. }
  81. developers {
  82. developer {
  83. id = "ReVanced"
  84. name = "ReVanced"
  85. email = "contact@revanced.app"
  86. }
  87. }
  88. scm {
  89. connection = "scm:git:git://github.com/revanced/revanced-patcher.git"
  90. developerConnection = "scm:git:git@github.com:revanced/revanced-patcher.git"
  91. url = "https://github.com/revanced/revanced-patcher"
  92. }
  93. }
  94. }
  95. }
  96. }
  97. signing {
  98. useGpgCmd()
  99. sign(publishing.publications["revanced-patcher-publication"])
  100. }