mirror of
https://github.com/lineage-next/gradle-generatebp
synced 2026-09-30 18:41:00 -07:00
82 lines
2.2 KiB
Kotlin
82 lines
2.2 KiB
Kotlin
/*
|
|
* SPDX-FileCopyrightText: The LineageOS Project
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import org.lineageos.generatebp.GenerateBpPluginExtension
|
|
import org.lineageos.generatebp.models.Module
|
|
|
|
plugins {
|
|
alias(libs.plugins.android.application)
|
|
alias(libs.plugins.lineageos.generatebp)
|
|
}
|
|
|
|
android {
|
|
namespace = "com.example.myapplication"
|
|
compileSdk = 36
|
|
|
|
defaultConfig {
|
|
applicationId = "com.example.myapplication"
|
|
minSdk = 26
|
|
targetSdk = 36
|
|
versionCode = 1
|
|
versionName = "1.0"
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
// Enables code shrinking, obfuscation, and optimization.
|
|
isMinifyEnabled = true
|
|
|
|
// Enables resource shrinking.
|
|
isShrinkResources = true
|
|
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
}
|
|
|
|
debug {
|
|
// Append .dev to package name so we won't conflict with AOSP build.
|
|
applicationIdSuffix = ".dev"
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(libs.androidx.appcompat)
|
|
implementation(libs.androidx.core.ktx)
|
|
implementation(libs.androidx.lifecycle.common)
|
|
implementation(libs.coil)
|
|
implementation(libs.coil.network.okhttp)
|
|
testImplementation(libs.junit)
|
|
implementation(libs.material)
|
|
androidTestImplementation(libs.test.espresso.core)
|
|
androidTestImplementation(libs.test.ext.junit)
|
|
}
|
|
|
|
configure<GenerateBpPluginExtension> {
|
|
targetSdk.set(android.defaultConfig.targetSdk!!)
|
|
minSdk.set(android.defaultConfig.minSdk!!)
|
|
versionCode.set(android.defaultConfig.versionCode!!)
|
|
versionName.set(android.defaultConfig.versionName!!)
|
|
availableInAOSP.set { module: Module ->
|
|
when {
|
|
module.group.startsWith("androidx") -> {
|
|
// We provide our own core-ktx
|
|
module.name != "core-ktx"
|
|
}
|
|
module.group.startsWith("org.jetbrains") -> true
|
|
else -> false
|
|
}
|
|
}
|
|
}
|