| /* |
| * SPDX-FileCopyrightText: 2022-2023 The LineageOS Project |
| * SPDX-License-Identifier: Apache-2.0 |
| */ |
| |
| import org.lineageos.generatebp.GenerateBpPlugin |
| import org.lineageos.generatebp.GenerateBpPluginExtension |
| import org.lineageos.generatebp.models.Module |
| |
| plugins { |
| id("com.android.application") |
| id("kotlin-android") |
| } |
| |
| apply { |
| plugin<GenerateBpPlugin>() |
| } |
| |
| buildscript { |
| repositories { |
| maven("https://raw.githubusercontent.com/lineage-next/gradle-generatebp/v1.3/.m2") |
| } |
| |
| dependencies { |
| classpath("org.lineageos:gradle-generatebp:+") |
| } |
| } |
| |
| android { |
| compileSdk = 33 |
| namespace = "org.lineageos.aperture" |
| |
| defaultConfig { |
| applicationId = "org.lineageos.aperture" |
| minSdk = 26 |
| targetSdk = 33 |
| versionCode = 1 |
| versionName = "1.0" |
| } |
| |
| buildTypes { |
| getByName("release") { |
| // Enables code shrinking, obfuscation, and optimization. |
| isMinifyEnabled = true |
| |
| // Enables resource shrinking. |
| isShrinkResources = true |
| |
| // Includes the default ProGuard rules files. |
| setProguardFiles( |
| listOf( |
| getDefaultProguardFile("proguard-android-optimize.txt"), |
| "proguard-rules.pro" |
| ) |
| ) |
| } |
| getByName("debug") { |
| // Append .dev to package name so we won't conflict with AOSP build. |
| applicationIdSuffix = ".dev" |
| } |
| } |
| |
| compileOptions { |
| sourceCompatibility = JavaVersion.VERSION_1_8 |
| targetCompatibility = JavaVersion.VERSION_1_8 |
| } |
| |
| kotlinOptions { |
| jvmTarget = "1.8" |
| } |
| } |
| |
| dependencies { |
| // Align versions of all Kotlin components |
| implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) |
| |
| implementation("androidx.core:core-ktx:1.10.1") |
| implementation("androidx.activity:activity-ktx:1.7.2") |
| implementation("androidx.appcompat:appcompat:1.6.1") |
| implementation("androidx.constraintlayout:constraintlayout:2.1.4") |
| implementation("androidx.exifinterface:exifinterface:1.3.6") |
| implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1") |
| implementation("androidx.preference:preference:1.2.0") |
| implementation("com.google.android.material:material:1.9.0") |
| |
| // CameraX core library using the camera2 implementation |
| val cameraxVersion = "1.4.0-alpha02" |
| // The following line is optional, as the core library is included indirectly by camera-camera2 |
| implementation("androidx.camera:camera-core:${cameraxVersion}") |
| implementation("androidx.camera:camera-camera2:${cameraxVersion}") |
| // If you want to additionally use the CameraX Lifecycle library |
| implementation("androidx.camera:camera-lifecycle:${cameraxVersion}") |
| // If you want to additionally use the CameraX VideoCapture library |
| implementation("androidx.camera:camera-video:${cameraxVersion}") |
| // If you want to additionally use the CameraX View class |
| implementation("androidx.camera:camera-view:${cameraxVersion}") |
| // If you want to additionally use the CameraX Extensions library |
| implementation("androidx.camera:camera-extensions:${cameraxVersion}") |
| |
| // Media3 |
| val media3Version = "1.1.1" |
| // For media playback using ExoPlayer |
| implementation("androidx.media3:media3-exoplayer:$media3Version") |
| // For building media playback UIs |
| implementation("androidx.media3:media3-ui:$media3Version") |
| |
| // ZXing |
| implementation("com.google.zxing:core:3.5.2") |
| |
| // Coil |
| implementation("io.coil-kt:coil:2.2.2") |
| implementation("io.coil-kt:coil-video:2.2.2") |
| } |
| |
| configure<GenerateBpPluginExtension> { |
| targetSdk.set(android.defaultConfig.targetSdk!!) |
| availableInAOSP.set { module: Module -> |
| when { |
| module.group.startsWith("androidx") -> { |
| // We provide our own androidx.{camera,media3} & lifecycle-common |
| !module.group.startsWith("androidx.camera") && |
| !module.group.startsWith("androidx.media3") && |
| module.name != "lifecycle-common" |
| } |
| module.group.startsWith("org.jetbrains") -> true |
| module.group == "com.google.auto.value" -> true |
| module.group == "com.google.guava" -> true |
| module.group == "junit" -> true |
| else -> false |
| } |
| } |
| } |