Skip to content

Commit

Permalink
Gradle Deps Catalog, Gradle Script Cleanup, Compose, WebApp Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Shabinder committed Sep 30, 2021
1 parent f403ca6 commit 13471d4
Show file tree
Hide file tree
Showing 50 changed files with 727 additions and 636 deletions.
66 changes: 32 additions & 34 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import org.jetbrains.compose.compose
import org.jetbrains.kotlin.kapt.cli.main

plugins {
id("com.android.application")
Expand Down Expand Up @@ -79,6 +78,9 @@ android {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
packagingOptions {
exclude("META-INF/*")
}
configurations {
"implementation" {
exclude(group = "androidx.compose.animation")
Expand All @@ -92,7 +94,7 @@ android {
dependencies {
implementation(compose.material)
implementation(compose.materialIconsExtended)
implementation(Androidx.androidxActivity)
implementation(deps.androidx.activity)

// Project's SubModules
implementation(project(":common:database"))
Expand All @@ -103,43 +105,39 @@ dependencies {
implementation(project(":common:core-components"))
implementation(project(":common:providers"))

// Koin
implementation(Koin.android)
implementation(Koin.compose)
with(deps) {

// DECOMPOSE
implementation(Decompose.decompose)
implementation(Decompose.extensionsCompose)
// Koin
with(koin) {
implementation(androidx.compose)
implementation(android)
}

// MVI
implementation(MVIKotlin.mvikotlin)
implementation(MVIKotlin.mvikotlinMain)
implementation(MVIKotlin.mvikotlinLogging)
implementation(MVIKotlin.mvikotlinTimeTravel)
// DECOMPOSE
with(decompose) {
implementation(dep)
implementation(extensions.compose)
}

// Extras
with(Extras.Android) {
implementation(countly)
implementation(appUpdator)
}
implementation(countly.android)
implementation(android.app.notifier)
implementation(storage.chooser)

with(Versions.androidxLifecycle) {
implementation("androidx.lifecycle:lifecycle-service:$this")
implementation("androidx.lifecycle:lifecycle-common-java8:$this")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:$this")
}
with(bundles) {
implementation(androidx.lifecycle)
implementation(mviKotlin)
implementation(accompanist.inset)
}

implementation(Extras.kermit)
// implementation("com.jakewharton.timber:timber:4.7.1")
implementation("dev.icerock.moko:parcelize:${Versions.mokoParcelize}")
implementation("com.github.shabinder:storage-chooser:2.0.4.45")
implementation("com.google.accompanist:accompanist-insets:0.16.1")
// Test
testImplementation(junit)
androidTestImplementation(androidx.junit)
androidTestImplementation(androidx.expresso)

// Test
testImplementation("junit:junit:4.13.2")
androidTestImplementation(Androidx.junit)
androidTestImplementation(Androidx.expresso)
// Desugar
coreLibraryDesugaring(androidx.desugar)

// Desugaring
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
// Debug
debugImplementation(leak.canary)
}
}
28 changes: 19 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,32 @@ allprojects {
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>>().configureEach {
dependsOn(":common:data-models:generateI18n4kFiles")
kotlinOptions {
if(this is org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions) {
if (this is org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions) {
jvmTarget = "1.8"
}
freeCompilerArgs = (freeCompilerArgs + listOf("-Xopt-in=kotlin.RequiresOptIn"))
}
}

afterEvaluate {
project.extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()?.let { kmpExt ->
kmpExt.sourceSets.run {
all {
languageSettings.useExperimentalAnnotation("kotlin.RequiresOptIn")
languageSettings.useExperimentalAnnotation("kotlinx.serialization.ExperimentalSerializationApi")
configurations.all {
resolutionStrategy {
eachDependency {
if (requested.group == "org.jetbrains.kotlin") {
@Suppress("UnstableApiUsage")
useVersion(deps.kotlin.kotlinGradlePlugin.get().versionConstraint.requiredVersion)
}
removeAll { it.name == "androidAndroidTestRelease" }
}
}
}
afterEvaluate {
project.extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()
?.let { kmpExt ->
kmpExt.sourceSets.run {
all {
languageSettings.useExperimentalAnnotation("kotlin.RequiresOptIn")
languageSettings.useExperimentalAnnotation("kotlinx.serialization.ExperimentalSerializationApi")
}
removeAll { it.name == "androidAndroidTestRelease" }
}
}
}
}
19 changes: 11 additions & 8 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,20 @@ repositories {
}

dependencies {
implementation(Androidx.gradlePlugin)
implementation(JetBrains.Compose.gradlePlugin)
implementation(JetBrains.Kotlin.gradlePlugin)
implementation(JetBrains.Kotlin.serialization)
implementation(SqlDelight.gradlePlugin)
implementation(KTLint.gradlePlugin)
implementation(Internationalization.gradlePlugin)
implementation(Mosaic.gradlePlugin)
with(deps) {
implementation(androidx.gradle.plugin)
implementation(kotlin.compose.gradle)
implementation(ktlint.gradle)
implementation(mosaic.gradle)
implementation(kotlin.kotlinGradlePlugin)
implementation(sqldelight.gradle.plugin)
implementation(i18n4k.gradle.plugin)
implementation(kotlin.serialization)
}
}

kotlin {
// Add Deps to compilation, so it will become available in main project
sourceSets.getByName("main").kotlin.srcDir("buildSrc/src/main/kotlin")
}

Loading

0 comments on commit 13471d4

Please sign in to comment.