build.gradle.kts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. freeCompilerArgs = listOf("-Xcontext-receivers")
  51. }
  52. }
  53. java {
  54. targetCompatibility = JavaVersion.VERSION_11
  55. withSourcesJar()
  56. }
  57. publishing {
  58. repositories {
  59. maven {
  60. name = "GitHubPackages"
  61. url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
  62. credentials {
  63. username = System.getenv("GITHUB_ACTOR")
  64. password = System.getenv("GITHUB_TOKEN")
  65. }
  66. }
  67. }
  68. publications {
  69. create<MavenPublication>("revanced-patcher-publication") {
  70. from(components["java"])
  71. version = project.version.toString()
  72. pom {
  73. name = "ReVanced Patcher"
  74. description = "Patcher used by ReVanced."
  75. url = "https://revanced.app"
  76. licenses {
  77. license {
  78. name = "GNU General Public License v3.0"
  79. url = "https://www.gnu.org/licenses/gpl-3.0.en.html"
  80. }
  81. }
  82. developers {
  83. developer {
  84. id = "ReVanced"
  85. name = "ReVanced"
  86. email = "contact@revanced.app"
  87. }
  88. }
  89. scm {
  90. connection = "scm:git:git://github.com/revanced/revanced-patcher.git"
  91. developerConnection = "scm:git:git@github.com:revanced/revanced-patcher.git"
  92. url = "https://github.com/revanced/revanced-patcher"
  93. }
  94. }
  95. }
  96. }
  97. }
  98. signing {
  99. useGpgCmd()
  100. sign(publishing.publications["revanced-patcher-publication"])
  101. }