diff --git a/.gitmodules b/.gitmodules index f772238..5e8cc8f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/app/build.gradle b/app/build.gradle index 08b6437..b68fb93 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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 diff --git a/build.gradle b/build.gradle index 872de51..5b6c4ca 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,7 @@ +plugins { + id "st-base-conventions" apply false +} + def launchTask = getGradle() .getStartParameter() .getTaskRequests() diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle deleted file mode 100644 index 5e6682e..0000000 --- a/buildSrc/build.gradle +++ /dev/null @@ -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()}" -} \ No newline at end of file diff --git a/buildSrc/settings.gradle b/buildSrc/settings.gradle deleted file mode 100644 index fa8bc74..0000000 --- a/buildSrc/settings.gradle +++ /dev/null @@ -1,7 +0,0 @@ -dependencyResolutionManagement { - versionCatalogs { - create("libs") { - from(files("../gradle/libs.versions.toml")) - } - } -} \ No newline at end of file diff --git a/buildSrc/src/main/groovy/st-android-compose-library-conventions.gradle b/buildSrc/src/main/groovy/st-android-compose-library-conventions.gradle deleted file mode 100644 index 30ef556..0000000 --- a/buildSrc/src/main/groovy/st-android-compose-library-conventions.gradle +++ /dev/null @@ -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 -} diff --git a/buildSrc/src/main/groovy/st-android-conventions.gradle b/buildSrc/src/main/groovy/st-android-conventions.gradle deleted file mode 100644 index 59ef606..0000000 --- a/buildSrc/src/main/groovy/st-android-conventions.gradle +++ /dev/null @@ -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 - } -} \ No newline at end of file diff --git a/buildSrc/src/main/groovy/st-android-library-conventions.gradle b/buildSrc/src/main/groovy/st-android-library-conventions.gradle deleted file mode 100644 index d9de1fe..0000000 --- a/buildSrc/src/main/groovy/st-android-library-conventions.gradle +++ /dev/null @@ -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 - } -} diff --git a/buildSrc/src/main/groovy/st-application-conventions.gradle b/buildSrc/src/main/groovy/st-application-conventions.gradle deleted file mode 100644 index d0b6a35..0000000 --- a/buildSrc/src/main/groovy/st-application-conventions.gradle +++ /dev/null @@ -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 } - } -} diff --git a/buildSrc/src/main/groovy/st-feature-conventions.gradle b/buildSrc/src/main/groovy/st-feature-conventions.gradle deleted file mode 100644 index 5bba5bd..0000000 --- a/buildSrc/src/main/groovy/st-feature-conventions.gradle +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - id 'st-android-compose-library-conventions' -} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 894a02b..dc56543 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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" } diff --git a/settings.gradle b/settings.gradle index 71063d3..17580aa 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,5 @@ pluginManagement { + includeBuild 'tools/conventions' repositories { gradlePluginPortal() google() diff --git a/tools/conventions b/tools/conventions new file mode 160000 index 0000000..730feff --- /dev/null +++ b/tools/conventions @@ -0,0 +1 @@ +Subproject commit 730feff287862141dc7e3924821f57027b6c312b