blob: 168cd53bb52d1c99f587a76ba49039a984fcae93 [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)
14}
15
16apply {
17 plugin<GenerateBpPlugin>()
18}
19
20buildscript {
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
30android {
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 Stefani03da9f62024-09-21 12:38:57 +020040
41 kapt {
42 arguments {
43 arg("room.schemaLocation", "$projectDir/schemas")
44 }
45 }
Sebastiano Barezzi380db732024-09-14 22:12:58 +020046 }
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 Stefanife805dd2024-09-20 14:42:31 +020064 sourceCompatibility = JavaVersion.VERSION_17
65 targetCompatibility = JavaVersion.VERSION_17
Sebastiano Barezzi380db732024-09-14 22:12:58 +020066 }
67
68 kotlinOptions {
Luca Stefanife805dd2024-09-20 14:42:31 +020069 jvmTarget = "17"
Sebastiano Barezzi380db732024-09-14 22:12:58 +020070 }
71}
72
73dependencies {
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 Stefani03da9f62024-09-21 12:38:57 +020088 implementation(libs.androidx.room.runtime)
89 annotationProcessor(libs.androidx.room.compiler)
90 kapt(libs.androidx.room.compiler)
91 implementation(libs.androidx.room.ktx)
Sebastiano Barezzi380db732024-09-14 22:12:58 +020092 implementation(libs.androidx.viewpager2)
93 implementation(libs.kotlinx.coroutines.guava)
94 implementation(libs.material)
95}
96
97configure<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}