Skip to content

Commit

Permalink
Recorder: Use generateBp plugin
Browse files Browse the repository at this point in the history
Change-Id: Ic5431575b684ee2d416d5707e499f0cf538ce4c4
  • Loading branch information
luk1337 committed Oct 3, 2023
1 parent 8c8858f commit 7ce9ce8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
13 changes: 6 additions & 7 deletions app/src/main/Android.bp → app/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,21 @@
android_app {
name: "Recorder",

resource_dirs: ["res"],
manifest: "src/main/AndroidManifest.xml",
resource_dirs: ["src/main/res"],

srcs: [
"java/**/*.java",
"gen/**/*.java"
"src/main/java/**/*.java",
"src/main/gen/**/*.java"
],

product_specific: true,

static_libs: [
"androidx.annotation_annotation",
"androidx-constraintlayout_constraintlayout",
"androidx-constraintlayout_constraintlayout-solver",
// DO NOT EDIT THIS SECTION MANUALLY
"androidx.appcompat_appcompat",
"androidx.recyclerview_recyclerview",
"com.google.android.material_material",
"androidx-constraintlayout_constraintlayout",
],

sdk_version: "current",
Expand Down
31 changes: 31 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
import org.lineageos.generatebp.GenerateBpPlugin
import org.lineageos.generatebp.GenerateBpPluginExtension
import org.lineageos.generatebp.models.Module

plugins {
id("com.android.application")
}

apply {
plugin<GenerateBpPlugin>()
}

buildscript {
repositories {
maven("https://raw.githubusercontent.com/lineage-next/gradle-generatebp/v1.2/.m2")
}

dependencies {
classpath("org.lineageos:gradle-generatebp:+")
}
}

android {
compileSdk = 33

Expand Down Expand Up @@ -43,3 +61,16 @@ dependencies {
implementation("com.google.android.material:material:1.6.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
}

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.guava" -> true
else -> false
}
}
}

0 comments on commit 7ce9ce8

Please sign in to comment.