create convention plugins for common config

This commit is contained in:
Adam Brown 2022-12-11 12:49:30 +00:00
parent 0128de4bac
commit f3600290c8
7 changed files with 97 additions and 0 deletions

14
buildSrc/build.gradle Normal file
View File

@ -0,0 +1,14 @@
plugins {
id 'groovy-gradle-plugin'
}
repositories {
gradlePluginPortal()
google()
}
dependencies {
println(libs.versions.android.gp.get())
implementation "com.android.tools.build:gradle:${libs.versions.android.gp.get()}"
// implementation "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20"
}

7
buildSrc/settings.gradle Normal file
View File

@ -0,0 +1,7 @@
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}

View File

@ -0,0 +1,18 @@
plugins {
id 'st-android-library-conventions'
}
android {
buildFeatures.compose = true
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
}
dependencies {
implementation libs.compose.ui
implementation libs.compose.foundation
implementation libs.compose.material.three
implementation libs.compose.icons.extended
implementation libs.compose.activity
}

View File

@ -0,0 +1,29 @@
plugins {
// id "kotlin-android"
}
//
//tasks.withType(Class.forName("org.jetbrains.kotlin.gradle.tasks.KotlinCompile.KotlinCompile")).configureEach {
// kotlinOptions {
// jvmTarget = "1.8"
// freeCompilerArgs = [
// '-opt-in=kotlin.contracts.ExperimentalContracts',
// '-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi',
// ]
// }
//}
def androidSdkVersion = 33
android {
compileSdk androidSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
incremental = true
}
defaultConfig {
minSdkVersion 24
targetSdkVersion androidSdkVersion
}
}

View File

@ -0,0 +1,22 @@
plugins {
id "com.android.library"
id "st-android-conventions"
}
android {
variantFilter { variant ->
if (variant.name == "debug") {
variant.ignore = true
}
}
buildFeatures {
buildConfig = false
dataBinding = false
aidl = false
renderScript = false
resValues = false
shaders = false
viewBinding = false
}
}

View File

@ -0,0 +1,4 @@
plugins {
id "com.android.application"
id "st-android-conventions"
}

View File

@ -0,0 +1,3 @@
plugins {
id 'st-android-compose-library-conventions'
}