build.gradle 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. ext {
  2. androidxActivityVersion = project.hasProperty('androidxActivityVersion') ? rootProject.ext.androidxActivityVersion : '1.8.0'
  3. androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
  4. androidxCoordinatorLayoutVersion = project.hasProperty('androidxCoordinatorLayoutVersion') ? rootProject.ext.androidxCoordinatorLayoutVersion : '1.2.0'
  5. androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.12.0'
  6. androidxFragmentVersion = project.hasProperty('androidxFragmentVersion') ? rootProject.ext.androidxFragmentVersion : '1.6.2'
  7. androidxWebkitVersion = project.hasProperty('androidxWebkitVersion') ? rootProject.ext.androidxWebkitVersion : '1.9.0'
  8. junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
  9. androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
  10. androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
  11. cordovaAndroidVersion = project.hasProperty('cordovaAndroidVersion') ? rootProject.ext.cordovaAndroidVersion : '10.1.1'
  12. }
  13. buildscript {
  14. ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.9.10'
  15. repositories {
  16. google()
  17. mavenCentral()
  18. maven {
  19. url "https://plugins.gradle.org/m2/"
  20. }
  21. maven{
  22. url "https://maven.mozilla.org/maven2/"
  23. }
  24. }
  25. dependencies {
  26. classpath 'com.android.tools.build:gradle:8.2.1'
  27. if (System.getenv("CAP_PUBLISH") == "true") {
  28. classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
  29. }
  30. }
  31. }
  32. tasks.withType(Javadoc).all { enabled = false }
  33. apply plugin: 'com.android.library'
  34. if (System.getenv("CAP_PUBLISH") == "true") {
  35. apply plugin: 'io.github.gradle-nexus.publish-plugin'
  36. apply from: file('../scripts/publish-root.gradle')
  37. apply from: file('../scripts/publish-module.gradle')
  38. }
  39. android {
  40. namespace "com.getcapacitor.android"
  41. compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
  42. defaultConfig {
  43. minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
  44. targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
  45. versionCode 1
  46. versionName "1.0"
  47. consumerProguardFiles 'proguard-rules.pro'
  48. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  49. }
  50. buildTypes {
  51. release {
  52. minifyEnabled false
  53. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  54. }
  55. }
  56. lintOptions {
  57. baseline file("lint-baseline.xml")
  58. abortOnError true
  59. warningsAsErrors true
  60. lintConfig file('lint.xml')
  61. }
  62. compileOptions {
  63. sourceCompatibility JavaVersion.VERSION_17
  64. targetCompatibility JavaVersion.VERSION_17
  65. }
  66. publishing {
  67. singleVariant("release")
  68. }
  69. }
  70. repositories {
  71. google()
  72. mavenCentral()
  73. maven{
  74. url "https://maven.mozilla.org/maven2/"
  75. }
  76. }
  77. dependencies {
  78. implementation fileTree(dir: 'libs', include: ['*.jar'])
  79. implementation platform("org.jetbrains.kotlin:kotlin-bom:$kotlin_version")
  80. implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
  81. implementation "androidx.core:core:$androidxCoreVersion"
  82. implementation "androidx.activity:activity:$androidxActivityVersion"
  83. implementation "androidx.fragment:fragment:$androidxFragmentVersion"
  84. implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
  85. implementation "androidx.webkit:webkit:$androidxWebkitVersion"
  86. testImplementation "junit:junit:$junitVersion"
  87. androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
  88. androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
  89. implementation "org.apache.cordova:framework:$cordovaAndroidVersion"
  90. testImplementation 'org.json:json:20231013'
  91. testImplementation 'org.mockito:mockito-inline:5.2.0'
  92. // api "org.mozilla.geckoview:geckoview-arm64-v8a:123.0.20240213221259"
  93. api "org.mozilla.geckoview:geckoview-armeabi-v7a:123.0.20240213221259"
  94. implementation 'org.nanohttpd:nanohttpd-webserver:2.3.1'
  95. }