Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor project and add support for SPM #250

Merged
merged 8 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,21 @@ jobs:
xcode: << parameters.xcode >>
steps:
- checkout
- run: make build
- store_artifacts:
path: build/mapbox-events-ios-static.zip
- run:
name: Test SPM
command: |
# xcodebuild will try to use the Package manifest if it cannot find a project
mkdir temp && mv MapboxMobileEvents.xcodeproj temp
xcodebuild -scheme MapboxMobileEvents test -destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to specify the platform value through the build parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as a follow-up because then it should also propagate to CocoaPods and Carthage tests.

mv temp/MapboxMobileEvents.xcodeproj . && rm -rf temp
- run:
name: Install dependencies
command: |
if [ "<< parameters.xcode >>" = "12.0.0" ]; then export XCODE_XCCONFIG_FILE=~/project/xcode-12-fix.xcconfig; fi
carthage bootstrap --platform ios --cache-builds --configuration Debug --no-use-binaries --verbose
- run:
name: Test
command: xcodebuild -project MapboxMobileEventsTests.xcodeproj -scheme MMETestHost build test -destination 'platform=iOS Simulator,name=iPhone 11,OS=latest' GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
command: xcodebuild -project MapboxMobileEvents.xcodeproj -scheme MMETestHost build test -destination 'platform=iOS Simulator,name=iPhone 11,OS=latest' GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
- run:
name: Test CocoaPods
command: Tests/Integration/test_cocoapods.sh
Expand All @@ -42,3 +46,10 @@ jobs:
command: |
if [ "<< parameters.xcode >>" = "12.0.0" ]; then export XCODE_XCCONFIG_FILE=~/project/xcode-12-fix.xcconfig; fi
Tests/Integration/test_carthage.sh
- when:
condition:
equal: [ "11.7.0", << parameters.xcode >> ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any problem with XCode 12 code coverage?

Copy link
Contributor Author

@frederoni frederoni Sep 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I know of but since Xcode 12 is still in beta and we run the same tests as with Xcode 11, I figured merging multiple reports would be excessive at this point.

steps:
- run:
name: Codecov
command: bash <(curl https://codecov.io/bash) -Z -t $CODECOV_TOKEN
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ fastlane/test_output
test_output/
docs/
.DS_Store

.swiftpm
4 changes: 2 additions & 2 deletions MMETestHost/MMETestHost-Info.plist → MMETestHost/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MMECollectionEnabledInSimulator</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
Expand Down Expand Up @@ -52,7 +54,5 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>MMECollectionEnabledInSimulator</key>
<true/>
</dict>
</plist>
1 change: 1 addition & 0 deletions MMETestHost/MMETestDelegate.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#import "MMETestDelegate.h"
#import <UIKit/UIKit.h>

// MARK: -

Expand Down
74 changes: 0 additions & 74 deletions Makefile

This file was deleted.

8 changes: 4 additions & 4 deletions MapboxMobileEvents.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Pod::Spec.new do |s|

# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #

s.ios.deployment_target = "8.0"
s.ios.deployment_target = "9.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should have bump of minimum deployment target in the separate PR/commit?



# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
Expand All @@ -30,9 +30,9 @@ Pod::Spec.new do |s|

# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #

s.source_files = ["MapboxMobileEvents/**/*.{h,m}"]
s.resources = "MapboxMobileEvents/Resources/*"
s.exclude_files = "MapboxMobileEvents/MMENamespacedDependencies.h"
s.source_files = ["Sources/MapboxMobileEvents/**/*.{h,m}"]
s.resources = "Sources/MapboxMobileEvents/Resources/*"
s.exclude_files = "Sources/MapboxMobileEvents/MMENamespacedDependencies.h"

# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #

Expand Down
Loading