114 lines
3.2 KiB
Plaintext
114 lines
3.2 KiB
Plaintext
import java.util.Properties
|
|
import org.lineageos.generatebp.GenerateBpPlugin
|
|
import org.lineageos.generatebp.GenerateBpPluginExtension
|
|
import org.lineageos.generatebp.models.Module
|
|
|
|
plugins {
|
|
id("com.android.application")
|
|
id("kotlin-android")
|
|
}
|
|
|
|
apply {
|
|
plugin<GenerateBpPlugin>()
|
|
}
|
|
|
|
buildscript {
|
|
repositories {
|
|
maven("https://raw.githubusercontent.com/lineage-next/gradle-generatebp/v1.2/.m2")
|
|
}
|
|
|
|
dependencies {
|
|
classpath("org.lineageos:gradle-generatebp:+")
|
|
}
|
|
}
|
|
|
|
val keystorePropertiesFile = rootProject.file("keystore.properties")
|
|
val keystoreProperties = Properties().apply {
|
|
if (keystorePropertiesFile.exists()) {
|
|
load(keystorePropertiesFile.inputStream())
|
|
}
|
|
}
|
|
|
|
android {
|
|
compileSdk = 33
|
|
|
|
defaultConfig {
|
|
applicationId = "org.lineageos.updater"
|
|
minSdk = 30
|
|
targetSdk = 33
|
|
versionCode = 1
|
|
versionName = "1.0"
|
|
}
|
|
|
|
buildTypes {
|
|
getByName("release") {
|
|
// Includes the default ProGuard rules files.
|
|
setProguardFiles(
|
|
listOf(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
)
|
|
}
|
|
getByName("debug") {
|
|
// Append .dev to package name so we won't conflict with AOSP build.
|
|
applicationIdSuffix = ".dev"
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "1.8"
|
|
}
|
|
|
|
signingConfigs {
|
|
create("release") {
|
|
(keystoreProperties["keyAlias"] as String?)?.let {
|
|
keyAlias = it
|
|
}
|
|
(keystoreProperties["keyPassword"] as String?)?.let {
|
|
keyPassword = it
|
|
}
|
|
(keystoreProperties["storeFile"] as String?)?.let {
|
|
storeFile = file(it)
|
|
}
|
|
(keystoreProperties["storePassword"] as String?)?.let {
|
|
storePassword = it
|
|
}
|
|
}
|
|
}
|
|
namespace = "org.lineageos.updater"
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly(fileTree(mapOf("dir" to "../system_libs", "include" to listOf("*.jar"))))
|
|
|
|
implementation("androidx.core:core-ktx:1.9.0")
|
|
implementation("androidx.appcompat:appcompat:1.6.1")
|
|
implementation("androidx.cardview:cardview:1.0.0")
|
|
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1")
|
|
implementation("androidx.localbroadcastmanager:localbroadcastmanager:1.1.0")
|
|
implementation("androidx.preference:preference:1.2.0")
|
|
implementation("androidx.recyclerview:recyclerview:1.2.1")
|
|
implementation("com.google.android.material:material:1.9.0-alpha01")
|
|
}
|
|
|
|
configure<GenerateBpPluginExtension> {
|
|
targetSdk.set(android.defaultConfig.targetSdk!!)
|
|
availableInAOSP.set { module: Module ->
|
|
when {
|
|
module.group.startsWith("androidx") -> true
|
|
module.group.startsWith("org.jetbrains") -> true
|
|
module.group == "com.google.android.material" -> true
|
|
module.group == "com.google.errorprone" -> true
|
|
module.group == "com.google.guava" -> true
|
|
module.group == "junit" -> true
|
|
else -> false
|
|
}
|
|
}
|
|
}
|