From 469cac94971b930afc9beb5918fd268579aa6df2 Mon Sep 17 00:00:00 2001 From: Jacob Fielding Date: Tue, 31 Oct 2023 18:44:16 -0700 Subject: [PATCH 01/15] Downgraded minimum iOS support to iOS 16 --- Package.swift | 3 ++- Sources/MapLibreSwiftUI/Examples/Camera.swift | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Package.swift b/Package.swift index 7f0e8fb..2339c42 100644 --- a/Package.swift +++ b/Package.swift @@ -7,7 +7,8 @@ import CompilerPluginSupport let package = Package( name: "MapLibreSwiftUI", platforms: [ - .iOS(.v17), .macOS(.v13), + .iOS(.v16), + .macOS(.v12), ], products: [ .library( diff --git a/Sources/MapLibreSwiftUI/Examples/Camera.swift b/Sources/MapLibreSwiftUI/Examples/Camera.swift index a55ca79..0d8fc73 100644 --- a/Sources/MapLibreSwiftUI/Examples/Camera.swift +++ b/Sources/MapLibreSwiftUI/Examples/Camera.swift @@ -10,13 +10,20 @@ struct CameraDirectManipulationPreview: View { var body: some View { MapView(styleURL: styleURL, camera: $camera) - .overlay(alignment: .bottomLeading, content: { + .overlay(alignment: .bottom, content: { switch camera { case .centerAndZoom(let coord, let zoom): - Text("\(coord.latitude), \(coord.longitude) z\(zoom ?? 0)") - .padding(.all, 8) - .background(in: .rect(cornerRadii: .init(topLeading: 8,bottomLeading: 8,bottomTrailing: 8,topTrailing: 8)), fillStyle: .init()) - .safeAreaPadding(.all) + Text("\(coord.latitude), \(coord.longitude) z \(zoom ?? 0)") + .padding() + .background( + in: .rect(cornerRadii: .init( + topLeading: 8, + bottomLeading: 8, + bottomTrailing: 8, + topTrailing: 8)), + fillStyle: .init() + ) + .padding(.bottom, 42) } }) .task { From c3a6b344a73f0c4f85235026f4603199736af49f Mon Sep 17 00:00:00 2001 From: Jacob Fielding Date: Tue, 31 Oct 2023 21:42:17 -0700 Subject: [PATCH 02/15] ios 15 compatiblity --- Package.swift | 4 ++-- Sources/MapLibreSwiftUI/Examples/Camera.swift | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Package.swift b/Package.swift index 2339c42..6baaabb 100644 --- a/Package.swift +++ b/Package.swift @@ -7,8 +7,8 @@ import CompilerPluginSupport let package = Package( name: "MapLibreSwiftUI", platforms: [ - .iOS(.v16), - .macOS(.v12), + .iOS(.v15), + .macOS(.v11), ], products: [ .library( diff --git a/Sources/MapLibreSwiftUI/Examples/Camera.swift b/Sources/MapLibreSwiftUI/Examples/Camera.swift index 0d8fc73..bab86cc 100644 --- a/Sources/MapLibreSwiftUI/Examples/Camera.swift +++ b/Sources/MapLibreSwiftUI/Examples/Camera.swift @@ -15,19 +15,13 @@ struct CameraDirectManipulationPreview: View { case .centerAndZoom(let coord, let zoom): Text("\(coord.latitude), \(coord.longitude) z \(zoom ?? 0)") .padding() - .background( - in: .rect(cornerRadii: .init( - topLeading: 8, - bottomLeading: 8, - bottomTrailing: 8, - topTrailing: 8)), - fillStyle: .init() - ) + .background(in: RoundedRectangle(cornerRadius: 8), + fillStyle: .init()) .padding(.bottom, 42) } }) .task { - try! await Task.sleep(for: .seconds(3)) + try! await Task.sleep(nanoseconds: 3_000_000_000) camera = MapView.Camera.centerAndZoom(switzerland, 6) } From ae84f3007f705cc255e8b1cee9a265cc0707eeeb Mon Sep 17 00:00:00 2001 From: Jacob Fielding Date: Tue, 31 Oct 2023 22:08:59 -0700 Subject: [PATCH 03/15] Initial test.yml --- .github/workflows/test-dsl.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/test-dsl.yml diff --git a/.github/workflows/test-dsl.yml b/.github/workflows/test-dsl.yml new file mode 100644 index 0000000..2776060 --- /dev/null +++ b/.github/workflows/test-dsl.yml @@ -0,0 +1,34 @@ +name: Test maplibre-swiftui-dsl-playground + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: macos-latest + strategy: + matrix: + scheme: [ + MapLibreSwiftDSL + ] + destination: [ + 'platform=iOS Simulator,name=iPhone 14,OS=16.2', + 'platform=iOS Simulator,name=iPhone 15,OS=17.0' + ] + + steps: + - name: Install xcbeautify + run: brew install xcbeautify + + - name: Checkout maplibre-swiftui-dsl-playground + uses: actions/checkout@v3 + + - name: Test ${{ matrix.scheme }} on ${{ matrix.destination }} + run: xcodebuild -scheme ${{ matrix.scheme }} test -sdk iphonesimulator -destination '${{ matrix.destination }}' | xcbeautify && exit ${PIPESTATUS[0]} + + + + From 937d67cfb774799f08a7e914f7fbc604620662f7 Mon Sep 17 00:00:00 2001 From: Jacob Fielding Date: Wed, 1 Nov 2023 16:30:11 -0700 Subject: [PATCH 04/15] added ci pipeline for xcodebuild test --- .github/workflows/{test-dsl.yml => test.yml} | 8 +--- .../MapLibreSwiftUI-Package.xcscheme | 10 +++++ Package.swift | 37 ++++++++++++++----- .../MacroTests.swift | 0 4 files changed, 39 insertions(+), 16 deletions(-) rename .github/workflows/{test-dsl.yml => test.yml} (75%) rename Tests/{MapLibreSwiftDSLTests => MapLibreSwiftMacrosTests}/MacroTests.swift (100%) diff --git a/.github/workflows/test-dsl.yml b/.github/workflows/test.yml similarity index 75% rename from .github/workflows/test-dsl.yml rename to .github/workflows/test.yml index 2776060..5d28697 100644 --- a/.github/workflows/test-dsl.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: ] destination: [ 'platform=iOS Simulator,name=iPhone 14,OS=16.2', - 'platform=iOS Simulator,name=iPhone 15,OS=17.0' + 'platform=iOS Simulator,name=iPhone 15,OS=17.0.1' ] steps: @@ -27,8 +27,4 @@ jobs: uses: actions/checkout@v3 - name: Test ${{ matrix.scheme }} on ${{ matrix.destination }} - run: xcodebuild -scheme ${{ matrix.scheme }} test -sdk iphonesimulator -destination '${{ matrix.destination }}' | xcbeautify && exit ${PIPESTATUS[0]} - - - - + run: xcodebuild -scheme ${{ matrix.scheme }} test -skipMacroValidation -destination '${{ matrix.destination }}' | xcbeautify && exit ${PIPESTATUS[0]} diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/MapLibreSwiftUI-Package.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/MapLibreSwiftUI-Package.xcscheme index 153bbe3..91efa53 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/MapLibreSwiftUI-Package.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/MapLibreSwiftUI-Package.xcscheme @@ -67,6 +67,16 @@ ReferencedContainer = "container:"> + + + + Date: Wed, 1 Nov 2023 16:46:43 -0700 Subject: [PATCH 05/15] added ci pipeline for xcodebuild test --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5d28697..ef54607 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,4 +27,5 @@ jobs: uses: actions/checkout@v3 - name: Test ${{ matrix.scheme }} on ${{ matrix.destination }} - run: xcodebuild -scheme ${{ matrix.scheme }} test -skipMacroValidation -destination '${{ matrix.destination }}' | xcbeautify && exit ${PIPESTATUS[0]} + # run: xcodebuild -scheme ${{ matrix.scheme }} test -skipMacroValidation -destination '${{ matrix.destination }}' | xcbeautify && exit ${PIPESTATUS[0]} + run: xcodebuild -scheme ${{ matrix.scheme }} test -destination '${{ matrix.destination }}' | xcbeautify && exit ${PIPESTATUS[0]} From 197dd0429785fc9bde760314e804badab69986b6 Mon Sep 17 00:00:00 2001 From: Jacob Fielding Date: Wed, 1 Nov 2023 17:10:46 -0700 Subject: [PATCH 06/15] added ci pipeline for xcodebuild test --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef54607..eb2c257 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,10 @@ jobs: steps: - name: Install xcbeautify run: brew install xcbeautify + + - uses: swift-actions/setup-swift@v1 + with: + swift-version: "5.9.0" - name: Checkout maplibre-swiftui-dsl-playground uses: actions/checkout@v3 From f00a373629104a003f52822eb15bcc85bacd5814 Mon Sep 17 00:00:00 2001 From: Jacob Fielding Date: Wed, 1 Nov 2023 19:01:26 -0700 Subject: [PATCH 07/15] added ci pipeline for xcodebuild test --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb2c257..0055761 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,9 +23,9 @@ jobs: - name: Install xcbeautify run: brew install xcbeautify - - uses: swift-actions/setup-swift@v1 + - uses: maxim-lobanov/setup-xcode@v1 with: - swift-version: "5.9.0" + xcode-version: '15.0' - name: Checkout maplibre-swiftui-dsl-playground uses: actions/checkout@v3 From 505ddbea3f2a0db57355546b51414c71e170c663 Mon Sep 17 00:00:00 2001 From: Jacob Fielding Date: Wed, 1 Nov 2023 19:07:51 -0700 Subject: [PATCH 08/15] added ci pipeline for xcodebuild test --- .github/workflows/test.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0055761..1b8daf3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,13 +23,8 @@ jobs: - name: Install xcbeautify run: brew install xcbeautify - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '15.0' - - name: Checkout maplibre-swiftui-dsl-playground uses: actions/checkout@v3 - name: Test ${{ matrix.scheme }} on ${{ matrix.destination }} - # run: xcodebuild -scheme ${{ matrix.scheme }} test -skipMacroValidation -destination '${{ matrix.destination }}' | xcbeautify && exit ${PIPESTATUS[0]} - run: xcodebuild -scheme ${{ matrix.scheme }} test -destination '${{ matrix.destination }}' | xcbeautify && exit ${PIPESTATUS[0]} + run: xcodebuild -scheme ${{ matrix.scheme }} test -skipMacroValidation -destination '${{ matrix.destination }}' | xcbeautify && exit ${PIPESTATUS[0]} From 77b9b161ba2aa13a5244e1d4ad190b73bd452de0 Mon Sep 17 00:00:00 2001 From: Jacob Fielding Date: Wed, 1 Nov 2023 19:23:44 -0700 Subject: [PATCH 09/15] added ci pipeline for xcodebuild test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b8daf3..836e3f3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: jobs: test: - runs-on: macos-latest + runs-on: macos-13 strategy: matrix: scheme: [ From 3451e21e1ec36fe3fbc315bace43e1ec285f0e10 Mon Sep 17 00:00:00 2001 From: Jacob Fielding Date: Wed, 1 Nov 2023 19:26:12 -0700 Subject: [PATCH 10/15] added ci pipeline for xcodebuild test --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 836e3f3..9de31bb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,10 @@ jobs: - name: Install xcbeautify run: brew install xcbeautify + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '15.0' + - name: Checkout maplibre-swiftui-dsl-playground uses: actions/checkout@v3 From 4a1fd96abeeccf238f02dbe618f1b6fa7bba74a9 Mon Sep 17 00:00:00 2001 From: Jacob Fielding Date: Wed, 1 Nov 2023 19:28:58 -0700 Subject: [PATCH 11/15] added ci pipeline for xcodebuild test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9de31bb..0001b0c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: scheme: [ - MapLibreSwiftDSL + MapLibreSwiftUI-Package ] destination: [ 'platform=iOS Simulator,name=iPhone 14,OS=16.2', From d24ee32a3647ffdeb9770528173fc365aa7ab9c4 Mon Sep 17 00:00:00 2001 From: Jacob Fielding Date: Wed, 1 Nov 2023 19:34:49 -0700 Subject: [PATCH 12/15] added ci pipeline for xcodebuild test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0001b0c..2859291 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: MapLibreSwiftUI-Package ] destination: [ - 'platform=iOS Simulator,name=iPhone 14,OS=16.2', + # 'platform=iOS Simulator,name=iPhone 14,OS=16.2', 'platform=iOS Simulator,name=iPhone 15,OS=17.0.1' ] From b05f52f9e5d276a053e0a76cbfd74d5cf5b31554 Mon Sep 17 00:00:00 2001 From: Jacob Fielding Date: Wed, 1 Nov 2023 19:44:42 -0700 Subject: [PATCH 13/15] added ci pipeline for xcodebuild test --- .github/workflows/test.yml | 2 +- Tests/MapLibreSwiftMacrosTests/MacroTests.swift | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2859291..90c6c43 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: MapLibreSwiftUI-Package ] destination: [ - # 'platform=iOS Simulator,name=iPhone 14,OS=16.2', + # TODO: Add more destinations 'platform=iOS Simulator,name=iPhone 15,OS=17.0.1' ] diff --git a/Tests/MapLibreSwiftMacrosTests/MacroTests.swift b/Tests/MapLibreSwiftMacrosTests/MacroTests.swift index e2e292a..9149030 100644 --- a/Tests/MapLibreSwiftMacrosTests/MacroTests.swift +++ b/Tests/MapLibreSwiftMacrosTests/MacroTests.swift @@ -18,6 +18,10 @@ final class ExpressionTests: XCTestCase { // TODO: Non-enum attachment + func testFail() { + XCTAssert(false) + } + func testMLNStylePropertyValid() { assertMacro { """ From 0ed50dde93562e95f0b97d7b9b1576d79c8460f2 Mon Sep 17 00:00:00 2001 From: Jacob Fielding Date: Wed, 1 Nov 2023 19:58:47 -0700 Subject: [PATCH 14/15] added ci pipeline for xcodebuild test --- Tests/MapLibreSwiftMacrosTests/MacroTests.swift | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Tests/MapLibreSwiftMacrosTests/MacroTests.swift b/Tests/MapLibreSwiftMacrosTests/MacroTests.swift index 9149030..e2e292a 100644 --- a/Tests/MapLibreSwiftMacrosTests/MacroTests.swift +++ b/Tests/MapLibreSwiftMacrosTests/MacroTests.swift @@ -18,10 +18,6 @@ final class ExpressionTests: XCTestCase { // TODO: Non-enum attachment - func testFail() { - XCTAssert(false) - } - func testMLNStylePropertyValid() { assertMacro { """ From c1c2f2c52690f2c50f29cefe0f04e0435a66b242 Mon Sep 17 00:00:00 2001 From: Jacob Fielding Date: Thu, 2 Nov 2023 20:52:36 -0700 Subject: [PATCH 15/15] Updating Task.sleep --- Sources/MapLibreSwiftUI/Examples/Camera.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/MapLibreSwiftUI/Examples/Camera.swift b/Sources/MapLibreSwiftUI/Examples/Camera.swift index bab86cc..e8ba7b8 100644 --- a/Sources/MapLibreSwiftUI/Examples/Camera.swift +++ b/Sources/MapLibreSwiftUI/Examples/Camera.swift @@ -21,7 +21,7 @@ struct CameraDirectManipulationPreview: View { } }) .task { - try! await Task.sleep(nanoseconds: 3_000_000_000) + try! await Task.sleep(nanoseconds: 3 * NSEC_PER_SEC) camera = MapView.Camera.centerAndZoom(switzerland, 6) }