From baac0f1c34e1f31c568bd85c17bf208cf0ffb395 Mon Sep 17 00:00:00 2001 From: Sargun Vohra Date: Thu, 21 Nov 2024 18:26:48 -0800 Subject: [PATCH] CI? --- .github/workflows/ci.yml | 43 +++++++++++++++++++ build.gradle.kts | 2 +- demo-app/build.gradle.kts | 1 - maplibre-compose/build.gradle.kts | 2 + .../maplibrecompose/core/layer/CircleLayer.kt | 4 +- .../core/layer/FillExtrusionLayer.kt | 4 +- .../maplibrecompose/core/layer/FillLayer.kt | 4 +- .../core/layer/HeatmapLayer.kt | 4 +- .../maplibrecompose/core/layer/LineLayer.kt | 4 +- .../maplibrecompose/core/layer/SymbolLayer.kt | 4 +- .../maplibrecompose/core/layer/CircleLayer.kt | 4 ++ .../core/layer/FillExtrusionLayer.kt | 4 ++ .../maplibrecompose/core/layer/FillLayer.kt | 4 ++ .../core/layer/HeatmapLayer.kt | 4 ++ .../maplibrecompose/core/layer/LineLayer.kt | 4 ++ .../maplibrecompose/core/layer/SymbolLayer.kt | 4 ++ .../maplibrecompose/core/layer/CircleLayer.kt | 4 +- .../core/layer/FillExtrusionLayer.kt | 4 +- .../maplibrecompose/core/layer/FillLayer.kt | 4 +- .../core/layer/HeatmapLayer.kt | 4 +- .../maplibrecompose/core/layer/LineLayer.kt | 4 +- .../maplibrecompose/core/layer/SymbolLayer.kt | 4 +- settings.gradle.kts | 2 +- 23 files changed, 95 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..5c3e823e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + gradle: + name: ${{ matrix.name }} + strategy: + fail-fast: false + matrix: + include: + - name: Spotless + os: ubuntu-latest + task: spotlessCheck + - name: Lint Android + os: ubuntu-latest + task: lint + - name: Test Android + os: ubuntu-latest + task: connectedDebugAndroidTest + use-android-emulator: true + - name: Test iOS + os: macos-latest + task: iosSimulatorArm64Test + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: '23' + distribution: 'temurin' + cache: gradle + - if: ${{ matrix.use-android-emulator }} + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 34 + script: ./gradlew '${{ matrix.task }}' + - if: ${{ !matrix.use-android-emulator }} + run: ./gradlew '${{ matrix.task }}' diff --git a/build.gradle.kts b/build.gradle.kts index 70346bb0..5bf7e795 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,6 +18,6 @@ subprojects { spotless { format("swift") { target("iosApp/iosApp/**/*.swift") - nativeCmd("swiftFormat","/usr/bin/env", listOf("swift-format")) + nativeCmd("swiftFormat","/usr/bin/env", listOf("swift", "format")) } } diff --git a/demo-app/build.gradle.kts b/demo-app/build.gradle.kts index 806d4ba4..495a2973 100644 --- a/demo-app/build.gradle.kts +++ b/demo-app/build.gradle.kts @@ -43,7 +43,6 @@ kotlin { } iosArm64() iosSimulatorArm64() - iosX64() cocoapods { summary = "PLACEHOLDER SUMMARY" diff --git a/maplibre-compose/build.gradle.kts b/maplibre-compose/build.gradle.kts index 3dd6515a..cc573419 100644 --- a/maplibre-compose/build.gradle.kts +++ b/maplibre-compose/build.gradle.kts @@ -99,3 +99,5 @@ spotless { ktfmt().googleStyle() } } + +// tasks.get("test").dependsOn("connectedAndroidTest", "iosSimulatorArm64Test") diff --git a/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/CircleLayer.kt b/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/CircleLayer.kt index eea5e78a..18ffb3b2 100644 --- a/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/CircleLayer.kt +++ b/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/CircleLayer.kt @@ -14,9 +14,9 @@ internal actual class CircleLayer actual constructor(id: String, source: Source) FeatureLayer(source) { override val impl = MLNCircleLayer(id, source.id) - override var sourceLayer: String by impl::sourceLayer + actual override var sourceLayer: String by impl::sourceLayer - override fun setFilter(filter: Expression) { + actual override fun setFilter(filter: Expression) { impl.setFilter(filter.toMLNExpression() ?: MLNExpression.literal(true)) } diff --git a/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillExtrusionLayer.kt b/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillExtrusionLayer.kt index 6bca1e15..fae6b6da 100644 --- a/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillExtrusionLayer.kt +++ b/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillExtrusionLayer.kt @@ -15,9 +15,9 @@ internal actual class FillExtrusionLayer actual constructor(id: String, source: FeatureLayer(source) { override val impl = MLNFillExtrusionLayer(id, source.id) - override var sourceLayer: String by impl::sourceLayer + actual override var sourceLayer: String by impl::sourceLayer - override fun setFilter(filter: Expression) { + actual override fun setFilter(filter: Expression) { impl.setFilter(filter.toMLNExpression() ?: MLNExpression.literal(true)) } diff --git a/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillLayer.kt b/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillLayer.kt index 10994350..c494e106 100644 --- a/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillLayer.kt +++ b/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillLayer.kt @@ -15,9 +15,9 @@ internal actual class FillLayer actual constructor(id: String, source: Source) : FeatureLayer(source) { override val impl = MLNFillLayer(id, source.id) - override var sourceLayer: String by impl::sourceLayer + actual override var sourceLayer: String by impl::sourceLayer - override fun setFilter(filter: Expression) { + actual override fun setFilter(filter: Expression) { impl.setFilter(filter.toMLNExpression() ?: MLNExpression.literal(true)) } diff --git a/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/HeatmapLayer.kt b/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/HeatmapLayer.kt index 45fb1107..c0287227 100644 --- a/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/HeatmapLayer.kt +++ b/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/HeatmapLayer.kt @@ -13,9 +13,9 @@ internal actual class HeatmapLayer actual constructor(id: String, source: Source FeatureLayer(source) { override val impl = MLNHeatmapLayer(id, source.id) - override var sourceLayer: String by impl::sourceLayer + actual override var sourceLayer: String by impl::sourceLayer - override fun setFilter(filter: Expression) { + actual override fun setFilter(filter: Expression) { impl.setFilter(filter.toMLNExpression() ?: MLNExpression.literal(true)) } diff --git a/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/LineLayer.kt b/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/LineLayer.kt index f9fc762f..21fe8774 100644 --- a/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/LineLayer.kt +++ b/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/LineLayer.kt @@ -16,9 +16,9 @@ internal actual class LineLayer actual constructor(id: String, source: Source) : override val impl = MLNLineLayer(id, source.id) - override var sourceLayer: String by impl::sourceLayer + actual override var sourceLayer: String by impl::sourceLayer - override fun setFilter(filter: Expression) { + actual override fun setFilter(filter: Expression) { impl.setFilter(filter.toMLNExpression() ?: MLNExpression.literal(true)) } diff --git a/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/SymbolLayer.kt b/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/SymbolLayer.kt index 18758f2d..780652a4 100644 --- a/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/SymbolLayer.kt +++ b/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/layer/SymbolLayer.kt @@ -17,9 +17,9 @@ internal actual class SymbolLayer actual constructor(id: String, source: Source) FeatureLayer(source) { override val impl = MLNSymbolLayer(id, source.id) - override var sourceLayer: String by impl::sourceLayer + actual override var sourceLayer: String by impl::sourceLayer - override fun setFilter(filter: Expression) { + actual override fun setFilter(filter: Expression) { impl.setFilter(filter.toMLNExpression() ?: MLNExpression.literal(true)) } diff --git a/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/CircleLayer.kt b/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/CircleLayer.kt index 20fa5ebe..0b7c8182 100644 --- a/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/CircleLayer.kt +++ b/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/CircleLayer.kt @@ -7,6 +7,10 @@ import dev.sargunv.maplibrecompose.core.source.Source @PublishedApi internal expect class CircleLayer(id: String, source: Source) : FeatureLayer { + override var sourceLayer: String + + override fun setFilter(filter: Expression) + fun setCircleSortKey(sortKey: Expression) fun setCircleRadius(radius: Expression) diff --git a/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillExtrusionLayer.kt b/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillExtrusionLayer.kt index 3639c058..3f112841 100644 --- a/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillExtrusionLayer.kt +++ b/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillExtrusionLayer.kt @@ -8,6 +8,10 @@ import dev.sargunv.maplibrecompose.core.source.Source @PublishedApi internal expect class FillExtrusionLayer(id: String, source: Source) : FeatureLayer { + override var sourceLayer: String + + override fun setFilter(filter: Expression) + fun setFillExtrusionOpacity(opacity: Expression) fun setFillExtrusionColor(color: Expression) diff --git a/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillLayer.kt b/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillLayer.kt index ac42e802..bf717e0c 100644 --- a/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillLayer.kt +++ b/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillLayer.kt @@ -8,6 +8,10 @@ import dev.sargunv.maplibrecompose.core.source.Source @PublishedApi internal expect class FillLayer(id: String, source: Source) : FeatureLayer { + override var sourceLayer: String + + override fun setFilter(filter: Expression) + fun setFillSortKey(sortKey: Expression) fun setFillAntialias(antialias: Expression) diff --git a/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/HeatmapLayer.kt b/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/HeatmapLayer.kt index 6f782da2..6862ba83 100644 --- a/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/HeatmapLayer.kt +++ b/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/HeatmapLayer.kt @@ -6,6 +6,10 @@ import dev.sargunv.maplibrecompose.core.source.Source @PublishedApi internal expect class HeatmapLayer(id: String, source: Source) : FeatureLayer { + override var sourceLayer: String + + override fun setFilter(filter: Expression) + fun setHeatmapRadius(radius: Expression) fun setHeatmapWeight(weight: Expression) diff --git a/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/LineLayer.kt b/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/LineLayer.kt index 8ac4ed56..412917f2 100644 --- a/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/LineLayer.kt +++ b/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/LineLayer.kt @@ -8,6 +8,10 @@ import dev.sargunv.maplibrecompose.core.source.Source @PublishedApi internal expect class LineLayer(id: String, source: Source) : FeatureLayer { + override var sourceLayer: String + + override fun setFilter(filter: Expression) + fun setLineCap(cap: Expression) fun setLineJoin(join: Expression) diff --git a/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/SymbolLayer.kt b/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/SymbolLayer.kt index 4e9379a7..406c8d95 100644 --- a/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/SymbolLayer.kt +++ b/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/layer/SymbolLayer.kt @@ -10,6 +10,10 @@ import dev.sargunv.maplibrecompose.core.source.Source @PublishedApi internal expect class SymbolLayer(id: String, source: Source) : FeatureLayer { + override var sourceLayer: String + + override fun setFilter(filter: Expression) + fun setSymbolPlacement(placement: Expression) fun setSymbolSpacing(spacing: Expression) diff --git a/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/CircleLayer.kt b/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/CircleLayer.kt index ec6a6cf7..f58b7aab 100644 --- a/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/CircleLayer.kt +++ b/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/CircleLayer.kt @@ -14,13 +14,13 @@ internal actual class CircleLayer actual constructor(id: String, source: Source) override val impl = MLNCircleStyleLayer(id, source.impl) - override var sourceLayer: String + actual override var sourceLayer: String get() = impl.sourceLayerIdentifier!! set(value) { impl.sourceLayerIdentifier = value } - override fun setFilter(filter: Expression) { + actual override fun setFilter(filter: Expression) { impl.predicate = filter.toPredicate() } diff --git a/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillExtrusionLayer.kt b/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillExtrusionLayer.kt index 3acb0173..a2275570 100644 --- a/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillExtrusionLayer.kt +++ b/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillExtrusionLayer.kt @@ -15,13 +15,13 @@ internal actual class FillExtrusionLayer actual constructor(id: String, source: override val impl = MLNFillExtrusionStyleLayer(id, source.impl) - override var sourceLayer: String + actual override var sourceLayer: String get() = impl.sourceLayerIdentifier!! set(value) { impl.sourceLayerIdentifier = value } - override fun setFilter(filter: Expression) { + actual override fun setFilter(filter: Expression) { impl.predicate = filter.toPredicate() } diff --git a/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillLayer.kt b/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillLayer.kt index 847021e1..2d7438c5 100644 --- a/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillLayer.kt +++ b/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/FillLayer.kt @@ -15,13 +15,13 @@ internal actual class FillLayer actual constructor(id: String, source: Source) : override val impl = MLNFillStyleLayer(id, source.impl) - override var sourceLayer: String + actual override var sourceLayer: String get() = impl.sourceLayerIdentifier!! set(value) { impl.sourceLayerIdentifier = value } - override fun setFilter(filter: Expression) { + actual override fun setFilter(filter: Expression) { impl.predicate = filter.toPredicate() } diff --git a/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/HeatmapLayer.kt b/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/HeatmapLayer.kt index db118e09..dc5ce391 100644 --- a/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/HeatmapLayer.kt +++ b/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/HeatmapLayer.kt @@ -13,13 +13,13 @@ internal actual class HeatmapLayer actual constructor(id: String, source: Source override val impl = MLNHeatmapStyleLayer(id, source.impl) - override var sourceLayer: String + actual override var sourceLayer: String get() = impl.sourceLayerIdentifier!! set(value) { impl.sourceLayerIdentifier = value } - override fun setFilter(filter: Expression) { + actual override fun setFilter(filter: Expression) { impl.predicate = filter.toPredicate() } diff --git a/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/LineLayer.kt b/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/LineLayer.kt index 00a0cb92..e21b98eb 100644 --- a/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/LineLayer.kt +++ b/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/LineLayer.kt @@ -15,13 +15,13 @@ internal actual class LineLayer actual constructor(id: String, source: Source) : override val impl = MLNLineStyleLayer(id, source.impl) - override var sourceLayer: String + actual override var sourceLayer: String get() = impl.sourceLayerIdentifier!! set(value) { impl.sourceLayerIdentifier = value } - override fun setFilter(filter: Expression) { + actual override fun setFilter(filter: Expression) { impl.predicate = filter.toPredicate() } diff --git a/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/SymbolLayer.kt b/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/SymbolLayer.kt index f1b1fd15..0af9444c 100644 --- a/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/SymbolLayer.kt +++ b/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/layer/SymbolLayer.kt @@ -17,13 +17,13 @@ internal actual class SymbolLayer actual constructor(id: String, source: Source) override val impl = MLNSymbolStyleLayer(id, source.impl) - override var sourceLayer: String + actual override var sourceLayer: String get() = impl.sourceLayerIdentifier!! set(value) { impl.sourceLayerIdentifier = value } - override fun setFilter(filter: Expression) { + actual override fun setFilter(filter: Expression) { impl.predicate = filter.toPredicate() } diff --git a/settings.gradle.kts b/settings.gradle.kts index 48b6878a..36217d27 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,6 +1,6 @@ @file:Suppress("UnstableApiUsage") -rootProject.name = "maplibre-compose-root" +rootProject.name = "root" enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")