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