| group 'io.flutter.plugins.camerax' |
| version '1.0' |
| |
| buildscript { |
| repositories { |
| google() |
| mavenCentral() |
| } |
| |
| dependencies { |
| classpath 'com.android.tools.build:gradle:7.3.0' |
| } |
| } |
| |
| rootProject.allprojects { |
| repositories { |
| google() |
| mavenCentral() |
| } |
| } |
| |
| apply plugin: 'com.android.library' |
| |
| android { |
| // Conditional for compatibility with AGP <4.2. |
| if (project.android.hasProperty("namespace")) { |
| namespace 'io.flutter.plugins.camerax' |
| } |
| // CameraX dependencies require compilation against version 33 or later. |
| compileSdkVersion 33 |
| |
| compileOptions { |
| sourceCompatibility JavaVersion.VERSION_1_8 |
| targetCompatibility JavaVersion.VERSION_1_8 |
| } |
| |
| defaultConfig { |
| // Many of the CameraX APIs require API 21. |
| minSdkVersion 21 |
| testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| } |
| |
| testOptions { |
| unitTests.includeAndroidResources = true |
| unitTests.returnDefaultValues = true |
| unitTests.all { |
| testLogging { |
| events "passed", "skipped", "failed", "standardOut", "standardError" |
| outputs.upToDateWhen {false} |
| showStandardStreams = true |
| } |
| } |
| } |
| |
| lintOptions { |
| checkAllWarnings true |
| warningsAsErrors true |
| disable 'AndroidGradlePluginVersion', 'GradleDependency', 'InvalidPackage' |
| baseline file("lint-baseline.xml") |
| } |
| } |
| |
| dependencies { |
| // CameraX core library using the camera2 implementation must use same version number. |
| def camerax_version = "1.3.0-alpha04" |
| implementation "androidx.camera:camera-core:${camerax_version}" |
| implementation "androidx.camera:camera-camera2:${camerax_version}" |
| implementation "androidx.camera:camera-lifecycle:${camerax_version}" |
| implementation 'com.google.guava:guava:31.1-android' |
| testImplementation 'junit:junit:4.13.2' |
| testImplementation 'org.mockito:mockito-inline:5.0.0' |
| testImplementation 'androidx.test:core:1.4.0' |
| testImplementation 'org.robolectric:robolectric:4.8' |
| } |