Skip to content

Commit

Permalink
CI?
Browse files Browse the repository at this point in the history
  • Loading branch information
sargunv committed Nov 22, 2024
1 parent 7245937 commit baac0f1
Show file tree
Hide file tree
Showing 23 changed files with 95 additions and 27 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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 }}'
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
}
1 change: 0 additions & 1 deletion demo-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ kotlin {
}
iosArm64()
iosSimulatorArm64()
iosX64()

cocoapods {
summary = "PLACEHOLDER SUMMARY"
Expand Down
2 changes: 2 additions & 0 deletions maplibre-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,5 @@ spotless {
ktfmt().googleStyle()
}
}

// tasks.get("test").dependsOn("connectedAndroidTest", "iosSimulatorArm64Test")
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>) {
actual override fun setFilter(filter: Expression<Boolean>) {
impl.setFilter(filter.toMLNExpression() ?: MLNExpression.literal(true))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>) {
actual override fun setFilter(filter: Expression<Boolean>) {
impl.setFilter(filter.toMLNExpression() ?: MLNExpression.literal(true))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>) {
actual override fun setFilter(filter: Expression<Boolean>) {
impl.setFilter(filter.toMLNExpression() ?: MLNExpression.literal(true))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>) {
actual override fun setFilter(filter: Expression<Boolean>) {
impl.setFilter(filter.toMLNExpression() ?: MLNExpression.literal(true))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>) {
actual override fun setFilter(filter: Expression<Boolean>) {
impl.setFilter(filter.toMLNExpression() ?: MLNExpression.literal(true))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>) {
actual override fun setFilter(filter: Expression<Boolean>) {
impl.setFilter(filter.toMLNExpression() ?: MLNExpression.literal(true))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>)

fun setCircleSortKey(sortKey: Expression<Number>)

fun setCircleRadius(radius: Expression<Number>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>)

fun setFillExtrusionOpacity(opacity: Expression<Number>)

fun setFillExtrusionColor(color: Expression<Color>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>)

fun setFillSortKey(sortKey: Expression<Number>)

fun setFillAntialias(antialias: Expression<Boolean>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>)

fun setHeatmapRadius(radius: Expression<Number>)

fun setHeatmapWeight(weight: Expression<Number>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>)

fun setLineCap(cap: Expression<String>)

fun setLineJoin(join: Expression<String>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>)

fun setSymbolPlacement(placement: Expression<String>)

fun setSymbolSpacing(spacing: Expression<Number>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>) {
actual override fun setFilter(filter: Expression<Boolean>) {
impl.predicate = filter.toPredicate()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>) {
actual override fun setFilter(filter: Expression<Boolean>) {
impl.predicate = filter.toPredicate()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>) {
actual override fun setFilter(filter: Expression<Boolean>) {
impl.predicate = filter.toPredicate()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>) {
actual override fun setFilter(filter: Expression<Boolean>) {
impl.predicate = filter.toPredicate()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>) {
actual override fun setFilter(filter: Expression<Boolean>) {
impl.predicate = filter.toPredicate()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>) {
actual override fun setFilter(filter: Expression<Boolean>) {
impl.predicate = filter.toPredicate()
}

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("UnstableApiUsage")

rootProject.name = "maplibre-compose-root"
rootProject.name = "root"

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

Expand Down

0 comments on commit baac0f1

Please sign in to comment.