Merge pull request #293 from ouchadam/tech/conventions

Replace buildSrc with conventions submodule
This commit is contained in:
Adam Brown 2022-12-12 22:32:24 +00:00 committed by GitHub
commit 61fff76844
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 14 additions and 168 deletions

3
.gitmodules vendored
View File

@ -4,3 +4,6 @@
[submodule "chat-engine"]
path = chat-engine
url = git@github.com:ouchadam/chat-engine.git
[submodule "tools/conventions"]
path = tools/conventions
url = git@github.com:ouchadam/conventions.git

View File

@ -7,7 +7,9 @@ applyCrashlyticsIfRelease()
android {
namespace "app.dapk.st"
defaultConfig {
applicationId "app.dapk.st"
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
@ -47,7 +49,6 @@ dependencies {
implementation "chat-engine:matrix-chat-engine"
implementation "chat-engine.matrix:store"
implementation libs.compose.ui
implementation libs.ktor.android
implementation libs.sqldelight.android
implementation libs.matrix.olm

View File

@ -1,3 +1,7 @@
plugins {
id "st-base-conventions" apply false
}
def launchTask = getGradle()
.getStartParameter()
.getTaskRequests()

View File

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

View File

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

View File

@ -1,20 +0,0 @@
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

@ -1,18 +0,0 @@
plugins {
id "kotlin-android"
}
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

@ -1,22 +0,0 @@
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

@ -1,64 +0,0 @@
plugins {
id "com.android.application"
id "st-android-conventions"
}
android {
ndkVersion "25.0.8141415"
defaultConfig {
applicationId "app.dapk.st"
def versionJson = new groovy.json.JsonSlurper().parseText(rootProject.file('version.json').text)
versionCode versionJson.code
versionName versionJson.name
if (isDebugBuild) {
resConfigs "en", "xxhdpi"
} else {
resConfigs "en"
}
if (isFoss()) {
archivesBaseName = "$archivesBaseName-foss"
}
}
bundle {
abi.enableSplit true
density.enableSplit true
language.enableSplit true
}
buildTypes {
debug {
versionNameSuffix = " [debug]"
matchingFallbacks = ['release']
signingConfig.storeFile rootProject.file("tools/debug.keystore")
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
if (project.hasProperty("unsigned")) {
// releases are signed externally
} else {
signingConfig = buildTypes.debug.signingConfig
}
}
}
compileOptions {
coreLibraryDesugaringEnabled true
}
packagingOptions {
resources.excludes += "DebugProbesKt.bin"
}
}
if (isDebugBuild) {
androidComponents {
def release = selector().withBuildType("release")
beforeVariants(release) { it.enabled = false }
}
}

View File

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

View File

@ -3,43 +3,26 @@ kotlin = "1.7.20"
coroutines = "1.6.4"
sqldelight = "1.5.4"
ktor = "2.2.1"
compose = "1.2.1"
compose-compiler = "1.3.2"
android-gp = "7.3.1"
[plugins]
android-application = { id = "com.android.application", version.ref = "android-gp" }
android-library = { id = "com.android.library", version.ref = "android-gp" }
android-kotlin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version = "2.9.2" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version = "2.9.2" }
sqldelight = { id = "com.squareup.sqldelight", version.ref = "sqldelight" }
[libraries]
compose-ui = { group = "androidx.compose.ui", name = "ui", version.ref = "compose" }
compose-foundation = { group = "androidx.compose.foundation", name = "foundation", version.ref = "compose" }
compose-material-three = { group = "androidx.compose.material3", name = "material3", version = "1.0.1" }
compose-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "compose" }
compose-activity = { group = "androidx.activity", name = "activity-compose", version = "1.6.1" }
compose-coil = { group = "io.coil-kt", name = "coil-compose", version = "2.2.2" }
android-desugar = { group = "com.android.tools", name = "desugar_jdk_libs", version = "1.1.5" }
compose-coil = { group = "io.coil-kt", name = "coil-compose", version = "2.2.2" }
accompanist-systemuicontroller = { group = "com.google.accompanist", name = "accompanist-systemuicontroller", version = "0.28.0" }
matrix-olm = { group = "org.matrix.android", name = "olm-sdk", version = "3.2.12" }
unifiedpush = { group = "com.github.UnifiedPush", name = "android-connector", version = "2.1.1" }
firebase-bom = { module = "com.google.firebase:firebase-bom", version = "31.1.1" }
kotlin-serialization = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version = "1.4.1" }
kotlin-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" }
kotlin-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" }
kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version.ref = "kotlin" }

View File

@ -1,4 +1,5 @@
pluginManagement {
includeBuild 'tools/conventions'
repositories {
gradlePluginPortal()
google()

1
tools/conventions Submodule

@ -0,0 +1 @@
Subproject commit 730feff287862141dc7e3924821f57027b6c312b