From 8348ef5566741146fa62dce85d9d63745b60b9da Mon Sep 17 00:00:00 2001 From: Sargun Vohra Date: Sun, 12 Jan 2025 16:34:33 -0800 Subject: [PATCH] fix #244 (#245) --- .github/workflows/daily.yml | 1 + build.gradle.kts | 8 +++++--- .../dev/sargunv/maplibrecompose/core/layer/Layer.kt | 4 ++-- .../dev/sargunv/maplibrecompose/core/source/Source.kt | 4 ++-- .../dev/sargunv/maplibrecompose/core/layer/Layer.kt | 3 +-- .../dev/sargunv/maplibrecompose/core/source/Source.kt | 3 +-- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index a3ea271b..ee702fa3 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -4,6 +4,7 @@ name: "Daily" on: schedule: - cron: "00 10 * * *" + workflow_dispatch: jobs: check-last-run: diff --git a/build.gradle.kts b/build.gradle.kts index d5e44b8d..2fe52683 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -62,9 +62,11 @@ spotless { target("**/*.kt") ktfmt().googleStyle() } - format("swift") { - target("iosApp/iosApp/**/*.swift") - nativeCmd("swiftFormat", "/usr/bin/env", listOf("swift", "format")) + if (System.getProperty("os.name").contains("Mac OS X")) { + format("swift") { + target("iosApp/iosApp/**/*.swift") + nativeCmd("swiftFormat", "/usr/bin/env", listOf("swift", "format")) + } } format("markdown") { target("**/*.md") diff --git a/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/Layer.kt b/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/Layer.kt index 3e67c128..7029861b 100644 --- a/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/Layer.kt +++ b/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/Layer.kt @@ -6,8 +6,8 @@ import org.maplibre.android.style.layers.PropertyFactory internal actual sealed class Layer { abstract val impl: MlnLayer - actual val id: String - get() = impl.id + + actual val id: String by lazy { impl.id } actual var minZoom: Float get() = impl.minZoom diff --git a/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/source/Source.kt b/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/source/Source.kt index 28e34494..c5f13335 100644 --- a/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/source/Source.kt +++ b/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/source/Source.kt @@ -6,8 +6,8 @@ import org.maplibre.android.style.sources.Source as MLNSource public actual sealed class Source { internal abstract val impl: MLNSource - internal actual val id: String - get() = impl.id + + internal actual val id: String by lazy { impl.id } public actual val attributionLinks: List get() { diff --git a/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/Layer.kt b/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/Layer.kt index a3bba7a6..55799fdf 100644 --- a/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/Layer.kt +++ b/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/Layer.kt @@ -4,8 +4,7 @@ import cocoapods.MapLibre.MLNStyleLayer internal actual sealed class Layer { abstract val impl: MLNStyleLayer - actual val id: String - get() = impl.identifier + actual val id: String by lazy { impl.identifier } actual var minZoom: Float get() = impl.minimumZoomLevel diff --git a/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/Source.kt b/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/Source.kt index 7e2d5a74..cbacf7e4 100644 --- a/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/Source.kt +++ b/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/Source.kt @@ -6,8 +6,7 @@ import cocoapods.MapLibre.MLNTileSource public actual sealed class Source { internal abstract val impl: MLNSource - internal actual val id: String - get() = impl.identifier + internal actual val id: String by lazy { impl.identifier } public actual val attributionLinks: List get() =