Skip to content

Commit

Permalink
Dependency updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-Fabi authored Jan 4, 2024
2 parents 0a302fd + 532b1e4 commit ed72f11
Show file tree
Hide file tree
Showing 11 changed files with 205 additions and 152 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
packages: write
needs: changes
if: ${{ (github.event_name != 'workflow_dispatch' && needs.changes.outputs.shared == 'true') || (github.event_name == 'workflow_dispatch' && !github.event.inputs.androidOnly) }}
uses: touchlab/KMMBridgeGithubWorkflow/.github/workflows/faktorybuildautoversion.yml@v1.0
uses: touchlab/KMMBridgeGithubWorkflow/.github/workflows/faktorybuildautoversion.yml@v1.1
with:
jvmVersion: 17
versionBaseProperty: SHARED_BASE_VERSION
Expand Down
71 changes: 32 additions & 39 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import java.util.Date
import java.util.Properties

plugins {
id("com.android.application")
id("com.github.triplet.play") version "3.8.4"
kotlin("android")
id("com.google.devtools.ksp") version "1.9.20-1.0.13"
alias(libs.plugins.kotlin.android)
alias(libs.plugins.android.application)
alias(libs.plugins.play.publisher)
alias(libs.plugins.google.ksp)
}

private val versionProperty by lazy {
Expand All @@ -23,9 +23,13 @@ val SHARED_BASE_VERSION: String by project
version = versionProperty.getProperty("androidVersion")
group = SHARED_GROUP

kotlin {
jvmToolchain(17)
}

android {
namespace = "org.datepollsystems.waiterrobot.android"
compileSdk = Versions.androidCompileSdk
compileSdk = libs.versions.android.compileSdk.get().toInt()

androidResources {
generateLocaleConfig = true
Expand All @@ -34,9 +38,9 @@ android {
defaultConfig {
applicationId = this@android.namespace

minSdk = Versions.androidMinSdk
targetSdk = Versions.androidTargetSdk
buildToolsVersion = Versions.androidBuildTools
minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
buildToolsVersion = libs.versions.android.buildTools.get()

versionName = version.toString()
versionCode = run {
Expand Down Expand Up @@ -85,7 +89,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = Versions.composeCompiler
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
}

packaging {
Expand All @@ -95,8 +99,6 @@ android {
}

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

Expand Down Expand Up @@ -130,14 +132,14 @@ android {
// Include the generated navigation sources
kotlin.sourceSets {
getByName(name) {
kotlin.srcDir("${project.buildDir}/generated/ksp/$name/kotlin")
kotlin.srcDir(File(project.layout.buildDirectory.asFile.get(), "/generated/ksp/$name/kotlin"))
}
}

// Write built version to file after creating a bundle (needed for ci, to create the version tag)
if (this.name.endsWith("Release")) {
tasks.findByName("publish${this.name.capitalizeAsciiOnly()}Bundle")!!.doLast {
File(project.buildDir, "version.tag")
File(project.layout.buildDirectory.asFile.get(), "version.tag")
.writeText(this@variant.versionName)
}
}
Expand Down Expand Up @@ -179,47 +181,38 @@ dependencies {
implementation(project(":shared"))
}

implementation("androidx.lifecycle:lifecycle-process:${Versions.androidxLifecycle}")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:${Versions.androidxLifecycle}")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation(libs.androidx.lifecycle.process)
implementation(libs.androidx.lifecycle.runtime)
implementation(libs.androidx.appcompat)

coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")
coreLibraryDesugaring(libs.android.desugar)

// Compose
runtimeOnly("androidx.compose.compiler:compiler:${Versions.composeCompiler}")
implementation("androidx.activity:activity-compose:1.7.2")
implementation("androidx.compose.foundation:foundation:${Versions.compose}")
implementation("androidx.compose.foundation:foundation-layout:${Versions.compose}")
implementation("androidx.compose.ui:ui-graphics:${Versions.compose}")
implementation("androidx.compose.ui:ui:${Versions.compose}")
implementation("androidx.compose.ui:ui-tooling:${Versions.compose}")
implementation("androidx.compose.ui:ui-tooling-preview:${Versions.compose}")
implementation("androidx.compose.material:material:${Versions.compose}")
implementation("androidx.compose.material:material-icons-core:${Versions.compose}")
implementation("androidx.compose.material:material-icons-extended:${Versions.compose}")
runtimeOnly(libs.androidx.compose.compiler)
implementation(libs.bundles.android.compose)

// Compose helpers
implementation("com.google.accompanist:accompanist-permissions:0.32.0")
implementation(libs.accompanist.permissions)

// Architecture (MVI)
implementation("org.orbit-mvi:orbit-compose:${Versions.orbitMvi}")
implementation(libs.orbit.compose)

// Dependency injection
implementation("io.insert-koin:koin-androidx-compose:3.4.6") // Not aligned with other koin version
implementation(libs.koin.compose) // Not aligned with other koin version

// SafeCompose Navigation Args
implementation("io.github.raamcosta.compose-destinations:core:${Versions.composeDestinations}")
ksp("io.github.raamcosta.compose-destinations:ksp:${Versions.composeDestinations}")
implementation(libs.compose.destinations)
ksp(libs.compose.destinations.ksp)

// CameraX
implementation("androidx.camera:camera-camera2:${Versions.camera}")
implementation("androidx.camera:camera-view:${Versions.camera}")
implementation("androidx.camera:camera-lifecycle:${Versions.camera}")
implementation(libs.androidx.camera.camera2)
implementation(libs.androidx.camera.view)
implementation(libs.androidx.camera.lifecycle)

// QrCode Scanning
implementation("com.google.mlkit:barcode-scanning:17.2.0")
implementation(libs.barcode.scanning)

// In-App-Update support
implementation("com.google.android.play:app-update:2.1.0")
implementation("com.google.android.play:app-update-ktx:2.1.0")
implementation(libs.app.update)
implementation(libs.app.update.ktx)
}
24 changes: 7 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.report.ReportMergeTask

buildscript {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
dependencies {
val kotlinVersion = "1.9.20"
classpath("com.android.tools.build:gradle:8.1.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
classpath("org.jetbrains.kotlin:kotlin-serialization:${kotlinVersion}")
classpath("com.codingfeline.buildkonfig:buildkonfig-gradle-plugin:0.14.0")
}
}

plugins {
id("io.gitlab.arturbosch.detekt") version "1.23.1"
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.detekt) apply true
}

val detektReportMergeSarif by tasks.registering(ReportMergeTask::class) {
Expand All @@ -31,7 +21,7 @@ allprojects {
mavenCentral()
}

apply(plugin = "io.gitlab.arturbosch.detekt")
apply(plugin = rootProject.libs.plugins.kotlin.detekt.get().pluginId)

detekt {
config.from(rootDir.resolve("detekt.yml"))
Expand All @@ -42,7 +32,7 @@ allprojects {
}

dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.1")
detektPlugins(rootProject.libs.detekt.formatting)
}

tasks.withType<Detekt>().configureEach {
Expand Down
6 changes: 0 additions & 6 deletions buildSrc/build.gradle.kts

This file was deleted.

22 changes: 0 additions & 22 deletions buildSrc/src/main/java/Versions.kt

This file was deleted.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ kotlin.native.cacheKind.iosArm64=none
kotlin.native.cacheKind.iosX64=none
kotlin.native.cacheKind.iosSimulatorArm64=none

SHARED_BASE_VERSION=1.2
SHARED_BASE_VERSION=1.3
SHARED_GROUP=org.datepollsystems.waiterrobot
112 changes: 112 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
[versions]
# Shared
kotlin = "1.9.21" # Always check https://developer.android.com/jetpack/androidx/releases/compose-kotlin for compose version compatibility
ksp = "1.9.21-1.0.16" # First part must match the kotlin version
detektFormatting = "1.23.4"
kermit = "1.2.2"
koin = "3.5.3"
orbitMvi = "6.1.0"
mokoMvvm = "0.16.1"
ktor = "2.3.7"
settings = "1.1.1"
realm = "1.13.0"
detekt = "1.23.4"
kotlinx-serialization-json = "1.6.2"
kotlinx-datetime = "0.5.0"
buildkonfig = "0.15.1"
skie = "0.6.1"
kmmbridge = "0.5.1"
kmmresources = "1.0.0-alpha11"

# Android
android-minSdk = "24"
android-targetSdk = "33"
android-compileSdk = "34"
android-buildTools = "34.0.0"
android-gradle = "8.2.0"
android-camera = "1.3.1"
android-desugar = "2.0.4"
androidx-lifecycle = "2.6.2"
androidx-appcompat = "1.6.1"
androidx-compose = "1.5.4"
androidx-compose-compiler = "1.5.7"
androidx-compose-activity = "1.8.2"
compose-destinations = "1.9.56"
play-publisher = "3.8.6"
accompanistPermissions = "0.32.0"
koinCompose = "3.5.3"
appUpdate = "2.1.0"
barcodeScanning = "17.2.0"

[libraries]

accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanistPermissions" }
android-desugar = { module = "com.android.tools:desugar_jdk_libs", version.ref = "android-desugar" }
androidx-camera-camera2 = { module = "androidx.camera:camera-camera2", version.ref = "android-camera" }
androidx-camera-lifecycle = { module = "androidx.camera:camera-lifecycle", version.ref = "android-camera" }
androidx-camera-view = { module = "androidx.camera:camera-view", version.ref = "android-camera" }
androidx-lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "androidx-lifecycle" }
androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
androidx-compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "androidx-compose-compiler" }
androidx-compose-activity = { module = "androidx.activity:activity-compose", version.ref = "androidx-compose-activity" }
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidx-compose" }
androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "androidx-compose" }
androidx-compose-ui-core = { module = "androidx.compose.ui:ui", version.ref = "androidx-compose" }
androidx-compose-ui-graphics = { module = "androidx.compose.ui:ui-graphics", version.ref = "androidx-compose" }
androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "androidx-compose" }
androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "androidx-compose" }
androidx-compose-material-core = { module = "androidx.compose.material:material", version.ref = "androidx-compose" }
androidx-compose-material-icons = { module = "androidx.compose.material:material-icons-core", version.ref = "androidx-compose" }
androidx-compose-material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version.ref = "androidx-compose" }

app-update = { module = "com.google.android.play:app-update", version.ref = "appUpdate" }
app-update-ktx = { module = "com.google.android.play:app-update-ktx", version.ref = "appUpdate" }
barcode-scanning = { module = "com.google.mlkit:barcode-scanning", version.ref = "barcodeScanning" }
compose-destinations = { module = "io.github.raamcosta.compose-destinations:core", version.ref = "compose-destinations" }
compose-destinations-ksp = { module = "io.github.raamcosta.compose-destinations:ksp", version.ref = "compose-destinations" }

koin-compose = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koinCompose" }
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" }

detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detektFormatting" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" }
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }

