mirror of
https://github.com/lineage-next/gradle-generatebp
synced 2026-09-30 18:41:00 -07:00
91 lines
2.4 KiB
Kotlin
91 lines
2.4 KiB
Kotlin
/*
|
|
* SPDX-FileCopyrightText: 2023-2025 The LineageOS Project
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import org.lineageos.generatebp.GenerateBpPlugin
|
|
import org.lineageos.generatebp.GenerateBpPluginExtension
|
|
import org.lineageos.generatebp.models.Module
|
|
|
|
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
}
|
|
|
|
apply {
|
|
plugin<GenerateBpPlugin>()
|
|
}
|
|
|
|
buildscript {
|
|
repositories {
|
|
mavenLocal()
|
|
// maven("https://raw.githubusercontent.com/lineage-next/gradle-generatebp/v1.23/.m2")
|
|
}
|
|
|
|
dependencies {
|
|
classpath("org.lineageos:gradle-generatebp:+")
|
|
}
|
|
}
|
|
|
|
android {
|
|
namespace = "com.example.myapplication"
|
|
compileSdk = 34
|
|
|
|
defaultConfig {
|
|
applicationId = "com.example.myapplication"
|
|
minSdk = 26
|
|
targetSdk = 34
|
|
versionCode = 1
|
|
versionName = "1.0"
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = false
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "1.8"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.10"))
|
|
|
|
implementation("androidx.core:core-ktx:1.12.0")
|
|
implementation("androidx.appcompat:appcompat:1.6.1")
|
|
implementation("com.google.android.material:material:1.12.0")
|
|
implementation("io.coil-kt.coil3:coil:3.0.0-rc02")
|
|
implementation("io.coil-kt.coil3:coil-network-okhttp:3.0.0-rc02")
|
|
testImplementation("junit:junit:4.13.2")
|
|
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
|
}
|
|
|
|
configure<GenerateBpPluginExtension> {
|
|
targetSdk.set(android.defaultConfig.targetSdk!!)
|
|
minSdk.set(android.defaultConfig.minSdk!!)
|
|
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
|
|
}
|
|
}
|
|
}
|