Georg Veichtlbauer | 8350ec9 | 2023-10-30 13:35:43 +0100 | [diff] [blame] | 1 | /* |
| 2 | * SPDX-FileCopyrightText: 2023 The LineageOS Project |
| 3 | * SPDX-License-Identifier: Apache-2.0 |
| 4 | */ |
| 5 | |
Georg Veichtlbauer | 7dd0dd4 | 2023-10-26 16:08:50 +0200 | [diff] [blame] | 6 | import org.lineageos.generatebp.GenerateBpPlugin |
| 7 | import org.lineageos.generatebp.GenerateBpPluginExtension |
| 8 | import org.lineageos.generatebp.models.Module |
| 9 | |
Georg Veichtlbauer | 8350ec9 | 2023-10-30 13:35:43 +0100 | [diff] [blame] | 10 | plugins { |
| 11 | id("com.android.application") version "8.1.2" |
| 12 | id("org.jetbrains.kotlin.android") version "1.7.10" |
| 13 | } |
| 14 | |
Georg Veichtlbauer | 7dd0dd4 | 2023-10-26 16:08:50 +0200 | [diff] [blame] | 15 | apply { |
| 16 | plugin<GenerateBpPlugin>() |
| 17 | } |
| 18 | |
| 19 | buildscript { |
| 20 | repositories { |
| 21 | maven("https://raw.githubusercontent.com/lineage-next/gradle-generatebp/v1.4/.m2") |
| 22 | } |
| 23 | |
| 24 | dependencies { |
| 25 | classpath("org.lineageos:gradle-generatebp:+") |
| 26 | } |
| 27 | } |
| 28 | |
Georg Veichtlbauer | 8350ec9 | 2023-10-30 13:35:43 +0100 | [diff] [blame] | 29 | android { |
| 30 | compileSdk = 34 |
| 31 | namespace = "org.lineageos.eleven" |
| 32 | |
| 33 | defaultConfig { |
| 34 | applicationId = "org.lineageos.eleven" |
Georg Veichtlbauer | 1513770 | 2023-11-14 22:28:57 +0100 | [diff] [blame] | 35 | minSdk = 30 |
Georg Veichtlbauer | 8350ec9 | 2023-10-30 13:35:43 +0100 | [diff] [blame] | 36 | targetSdk = 34 |
| 37 | versionCode = 420 |
| 38 | versionName = "4.2.0" |
| 39 | } |
| 40 | |
| 41 | buildTypes { |
| 42 | getByName("debug") { |
| 43 | applicationIdSuffix = ".dev" |
| 44 | } |
| 45 | getByName("release") { |
| 46 | // Enables code shrinking, obfuscation, and optimization. |
| 47 | isMinifyEnabled = true |
| 48 | |
| 49 | // Enables resource shrinking. |
| 50 | isShrinkResources = true |
| 51 | |
| 52 | // Includes the default ProGuard rules files. |
| 53 | setProguardFiles( |
| 54 | listOf( |
| 55 | getDefaultProguardFile("proguard-android.txt"), |
| 56 | "proguard.cfg" |
| 57 | ) |
| 58 | ) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | compileOptions { |
| 63 | sourceCompatibility = JavaVersion.VERSION_1_8 |
| 64 | targetCompatibility = JavaVersion.VERSION_1_8 |
| 65 | } |
| 66 | |
| 67 | sourceSets { |
| 68 | getByName("main") { |
| 69 | manifest.srcFile("AndroidManifest.xml") |
| 70 | |
| 71 | aidl.srcDirs("src") |
| 72 | assets.srcDirs("assets") |
| 73 | java.srcDirs("src") |
| 74 | res.srcDirs("res") |
| 75 | resources.srcDirs("res") |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | buildFeatures { |
| 80 | aidl = true |
| 81 | } |
| 82 | |
| 83 | lint { |
| 84 | abortOnError = true |
| 85 | baseline = file("lint-baseline.xml") |
| 86 | checkAllWarnings = true |
| 87 | showAll = true |
| 88 | warningsAsErrors = true |
| 89 | xmlReport = false |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | dependencies { |
| 94 | implementation("androidx.appcompat:appcompat:1.6.1") |
| 95 | implementation("androidx.cardview:cardview:1.0.0") |
Georg Veichtlbauer | 1b62925 | 2023-10-30 13:39:45 +0100 | [diff] [blame] | 96 | implementation("androidx.legacy:legacy-support-v4:1.0.0") |
Georg Veichtlbauer | 8350ec9 | 2023-10-30 13:35:43 +0100 | [diff] [blame] | 97 | implementation("androidx.palette:palette:1.0.0") |
| 98 | implementation("androidx.preference:preference:1.2.1") |
| 99 | implementation("androidx.recyclerview:recyclerview:1.3.1") |
| 100 | implementation("androidx.constraintlayout:constraintlayout:2.1.4") |
| 101 | implementation("com.google.android.material:material:1.9.0") |
| 102 | } |
Georg Veichtlbauer | 7dd0dd4 | 2023-10-26 16:08:50 +0200 | [diff] [blame] | 103 | |
| 104 | configure<GenerateBpPluginExtension> { |
| 105 | targetSdk.set(android.defaultConfig.targetSdk!!) |
| 106 | availableInAOSP.set { module: Module -> |
| 107 | when { |
| 108 | module.group.startsWith("androidx") -> true |
| 109 | module.group.startsWith("org.jetbrains") -> true |
| 110 | module.group == "com.google.errorprone" -> true |
| 111 | module.group == "com.google.guava" -> true |
| 112 | module.group == "junit" -> true |
| 113 | else -> false |
| 114 | } |
| 115 | } |
| 116 | } |