touchlab-kermit = { module = "co.touchlab:kermit", version.ref = "kermit" }
touchlab-skie-annotations = { module = "co.touchlab.skie:configuration-annotations", version.ref = "skie" }

ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" }
ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" }
ktor-client-auth = { module = "io.ktor:ktor-client-auth", version.ref = "ktor" }
ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" }
ktor-client-serialization-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }

realm = { module = "io.realm.kotlin:library-base", version.ref = "realm" }
settings = { module = "com.russhwolf:multiplatform-settings", version.ref = "settings" }
settings-coroutines = { module = "com.russhwolf:multiplatform-settings-coroutines", version.ref = "settings" }

orbit-compose = { module = "org.orbit-mvi:orbit-compose", version.ref = "orbitMvi" }
orbit-core = { module = "org.orbit-mvi:orbit-core", version.ref = "orbitMvi" }
moko-mvvm = { module = "dev.icerock.moko:mvvm-core", version.ref = "mokoMvvm" }

[bundles]
android-compose = ["androidx-compose-activity", "androidx-compose-foundation", "androidx-compose-foundation-layout", "androidx-compose-ui-core", "androidx-compose-ui-graphics", "androidx-compose-ui-tooling", "androidx-compose-ui-tooling-preview", "androidx-compose-material-core", "androidx-compose-material-icons", "androidx-compose-material-icons-extended"]

[plugins]
android-application = { id = "com.android.application", version.ref = "android-gradle" }
android-library = { id = "com.android.library", version.ref = "android-gradle" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlin-detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
play-publisher = { id = "com.github.triplet.play", version.ref = "play-publisher" }
google-ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
buildkonfig = { id = "com.codingfeline.buildkonfig", version.ref = "buildkonfig" }
touchlab-skie = { id = "co.touchlab.skie", version.ref = "skie" }
touchlab-kmmbridge = { id = "co.touchlab.kmmbridge", version.ref = "kmmbridge" }
kmmresources = { id = "dev.jamiecraane.plugins.kmmresources", version.ref = "kmmresources" }
realm = { id = "io.realm.kotlin", version.ref = "realm" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Loading

0 comments on commit ed72f11

Please sign in to comment.