build.gradle 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. ext {
  2. capacitorVersion = System.getenv('CAPACITOR_VERSION')
  3. junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
  4. androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
  5. androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
  6. androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
  7. }
  8. buildscript {
  9. repositories {
  10. google()
  11. mavenCentral()
  12. maven {
  13. url "https://plugins.gradle.org/m2/"
  14. }
  15. }
  16. dependencies {
  17. classpath 'com.android.tools.build:gradle:8.7.2'
  18. if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
  19. classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
  20. }
  21. }
  22. }
  23. apply plugin: 'com.android.library'
  24. if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
  25. apply plugin: 'io.github.gradle-nexus.publish-plugin'
  26. apply from: file('../../scripts/android/publish-root.gradle')
  27. apply from: file('../../scripts/android/publish-module.gradle')
  28. }
  29. android {
  30. namespace "com.capacitorjs.plugins.clipboard"
  31. compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
  32. defaultConfig {
  33. minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
  34. targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
  35. versionCode 1
  36. versionName "1.0"
  37. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  38. }
  39. buildTypes {
  40. release {
  41. minifyEnabled false
  42. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  43. }
  44. }
  45. lintOptions {
  46. abortOnError false
  47. }
  48. compileOptions {
  49. sourceCompatibility JavaVersion.VERSION_21
  50. targetCompatibility JavaVersion.VERSION_21
  51. }
  52. publishing {
  53. singleVariant("release")
  54. }
  55. }
  56. repositories {
  57. google()
  58. mavenCentral()
  59. }
  60. dependencies {
  61. implementation fileTree(dir: 'libs', include: ['*.jar'])
  62. if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
  63. implementation "com.capacitorjs:core:$capacitorVersion"
  64. } else {
  65. implementation project(':capacitor-android')
  66. }
  67. implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
  68. testImplementation "junit:junit:$junitVersion"
  69. androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
  70. androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
  71. }