build.gradle 3.1 KB

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