Sebastiano Barezzi | 380db73 | 2024-09-14 22:12:58 +0200 | [diff] [blame] | 1 | /* |
| 2 | * SPDX-FileCopyrightText: 2024 The LineageOS Project |
| 3 | * SPDX-License-Identifier: Apache-2.0 |
| 4 | */ |
| 5 | |
| 6 | import org.lineageos.generatebp.GenerateBpPlugin |
| 7 | import org.lineageos.generatebp.GenerateBpPluginExtension |
| 8 | import org.lineageos.generatebp.models.Module |
| 9 | |
| 10 | plugins { |
| 11 | alias(libs.plugins.android.application) |
| 12 | alias(libs.plugins.kotlin.android) |
| 13 | } |
| 14 | |
| 15 | apply { |
| 16 | plugin<GenerateBpPlugin>() |
| 17 | } |
| 18 | |
| 19 | buildscript { |
| 20 | repositories { |
| 21 | maven("https://raw.githubusercontent.com/lineage-next/gradle-generatebp/v1.11/.m2") |
| 22 | } |
| 23 | |
| 24 | dependencies { |
| 25 | classpath("org.lineageos:gradle-generatebp:+") |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | android { |
| 30 | namespace = "org.lineageos.twelve" |
| 31 | compileSdk = 35 |
| 32 | |
| 33 | defaultConfig { |
| 34 | applicationId = "org.lineageos.twelve" |
| 35 | minSdk = 30 |
| 36 | targetSdk = 35 |
| 37 | versionCode = 1 |
| 38 | versionName = "1.0" |
| 39 | } |
| 40 | |
| 41 | buildTypes { |
| 42 | release { |
| 43 | isMinifyEnabled = false |
| 44 | proguardFiles( |
| 45 | getDefaultProguardFile("proguard-android-optimize.txt"), |
| 46 | "proguard-rules.pro" |
| 47 | ) |
| 48 | } |
| 49 | |
| 50 | debug { |
| 51 | // Append .dev to package name so we won't conflict with AOSP build. |
| 52 | applicationIdSuffix = ".dev" |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | compileOptions { |
Luca Stefani | fe805dd | 2024-09-20 14:42:31 +0200 | [diff] [blame] | 57 | sourceCompatibility = JavaVersion.VERSION_17 |
| 58 | targetCompatibility = JavaVersion.VERSION_17 |
Sebastiano Barezzi | 380db73 | 2024-09-14 22:12:58 +0200 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | kotlinOptions { |
Luca Stefani | fe805dd | 2024-09-20 14:42:31 +0200 | [diff] [blame] | 62 | jvmTarget = "17" |
Sebastiano Barezzi | 380db73 | 2024-09-14 22:12:58 +0200 | [diff] [blame] | 63 | } |
| 64 | } |
| 65 | |
| 66 | dependencies { |
| 67 | implementation(libs.androidx.activity) |
| 68 | implementation(libs.androidx.appcompat) |
| 69 | implementation(libs.androidx.constraintlayout) |
| 70 | implementation(libs.androidx.core.ktx) |
| 71 | implementation(libs.androidx.fragment.ktx) |
| 72 | implementation(libs.androidx.lifecycle.service) |
| 73 | implementation(libs.androidx.media3.common.ktx) |
| 74 | implementation(libs.androidx.media3.exoplayer) |
| 75 | implementation(libs.androidx.media3.exoplayer.midi) |
| 76 | implementation(libs.androidx.media3.session) |
| 77 | implementation(libs.androidx.media3.ui) |
| 78 | implementation(libs.androidx.navigation.fragment.ktx) |
| 79 | implementation(libs.androidx.navigation.ui.ktx) |
| 80 | implementation(libs.androidx.recyclerview) |
| 81 | implementation(libs.androidx.viewpager2) |
| 82 | implementation(libs.kotlinx.coroutines.guava) |
| 83 | implementation(libs.material) |
| 84 | } |
| 85 | |
| 86 | configure<GenerateBpPluginExtension> { |
| 87 | targetSdk.set(android.defaultConfig.targetSdk!!) |
| 88 | availableInAOSP.set { module: Module -> |
| 89 | when { |
| 90 | module.group.startsWith("androidx") -> { |
| 91 | // We provide our own androidx.media3 |
| 92 | !module.group.startsWith("androidx.media3") |
| 93 | } |
| 94 | module.group.startsWith("org.jetbrains") -> true |
| 95 | module.group == "com.google.auto.value" -> true |
| 96 | module.group == "com.google.code.findbugs" -> true |
| 97 | module.group == "com.google.errorprone" -> true |
| 98 | module.group == "com.google.guava" -> true |
| 99 | module.group == "junit" -> true |
| 100 | else -> false |
| 101 | } |
| 102 | } |
| 103 | } |