| /* |
| * SPDX-FileCopyrightText: 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") version "8.1.2" |
| id("org.jetbrains.kotlin.android") version "1.7.10" |
| } |
| |
| apply { |
| plugin<GenerateBpPlugin>() |
| } |
| |
| buildscript { |
| repositories { |
| maven("https://raw.githubusercontent.com/lineage-next/gradle-generatebp/v1.4/.m2") |
| } |
| |
| dependencies { |
| classpath("org.lineageos:gradle-generatebp:+") |
| } |
| } |
| |
| android { |
| compileSdk = 34 |
| namespace = "com.android.calculator2" |
| |
| defaultConfig { |
| applicationId = "com.android.calculator2" |
| minSdk = 31 |
| targetSdk = 34 |
| 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.txt"), |
| "proguard.flags" |
| ) |
| ) |
| } |
| getByName("debug") { |
| // Append .dev to package name so we won't conflict with AOSP build. |
| applicationIdSuffix = ".dev" |
| } |
| } |
| compileOptions { |
| sourceCompatibility = JavaVersion.VERSION_17 |
| targetCompatibility = JavaVersion.VERSION_17 |
| } |
| sourceSets { |
| getByName("main") { |
| res.srcDirs("res") |
| java.srcDirs("src") |
| assets.srcDirs("assets") |
| manifest.srcFile("AndroidManifest.xml") |
| } |
| } |
| } |
| |
| dependencies { |
| implementation("androidx.gridlayout:gridlayout:1.0.0") |
| implementation("androidx.webkit:webkit:1.7.0") |
| implementation("com.google.android.material:material:1.9.0") |
| implementation("com.hp:crcalc:1.0") |
| } |
| |
| configure<GenerateBpPluginExtension> { |
| targetSdk.set(android.defaultConfig.targetSdk!!) |
| availableInAOSP.set { module: Module -> |
| when { |
| module.group.startsWith("androidx") -> true |
| module.group.startsWith("org.jetbrains") -> true |
| module.group == "com.google.errorprone" -> true |
| module.group == "com.google.guava" -> true |
| module.group == "junit" -> true |
| else -> false |
| } |
| } |
| } |