Skip to content

Commit

Permalink
Update to latest deps (#14)
Browse files Browse the repository at this point in the history
* Update to latest deps

* Fix release builds

* Add maestro tests back

* Revert "Add maestro tests back"

This reverts commit 5c01eae.
  • Loading branch information
aaalaniz authored Mar 2, 2024
1 parent d33c2c4 commit 9de3599
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 42 deletions.
14 changes: 7 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[versions]
core-splashscreen = "1.0.1"
kotlin = "1.9.20"
agp = "8.1.0"
compose = "1.5.11"
ksp = "1.9.21-1.0.15"
kotlin = "1.9.22"
agp = "8.2.2"
compose = "1.6.0"
ksp = "1.9.22-1.0.16"
kotlin-inject = "0.6.3"
circuit = "0.17.0"
androidx-activity-compose = "1.8.1"
circuit = "0.19.1"
androidx-activity-compose = "1.8.2"
androidx-appcompat = "1.6.1"
androidx-core-ktx = "1.12.0"
datastore-version = "1.1.0-alpha07"
datastore-version = "1.1.0-beta01"

[libraries]
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "core-splashscreen" }
Expand Down
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 @@
#Wed Aug 30 21:10:07 CDT 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
44 changes: 16 additions & 28 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ plugins {

kotlin {
androidTarget()

ios()
iosX64()
iosArm64()
iosSimulatorArm64()
Expand All @@ -28,7 +26,7 @@ kotlin {
}

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
Expand All @@ -42,38 +40,18 @@ kotlin {
implementation(libs.androidx.datastore.core.okio)
}
}
val commonTest by getting {
commonTest {
dependencies {
implementation(libs.kotlin.test)
}
}
val androidMain by getting {
androidMain {
dependencies {
api(libs.androidx.activity.compose)
api(libs.androidx.appcompat)
api(libs.androidx.core.ktx)
}
}
val androidUnitTest by getting
val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val iosMain by getting {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
}
val iosTest by getting
val iosX64Test by getting {
dependsOn(iosTest)
}
val iosArm64Test by getting {
dependsOn(iosTest)
}
val iosSimulatorArm64Test by getting {
dependsOn(iosTest)
}
}
}

Expand All @@ -82,12 +60,11 @@ android {
namespace = "xyz.alaniz.aaron.lightsaber"

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/androidMain/res", "src/commonMain/resources")
sourceSets["main"].resources.srcDirs("src/commonMain/resources")
sourceSets["main"].res.srcDirs("src/androidMain/res", "src/commonMain/composeResources/files")

defaultConfig {
minSdk = (findProperty("android.minSdk") as String).toInt()
targetSdk = (findProperty("android.targetSdk") as String).toInt()
lint.targetSdk = (findProperty("android.targetSdk") as String).toInt()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
Expand All @@ -109,4 +86,15 @@ dependencies {
add("kspIosX64", libs.kotlin.inject.ksp)
add("kspIosArm64", libs.kotlin.inject.ksp)
add("kspIosSimulatorArm64", libs.kotlin.inject.ksp)
}

/**
* A workaround for iOS release builds of Circuit
*
* https://youtrack.jetbrains.com/issue/KT-64508/IndexOutOfBoundsException-in-Konan-StaticInitializersOptimization
*/
kotlin.targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget> {
binaries.all {
freeCompilerArgs += "-Xdisable-phases=RemoveRedundantCallsToStaticInitializersPhase"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AndroidSoundPlayer(

soundResourceToStreamIdMap = sounds.associateWith { sound ->
val resourceId = context.resources.getIdentifier(
sound.name, sound.directory, context.packageName
sound.name, "raw", context.packageName
)
SoundIds(loadId = soundPool.load(context, resourceId, 1))
}.toMutableMap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import xyz.alaniz.aaron.lightsaber.di.ApplicationComponent
@Composable
fun App(initialScreen: Screen, createAppComponent: (CoroutineScope, Navigator) -> ApplicationComponent) {
val scope = rememberCoroutineScope()
val backstack = rememberSaveableBackStack { push(initialScreen) }
val backstack = rememberSaveableBackStack(root = initialScreen)
val navigator = rememberCircuitNavigator(backstack) {
/**
* TODO handle root pops
Expand All @@ -26,7 +26,7 @@ fun App(initialScreen: Screen, createAppComponent: (CoroutineScope, Navigator) -

CircuitCompositionLocals(appComponent.circuit) {
NavigableCircuitContent(
navigator = navigator, backstack = backstack, decoration = GestureNavigationDecoration {
navigator = navigator, backStack = backstack, decoration = GestureNavigationDecoration {
navigator::pop
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ package xyz.alaniz.aaron.lightsaber.audio
class SoundResource(
val name: String,
val fileType: String,
internal val directory: String = "raw",
internal val directory: String = "files/raw",
)
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ import com.slack.circuit.runtime.CircuitContext
import com.slack.circuit.runtime.screen.Screen
import com.slack.circuit.runtime.ui.Ui
import com.slack.circuit.runtime.ui.ui
import lightsaber.shared.generated.resources.Res
import lightsaber.shared.generated.resources.lightsaber_handle
import me.tatarka.inject.annotations.Inject
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
Expand All @@ -62,7 +64,7 @@ fun Lightsaber(lightsaberState: LightsaberState, modifier: Modifier = Modifier)
lightsaberState.onEvent(LightsaberEvent.SettingsSelected)
}
val lightSaberHandlePainter =
painterResource(res = "drawable/lightsaber_handle.xml")
painterResource(resource = Res.drawable.lightsaber_handle)
val lightSaberHandleWidth = 110.dp
val lightSaberHeightDp = 480.dp
val lightSaberHeightPx = with(LocalDensity.current) { lightSaberHeightDp.toPx() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package xyz.alaniz.aaron.lightsaber.audio

import kotlinx.cinterop.ExperimentalForeignApi
import me.tatarka.inject.annotations.Inject
import org.jetbrains.compose.resources.resource
import platform.Foundation.NSBundle
import platform.Foundation.NSURL
import platform.AVFAudio.AVAudioEngine
Expand Down

0 comments on commit 9de3599

Please sign in to comment.