blob: a980cd41ad8132341c1023d9eee928e8f10c1dfe [file] [log] [blame]
Sebastiano Barezzi380db732024-09-14 22:12:58 +02001/*
2 * SPDX-FileCopyrightText: 2024 The LineageOS Project
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6import org.lineageos.generatebp.GenerateBpPlugin
7import org.lineageos.generatebp.GenerateBpPluginExtension
8import org.lineageos.generatebp.models.Module
9
10plugins {
11 alias(libs.plugins.android.application)
Luca Stefani03da9f62024-09-21 12:38:57 +020012 alias(libs.plugins.kapt)
Sebastiano Barezzi380db732024-09-14 22:12:58 +020013 alias(libs.plugins.kotlin.android)
Sebastiano Barezzica5d1612024-10-11 20:24:06 +020014 alias(libs.plugins.kotlin.serialization)
Sebastiano Barezzi380db732024-09-14 22:12:58 +020015}
16
17apply {
18 plugin<GenerateBpPlugin>()
19}
20
21buildscript {
22 repositories {
Luca Stefani3a74fc22024-11-03 19:29:16 +010023 maven("https://raw.githubusercontent.com/lineage-next/gradle-generatebp/v1.14/.m2")
Sebastiano Barezzi380db732024-09-14 22:12:58 +020024 }
25
26 dependencies {
27 classpath("org.lineageos:gradle-generatebp:+")
28 }
29}
30
31android {
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 Stefani03da9f62024-09-21 12:38:57 +020041
42 kapt {
43 arguments {
44 arg("room.schemaLocation", "$projectDir/schemas")
45 }
46 }
Sebastiano Barezzi380db732024-09-14 22:12:58 +020047 }
48
49 buildTypes {
50 release {
Luca Stefani7fb64262024-11-03 19:52:00 +010051 // Enables code shrinking, obfuscation, and optimization.
52 isMinifyEnabled = true
53
54 // Enables resource shrinking.
55 isShrinkResources = true
56
Sebastiano Barezzi380db732024-09-14 22:12:58 +020057 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
Alexander Martinza5664b82024-11-14 11:32:57 +010069 flavorDimensions += "branding"
70 productFlavors {
71 create("lineage") {
72 dimension = "branding"
73 }
74 create("shift") {
75 dimension = "branding"
76 applicationId = "eco.shift.apps.twelve"
77 }
78 }
79
Sebastiano Barezzi380db732024-09-14 22:12:58 +020080 compileOptions {
Luca Stefanife805dd2024-09-20 14:42:31 +020081 sourceCompatibility = JavaVersion.VERSION_17
82 targetCompatibility = JavaVersion.VERSION_17
Sebastiano Barezzi380db732024-09-14 22:12:58 +020083 }
84
85 kotlinOptions {
Luca Stefanife805dd2024-09-20 14:42:31 +020086 jvmTarget = "17"
Sebastiano Barezzi380db732024-09-14 22:12:58 +020087 }
88}
89
90dependencies {
91 implementation(libs.androidx.activity)
92 implementation(libs.androidx.appcompat)
93 implementation(libs.androidx.constraintlayout)
94 implementation(libs.androidx.core.ktx)
95 implementation(libs.androidx.fragment.ktx)
96 implementation(libs.androidx.lifecycle.service)
97 implementation(libs.androidx.media3.common.ktx)
98 implementation(libs.androidx.media3.exoplayer)
Sebastiano Barezzi973cc412024-11-07 00:59:36 +010099 implementation(libs.androidx.media3.exoplayer.hls)
Sebastiano Barezzi380db732024-09-14 22:12:58 +0200100 implementation(libs.androidx.media3.exoplayer.midi)
Sebastiano Barezzi973cc412024-11-07 00:59:36 +0100101 implementation(libs.androidx.media3.exoplayer.rtsp)
102 implementation(libs.androidx.media3.exoplayer.smoothstreaming)
Sebastiano Barezzi380db732024-09-14 22:12:58 +0200103 implementation(libs.androidx.media3.session)
104 implementation(libs.androidx.media3.ui)
105 implementation(libs.androidx.navigation.fragment.ktx)
106 implementation(libs.androidx.navigation.ui.ktx)
LuK1337677fdea2024-11-12 20:09:16 +0100107 implementation(libs.androidx.preference)
Sebastiano Barezzi380db732024-09-14 22:12:58 +0200108 implementation(libs.androidx.recyclerview)
Luca Stefani03da9f62024-09-21 12:38:57 +0200109 implementation(libs.androidx.room.runtime)
110 annotationProcessor(libs.androidx.room.compiler)
111 kapt(libs.androidx.room.compiler)
112 implementation(libs.androidx.room.ktx)
Sebastiano Barezzi380db732024-09-14 22:12:58 +0200113 implementation(libs.androidx.viewpager2)
Sebastiano Barezzi970ed732024-10-08 14:07:16 +0200114 implementation(libs.coil)
115 implementation(libs.coil.network.okhttp)
Alexander Martinz1164b982024-11-14 10:28:44 +0100116 implementation(libs.kotlinx.coroutines.guava) {
117 // Exclude compile time dependencies
118 exclude("com.google.j2objc", "j2objc-annotations")
119 exclude("org.checkerframework", "checker-qual")
120 }
Sebastiano Barezzica5d1612024-10-11 20:24:06 +0200121 implementation(libs.kotlinx.serialization.json)
Sebastiano Barezzi380db732024-09-14 22:12:58 +0200122 implementation(libs.material)
Sebastiano Barezzi7269adb2024-10-11 09:41:21 +0200123 implementation(libs.nier.visualizer) {
124 exclude(group = "com.android.support")
125 }
Sebastiano Barezzica5d1612024-10-11 20:24:06 +0200126 implementation(libs.okhttp)
Sebastiano Barezzi380db732024-09-14 22:12:58 +0200127}
128
129configure<GenerateBpPluginExtension> {
130 targetSdk.set(android.defaultConfig.targetSdk!!)
131 availableInAOSP.set { module: Module ->
132 when {
133 module.group.startsWith("androidx") -> {
134 // We provide our own androidx.media3
135 !module.group.startsWith("androidx.media3")
136 }
137 module.group.startsWith("org.jetbrains") -> true
138 module.group == "com.google.auto.value" -> true
139 module.group == "com.google.code.findbugs" -> true
140 module.group == "com.google.errorprone" -> true
141 module.group == "com.google.guava" -> true
142 module.group == "junit" -> true
143 else -> false
144 }
145 }
146}