blob: 60b04230a86a837b89ce6d5f783e05223ccbc536 [file] [log] [blame]
Georg Veichtlbauer8350ec92023-10-30 13:35:43 +01001/*
2 * SPDX-FileCopyrightText: 2023 The LineageOS Project
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
Georg Veichtlbauer7dd0dd42023-10-26 16:08:50 +02006import org.lineageos.generatebp.GenerateBpPlugin
7import org.lineageos.generatebp.GenerateBpPluginExtension
8import org.lineageos.generatebp.models.Module
9
Georg Veichtlbauer8350ec92023-10-30 13:35:43 +010010plugins {
11 id("com.android.application") version "8.1.2"
12 id("org.jetbrains.kotlin.android") version "1.7.10"
13}
14
Georg Veichtlbauer7dd0dd42023-10-26 16:08:50 +020015apply {
16 plugin<GenerateBpPlugin>()
17}
18
19buildscript {
20 repositories {
21 maven("https://raw.githubusercontent.com/lineage-next/gradle-generatebp/v1.4/.m2")
22 }
23
24 dependencies {
25 classpath("org.lineageos:gradle-generatebp:+")
26 }
27}
28
Georg Veichtlbauer8350ec92023-10-30 13:35:43 +010029android {
30 compileSdk = 34
31 namespace = "org.lineageos.eleven"
32
33 defaultConfig {
34 applicationId = "org.lineageos.eleven"
Georg Veichtlbauer15137702023-11-14 22:28:57 +010035 minSdk = 30
Georg Veichtlbauer8350ec92023-10-30 13:35:43 +010036 targetSdk = 34
37 versionCode = 420
38 versionName = "4.2.0"
39 }
40
41 buildTypes {
42 getByName("debug") {
43 applicationIdSuffix = ".dev"
44 }
45 getByName("release") {
46 // Enables code shrinking, obfuscation, and optimization.
47 isMinifyEnabled = true
48
49 // Enables resource shrinking.
50 isShrinkResources = true
51
52 // Includes the default ProGuard rules files.
53 setProguardFiles(
54 listOf(
55 getDefaultProguardFile("proguard-android.txt"),
56 "proguard.cfg"
57 )
58 )
59 }
60 }
61
62 compileOptions {
63 sourceCompatibility = JavaVersion.VERSION_1_8
64 targetCompatibility = JavaVersion.VERSION_1_8
65 }
66
67 sourceSets {
68 getByName("main") {
69 manifest.srcFile("AndroidManifest.xml")
70
71 aidl.srcDirs("src")
72 assets.srcDirs("assets")
73 java.srcDirs("src")
74 res.srcDirs("res")
75 resources.srcDirs("res")
76 }
77 }
78
79 buildFeatures {
80 aidl = true
81 }
82
83 lint {
84 abortOnError = true
85 baseline = file("lint-baseline.xml")
86 checkAllWarnings = true
87 showAll = true
88 warningsAsErrors = true
89 xmlReport = false
90 }
91}
92
93dependencies {
94 implementation("androidx.appcompat:appcompat:1.6.1")
95 implementation("androidx.cardview:cardview:1.0.0")
Georg Veichtlbauer1b629252023-10-30 13:39:45 +010096 implementation("androidx.legacy:legacy-support-v4:1.0.0")
Georg Veichtlbauer8350ec92023-10-30 13:35:43 +010097 implementation("androidx.palette:palette:1.0.0")
98 implementation("androidx.preference:preference:1.2.1")
99 implementation("androidx.recyclerview:recyclerview:1.3.1")
100 implementation("androidx.constraintlayout:constraintlayout:2.1.4")
101 implementation("com.google.android.material:material:1.9.0")
102}
Georg Veichtlbauer7dd0dd42023-10-26 16:08:50 +0200103
104configure<GenerateBpPluginExtension> {
105 targetSdk.set(android.defaultConfig.targetSdk!!)
106 availableInAOSP.set { module: Module ->
107 when {
108 module.group.startsWith("androidx") -> true
109 module.group.startsWith("org.jetbrains") -> true
110 module.group == "com.google.errorprone" -> true
111 module.group == "com.google.guava" -> true
112 module.group == "junit" -> true
113 else -> false
114 }
115 }
116}