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