Skip to content

Commit

Permalink
Clean up build scripts and use common extension to setup the defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rken committed Oct 14, 2023
1 parent e863e1e commit 8bb8b00
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 66 deletions.
8 changes: 1 addition & 7 deletions app-common-io/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,8 @@ apply(plugin = "dagger.hilt.android.plugin")

android {
namespace = "${ProjectConfig.packageName}.common.io"
compileSdk = ProjectConfig.compileSdk

defaultConfig {
minSdk = ProjectConfig.minSdk
targetSdk = ProjectConfig.targetSdk

consumerProguardFiles("consumer-rules.pro")
}
setupLibraryDefaults()

setupModuleBuildTypes()

Expand Down
6 changes: 1 addition & 5 deletions app-common-pkgs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ apply(plugin = "dagger.hilt.android.plugin")

android {
namespace = "${ProjectConfig.packageName}.common.pkgs"
compileSdk = ProjectConfig.compileSdk

defaultConfig {
minSdk = ProjectConfig.minSdk
targetSdk = ProjectConfig.targetSdk
}
setupLibraryDefaults()

setupModuleBuildTypes()

Expand Down
6 changes: 1 addition & 5 deletions app-common-root/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ apply(plugin = "dagger.hilt.android.plugin")

android {
namespace = "${ProjectConfig.packageName}.common.root"
compileSdk = ProjectConfig.compileSdk

defaultConfig {
minSdk = ProjectConfig.minSdk
targetSdk = ProjectConfig.targetSdk
}
setupLibraryDefaults()

setupModuleBuildTypes()

Expand Down
6 changes: 1 addition & 5 deletions app-common-shell/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ apply(plugin = "dagger.hilt.android.plugin")

android {
namespace = "${ProjectConfig.packageName}.common.shell"
compileSdk = ProjectConfig.compileSdk

defaultConfig {
minSdk = ProjectConfig.minSdk
targetSdk = ProjectConfig.targetSdk
}
setupLibraryDefaults()

setupModuleBuildTypes()

Expand Down
6 changes: 1 addition & 5 deletions app-common-shizuku/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ apply(plugin = "dagger.hilt.android.plugin")

android {
namespace = "${ProjectConfig.packageName}.common.shizuku"
compileSdk = ProjectConfig.compileSdk

defaultConfig {
minSdk = ProjectConfig.minSdk
targetSdk = ProjectConfig.targetSdk
}
setupLibraryDefaults()

setupModuleBuildTypes()

Expand Down
6 changes: 1 addition & 5 deletions app-common-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ plugins {

android {
namespace = "eu.darken.sdmse.common"
compileSdk = ProjectConfig.compileSdk

defaultConfig {
minSdk = ProjectConfig.minSdk
targetSdk = ProjectConfig.targetSdk
}
setupLibraryDefaults()

setupModuleBuildTypes()

Expand Down
6 changes: 1 addition & 5 deletions app-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ apply(plugin = "dagger.hilt.android.plugin")

android {
namespace = "${ProjectConfig.packageName}.common"
compileSdk = ProjectConfig.compileSdk

defaultConfig {
minSdk = ProjectConfig.minSdk
targetSdk = ProjectConfig.targetSdk
}
setupLibraryDefaults()

setupModuleBuildTypes()

Expand Down
29 changes: 0 additions & 29 deletions buildSrc/src/main/java/ProjectConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,36 +53,7 @@ fun LibraryExtension.setupLibraryDefaults() {

defaultConfig {
minSdk = ProjectConfig.minSdk

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}

compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
freeCompilerArgs = freeCompilerArgs + listOf(
"-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-Xopt-in=kotlinx.coroutines.FlowPreview",
"-Xopt-in=kotlin.time.ExperimentalTime",
"-Xopt-in=kotlin.RequiresOptIn"
)
}

fun Packaging.() {
resources.excludes += "DebugProbesKt.bin"
}
}

Expand Down

0 comments on commit 8bb8b00

Please sign in to comment.