-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #481 from snowplow/release/1.2.0
Release/1.2.0
- Loading branch information
Showing
206 changed files
with
4,834 additions
and
2,895 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,30 @@ | ||
language: objective-c | ||
osx_image: xcode11.2 | ||
osx_image: xcode11.3 | ||
|
||
env: | ||
global: | ||
- secure: H45yyUlB0cXQrzTTcnmD3WrkCyqjUzaop2jHgmBF3bm8ue4XOcTWKDSDcAN39SG0FUeDC7GdDCtWAc3VCpLwN++5IznAnvBuZSGgxQ2lCxWMhdTtXtOWU2mivgVvs+uldS7/TuVlOjZ7inrTgetl+jgFjenwESOGIIZwn7SXpPo= | ||
- BUILD_DEST="platform=iOS Simulator,OS=13.2.2,name=iPhone 8" | ||
- BUILD_PROJECT_LIB="-project Snowplow.xcodeproj" | ||
- BUILD_SCHEME_LIB="-scheme Snowplow-iOS" | ||
- BUILD_WORKSPACE_OBJC_DEMO="-workspace SnowplowDemo.xcworkspace" | ||
- BUILD_SCHEME_OBJC_DEMO="-scheme SnowplowDemo" | ||
- BUILD_WORKSPACE_SWIFT_DEMO="-workspace SnowplowSwiftDemo.xcworkspace" | ||
- BUILD_PROJECT_SWIFT_DEMO="-project SnowplowSwiftDemo.xcodeproj" | ||
- BUILD_SCHEME_SWIFT_DEMO="-scheme SnowplowSwiftDemo" | ||
|
||
before_install: | ||
- gem install slather | ||
- gem install xcpretty -N --no-document | ||
- gem install cocoapods -v '1.8.4' | ||
|
||
# The first dot is not a typo. It's needed to export the env variables to the current travis script | ||
before_install: . .travis/setup.sh | ||
|
||
jobs: | ||
include: | ||
- name: "Test Snowplow framework [iOS]" | ||
install: | ||
- carthage bootstrap --platform iOS | ||
script: | ||
- set -o pipefail && xcodebuild -sdk iphonesimulator -destination "${BUILD_DEST}" ${BUILD_PROJECT_LIB} ${BUILD_SCHEME_LIB} clean test | xcpretty | ||
- name: "Test Snowplow framework" | ||
script: .travis/test_framework.sh "${BUILD_PROJECT_LIB}" "${BUILD_DEST_IOS}" "${BUILD_SCHEME_LIB_IOS}" "${BUILD_DEST_WATCH}" "${BUILD_SCHEME_LIB_WATCH}" | ||
after_success: slather | ||
|
||
- name: "Test Snowplow ObjC demo app [iOS]" | ||
install: | ||
- cd Examples/SnowplowDemo | ||
- pod update | ||
script: | ||
- set -o pipefail && xcodebuild -sdk iphonesimulator -destination "${BUILD_DEST}" ${BUILD_WORKSPACE_OBJC_DEMO} ${BUILD_SCHEME_OBJC_DEMO} clean build | xcpretty | ||
|
||
- name: "Test Snowplow Swift demo app [iOS] using Cocoapods" | ||
install: | ||
- cd Examples/SnowplowSwiftCocoapodsDemo | ||
- pod update | ||
script: | ||
- set -o pipefail && xcodebuild -sdk iphonesimulator -destination "${BUILD_DEST}" ${BUILD_WORKSPACE_SWIFT_DEMO} ${BUILD_SCHEME_SWIFT_DEMO} clean build | xcpretty | ||
|
||
- name: "Test Snowplow Swift demo app [iOS] using Carthage" | ||
install: | ||
- cd Examples/SnowplowSwiftCarthageDemo | ||
- ./generateCartfile.sh | ||
- carthage update --platform ios | ||
script: | ||
- set -o pipefail && xcodebuild -sdk iphonesimulator -destination "${BUILD_DEST}" ${BUILD_PROJECT_SWIFT_DEMO} ${BUILD_SCHEME_SWIFT_DEMO} clean build | xcpretty | ||
- name: "Test Snowplow ObjC demo app" | ||
script: .travis/test_ios_demo.sh SnowplowDemo Podfile "${BUILD_WORKSPACE_OBJC_DEMO}" "${BUILD_DEST_IOS}" "${BUILD_SCHEME_OBJC_DEMO}" | ||
|
||
- name: "Test Snowplow Swift demo app using Carthage" | ||
script: .travis/test_ios_demo.sh SnowplowSwiftCarthageDemo Cartfile "${BUILD_PROJECT_SWIFT_DEMO}" "${BUILD_DEST_IOS}" "${BUILD_SCHEME_SWIFT_DEMO_IOS}" | ||
|
||
- name: "Test Snowplow Swift demo app using Cocoapods (no directive)" | ||
script: .travis/test_ios_demo.sh SnowplowSwiftCocoapodsDemo Podfile_simple "${BUILD_WORKSPACE_SWIFT_DEMO}" "${BUILD_DEST_IOS}" "${BUILD_SCHEME_SWIFT_DEMO_IOS}" "${BUILD_DEST_PAIRED}" "${BUILD_SCHEME_SWIFT_DEMO_WATCH}" | ||
|
||
- name: "Test Snowplow Swift demo app using Cocoapods (use_frameworks! directive)" | ||
script: .travis/test_ios_demo.sh SnowplowSwiftCocoapodsDemo Podfile_frameworks "${BUILD_WORKSPACE_SWIFT_DEMO}" "${BUILD_DEST_IOS}" "${BUILD_SCHEME_SWIFT_DEMO_IOS}" "${BUILD_DEST_PAIRED}" "${BUILD_SCHEME_SWIFT_DEMO_WATCH}" | ||
|
||
- name: "Test Snowplow Swift demo app using Cocoapods (use_modular_headers! directive)" | ||
script: .travis/test_ios_demo.sh SnowplowSwiftCocoapodsDemo Podfile_modular_headers "${BUILD_WORKSPACE_SWIFT_DEMO}" "${BUILD_DEST_IOS}" "${BUILD_SCHEME_SWIFT_DEMO_IOS}" "${BUILD_DEST_PAIRED}" "${BUILD_SCHEME_SWIFT_DEMO_WATCH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use_frameworks! | ||
|
||
workspace 'SnowplowSwiftDemo.xcworkspace' | ||
|
||
target 'SnowplowSwiftDemo' do | ||
platform :ios, '9.0' | ||
pod 'SnowplowTracker', :path=> '../../' | ||
end | ||
|
||
target 'SnowplowSwiftWatch Extension' do | ||
platform :watchos, '4.0' | ||
pod 'SnowplowTracker', :path=> '../../' | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use_modular_headers! | ||
|
||
workspace 'SnowplowSwiftDemo.xcworkspace' | ||
|
||
target 'SnowplowSwiftDemo' do | ||
platform :ios, '9.0' | ||
pod 'SnowplowTracker', :path=> '../../' | ||
end | ||
|
||
target 'SnowplowSwiftWatch Extension' do | ||
platform :watchos, '4.0' | ||
pod 'SnowplowTracker', :path=> '../../' | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
workspace 'SnowplowSwiftDemo.xcworkspace' | ||
|
||
target 'SnowplowSwiftDemo' do | ||
platform :ios, '9.0' | ||
pod 'SnowplowTracker', :path=> '../../' | ||
end | ||
|
||
target 'SnowplowSwiftWatch Extension' do | ||
platform :watchos, '4.0' | ||
pod 'SnowplowTracker', :path=> '../../' | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ "$CI" = true ]; then | ||
printf "\n\n Install Slather - Code coverage tool \n" | ||
gem install slather | ||
|
||
printf "\n\n Install Xcpretty - Prettify xcodebuild logs \n" | ||
gem install xcpretty -N --no-document | ||
|
||
printf "\n\n Install Cocoapods - Dependencies manager \n" | ||
gem install cocoapods -v '1.8.4' | ||
fi | ||
|
||
printf "\n\n Setup env variables \n" | ||
|
||
BUILD_DEST_IOS="platform=iOS Simulator,OS=13.3,name=iPhone 11 Pro" | ||
BUILD_DEST_PAIRED="platform=iOS Simulator,OS=13.3,name=iPhone 11 Pro" | ||
BUILD_DEST_WATCH="platform=watchOS Simulator,OS=6.1.1,name=Apple Watch Series 5 - 44mm" | ||
|
||
BUILD_PROJECT_LIB="-project Snowplow.xcodeproj" | ||
BUILD_SCHEME_LIB_IOS="-scheme Snowplow-iOS" | ||
BUILD_SCHEME_LIB_WATCH="-scheme Snowplow-watchOS" | ||
|
||
BUILD_WORKSPACE_OBJC_DEMO="-workspace SnowplowDemo.xcworkspace" | ||
BUILD_SCHEME_OBJC_DEMO="-scheme SnowplowDemo" | ||
|
||
BUILD_WORKSPACE_SWIFT_DEMO="-workspace SnowplowSwiftDemo.xcworkspace" | ||
BUILD_PROJECT_SWIFT_DEMO="-project SnowplowSwiftDemo.xcodeproj" | ||
BUILD_SCHEME_SWIFT_DEMO_IOS="-scheme SnowplowSwiftDemo" | ||
BUILD_SCHEME_SWIFT_DEMO_WATCH="-scheme SnowplowSwiftWatch" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
PROJECT=$1 | ||
DEST_IOS=$2 | ||
SCHEME_IOS=$3 | ||
DEST_WATCH=$4 | ||
SCHEME_WATCH=$5 | ||
|
||
printf "\n\n Carthage bootstrap \n" | ||
carthage bootstrap | ||
|
||
printf "\n\n Test framework on iOS \n" | ||
set -o pipefail && xcodebuild -destination "${DEST_IOS}" ${PROJECT} ${SCHEME_IOS} clean test | xcpretty | ||
|
||
printf "\n\n Build framework on watchOS \n" | ||
set -o pipefail && xcodebuild -destination "${DEST_WATCH}" ${PROJECT} ${SCHEME_WATCH} clean build | xcpretty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
APP=$1 | ||
DEP_FILE=$2 | ||
PROJECT=$3 | ||
DEST_IOS=$4 | ||
SCHEME_IOS=$5 | ||
DEST_WATCH=$6 | ||
SCHEME_WATCH=$7 | ||
|
||
if [ $DEP_FILE == "Cartfile" ]; then | ||
printf "\n\n Carthage update \n" | ||
cd Examples/$APP | ||
./generateCartfile.sh | ||
carthage update | ||
elif [ $DEP_FILE == "Podfile" ]; then | ||
printf "\n\n Pod update \n" | ||
cd Examples/$APP | ||
pod update | ||
elif [[ $DEP_FILE == Podfile* ]]; then | ||
printf "\n\n Pod update with Podfile: " + $DEP_FILE + " \n" | ||
cp -rf .travis/$DEP_FILE Examples/$APP/Podfile | ||
cd Examples/$APP | ||
pod update | ||
else | ||
printf "ERROR: Podfile or Cartfile is not correctly indicated" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
printf "\n\n Build iOS ${APP} \n" | ||
set -o pipefail && xcodebuild -destination "${DEST_IOS}" ${PROJECT} ${SCHEME_IOS} clean build | xcpretty | ||
|
||
if [ ! -z "$SCHEME_WATCH" ]; then | ||
printf "\n\n Build watchOS ${APP} \n" | ||
set -o pipefail && xcodebuild -destination "${DEST_WATCH}" ${PROJECT} ${SCHEME_WATCH} clean build | xcpretty | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
# Reachability.swift | ||
github "ashleymills/Reachability.swift" ~> 4.3.1 | ||
|
||
# FMDB | ||
github "ccgus/fmdb" ~> 2.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// ExtensionDelegate.swift | ||
// SnowplowSwiftDemoWatch WatchKit Extension | ||
// | ||
// Created by Leo Mehlig on 12.11.19. | ||
// Copyright © 2019 snowplowanalytics. All rights reserved. | ||
// | ||
|
||
import WatchKit | ||
|
||
class ExtensionDelegate: NSObject, WKExtensionDelegate { | ||
|
||
func applicationDidFinishLaunching() { | ||
// Perform any final initialization of your application. | ||
} | ||
|
||
func applicationDidBecomeActive() { | ||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. | ||
} | ||
|
||
func applicationWillResignActive() { | ||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. | ||
// Use this method to pause ongoing tasks, disable timers, etc. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// | ||
// InterfaceController.swift | ||
// SnowplowSwiftDemoWatch WatchKit Extension | ||
// | ||
// Created by Leo Mehlig on 12.11.19. | ||
// Copyright © 2019 snowplowanalytics. All rights reserved. | ||
// | ||
|
||
import WatchKit | ||
import Foundation | ||
import SnowplowTracker | ||
|
||
class InterfaceController: WKInterfaceController, SPRequestCallback { | ||
|
||
let kAppId = "DemoAppId" | ||
let kNamespace = "DemoAppNamespace" | ||
|
||
func getTracker(_ url: String, method: SPRequestOptions, protocol _protocol: SPProtocol) -> SPTracker { | ||
let emitter = SPEmitter.build({ (builder : SPEmitterBuilder?) -> Void in | ||
builder!.setUrlEndpoint(url) | ||
builder!.setHttpMethod(method) | ||
builder!.setProtocol(_protocol) | ||
builder!.setCallback(self) | ||
builder!.setEmitRange(500) | ||
builder!.setEmitThreadPoolSize(20) | ||
builder!.setByteLimitPost(52000) | ||
}) | ||
let subject = SPSubject(platformContext: true, andGeoContext: false) | ||
let newTracker = SPTracker.build({ (builder : SPTrackerBuilder?) -> Void in | ||
builder!.setEmitter(emitter) | ||
builder!.setAppId(self.kAppId) | ||
builder!.setTrackerNamespace(self.kNamespace) | ||
builder!.setBase64Encoded(false) | ||
builder!.setSessionContext(true) | ||
builder!.setSubject(subject) | ||
builder!.setLifecycleEvents(true) | ||
builder!.setAutotrackScreenViews(true) | ||
builder!.setScreenContext(true) | ||
builder!.setApplicationContext(true) | ||
builder!.setExceptionEvents(true) | ||
builder!.setInstallEvent(true) | ||
}) | ||
return newTracker! | ||
} | ||
|
||
var tracker : SPTracker! | ||
|
||
|
||
override func awake(withContext context: Any?) { | ||
super.awake(withContext: context) | ||
self.tracker = self.getTracker("acme.fake.com", method: .get, protocol: .http) | ||
// Configure interface objects here. | ||
} | ||
|
||
override func willActivate() { | ||
// This method is called when watch view controller is about to be visible to user | ||
super.willActivate() | ||
} | ||
|
||
override func didDeactivate() { | ||
// This method is called when watch view controller is no longer visible | ||
super.didDeactivate() | ||
} | ||
|
||
@IBAction func sendEvent() { | ||
DispatchQueue.global(qos: .default).async { | ||
// Track all types of events | ||
DemoUtils.trackAll(self.tracker) | ||
} | ||
} | ||
|
||
func onSuccess(withCount successCount: Int) { | ||
print("Success: \(successCount)") | ||
} | ||
|
||
func onFailure(withCount failureCount: Int, successCount: Int) { | ||
print("Failure: \(failureCount), Success: \(successCount)") | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.