blob: 3b6ae2100e1f7aadc2583d9a28e8220c56cabad2 [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 Stefani64ddd9e2024-10-13 10:38:04 +020023 maven("https://raw.githubusercontent.com/lineage-next/gradle-generatebp/v1.13/.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 {
51 isMinifyEnabled = false
52 proguardFiles(
53 getDefaultProguardFile("proguard-android-optimize.txt"),
54 "proguard-rules.pro"
55 )
56 }
57
58 debug {
59 // Append .dev to package name so we won't conflict with AOSP build.
60 applicationIdSuffix = ".dev"
61 }
62 }
63
64 compileOptions {
Luca Stefanife805dd2024-09-20 14:42:31 +020065 sourceCompatibility = JavaVersion.VERSION_17
66 targetCompatibility = JavaVersion.VERSION_17
Sebastiano Barezzi380db732024-09-14 22:12:58 +020067 }
68
69 kotlinOptions {
Luca Stefanife805dd2024-09-20 14:42:31 +020070 jvmTarget = "17"
Sebastiano Barezzi380db732024-09-14 22:12:58 +020071 }
72}
73
74dependencies {
75 implementation(libs.androidx.activity)
76 implementation(libs.androidx.appcompat)
77 implementation(libs.androidx.constraintlayout)
78 implementation(libs.androidx.core.ktx)
79 implementation(libs.androidx.fragment.ktx)
80 implementation(libs.androidx.lifecycle.service)
81 implementation(libs.androidx.media3.common.ktx)
82 implementation(libs.androidx.media3.exoplayer)
83 implementation(libs.androidx.media3.exoplayer.midi)
84 implementation(libs.androidx.media3.session)
85 implementation(libs.androidx.media3.ui)
86 implementation(libs.androidx.navigation.fragment.ktx)
87 implementation(libs.androidx.navigation.ui.ktx)
88 implementation(libs.androidx.recyclerview)
Luca Stefani03da9f62024-09-21 12:38:57 +020089 implementation(libs.androidx.room.runtime)
90 annotationProcessor(libs.androidx.room.compiler)
91 kapt(libs.androidx.room.compiler)
92 implementation(libs.androidx.room.ktx)
Sebastiano Barezzi380db732024-09-14 22:12:58 +020093 implementation(libs.androidx.viewpager2)
Sebastiano Barezzi970ed732024-10-08 14:07:16 +020094 implementation(libs.coil)
95 implementation(libs.coil.network.okhttp)
Sebastiano Barezzi380db732024-09-14 22:12:58 +020096 implementation(libs.kotlinx.coroutines.guava)
Sebastiano Barezzica5d1612024-10-11 20:24:06 +020097 implementation(libs.kotlinx.serialization.json)
Sebastiano Barezzi380db732024-09-14 22:12:58 +020098 implementation(libs.material)
Sebastiano Barezzi7269adb2024-10-11 09:41:21 +020099 implementation(libs.nier.visualizer) {
100 exclude(group = "com.android.support")
101 }
Sebastiano Barezzica5d1612024-10-11 20:24:06 +0200102 implementation(libs.okhttp)
Sebastiano Barezzi380db732024-09-14 22:12:58 +0200103}
104
105configure<GenerateBpPluginExtension> {
106 targetSdk.set(android.defaultConfig.targetSdk!!)
107 availableInAOSP.set { module: Module ->
108 when {
109 module.group.startsWith("androidx") -> {
110 // We provide our own androidx.media3
111 !module.group.startsWith("androidx.media3")
112 }
113 module.group.startsWith("org.jetbrains") -> true
114 module.group == "com.google.auto.value" -> true
115 module.group == "com.google.code.findbugs" -> true
116 module.group == "com.google.errorprone" -> true
117 module.group == "com.google.guava" -> true
118 module.group == "junit" -> true
119 else -> false
120 }
121 }
122}