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

Swift Rename #942

Merged
merged 19 commits into from
Sep 21, 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
22 changes: 2 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,13 @@ jobs:
name: Install build dependencies
command: |
sudo gem install xcpretty
sudo gem install cocoapods -v $(var=$(tail -1 Podfile.lock); echo ${var##COCOAPODS:})

- restore_cache:
key: 1-pods-{{ checksum "Podfile.lock" }}
- run:
name: Install CocoaPods
command: |
if [ ! -d "Pods" ]
then
make dependencies
fi
- save_cache:
key: 1-pods-{{ checksum "Podfile.lock" }}
paths:
- ./Pods

- run: make build-ios
- run: make test-ios
- run: make build-tvos
- run: make test-tvos
- run: make build-macos
- run: make test-macos
- run: make lint
- run: make carthage

Expand All @@ -38,11 +25,6 @@ jobs:
path: build/reports
- run: bash <(curl -s https://codecov.io/bash)

# Save Pods to artifacts in case we need to dig up dependencies later
- run: zip -FSr Pods.zip ./Pods
- store_artifacts:
path: Pods.zip

workflows:
version: 2
build_and_test:
Expand Down
7 changes: 4 additions & 3 deletions Analytics.podspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Pod::Spec.new do |s|
s.name = "Analytics"
s.module_name = "Segment"
s.version = "4.0.5"
s.summary = "The hassle-free way to add analytics to your iOS app."

Expand All @@ -14,14 +15,14 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/segmentio/analytics-ios.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/segment'

s.ios.deployment_target = '7.0'
s.ios.deployment_target = '11.0'
s.tvos.deployment_target = '9.0'

s.ios.frameworks = 'CoreTelephony'
s.frameworks = 'Security', 'StoreKit', 'SystemConfiguration', 'UIKit'

s.source_files = [
'Analytics/Classes/**/*',
'Analytics/Internal/**/*'
'Segment/Classes/**/*',
'Segment/Internal/**/*'
]
end
10 changes: 0 additions & 10 deletions Analytics.xcworkspace/contents.xcworkspacedata

This file was deleted.

19 changes: 0 additions & 19 deletions AnalyticsTests/AnalyticsTests-Bridging-Header.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@
EADEB9151DED460A005322DA /* Sources */,
EADEB9161DED460A005322DA /* Frameworks */,
EADEB9171DED460A005322DA /* Resources */,
29A9CC64339681809F2A93F1 /* [CP] Embed Pods Frameworks */,
5E9EED2DB8900F15E25C6735 /* [CP] Copy Pods Resources */,
E9AA829C39577BEB8BFB46EB /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -191,37 +190,22 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
29A9CC64339681809F2A93F1 /* [CP] Embed Pods Frameworks */ = {
E9AA829C39577BEB8BFB46EB /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-CocoapodsExample/Pods-CocoapodsExample-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Analytics/Analytics.framework",
"${PODS_ROOT}/Target Support Files/Pods-CocoapodsExample/Pods-CocoapodsExample-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Analytics/Segment.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Analytics.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Segment.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CocoapodsExample/Pods-CocoapodsExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
5E9EED2DB8900F15E25C6735 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CocoapodsExample/Pods-CocoapodsExample-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CocoapodsExample/Pods-CocoapodsExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
2 changes: 1 addition & 1 deletion Examples/CocoapodsExample/CocoapodsExample/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2016 Segment. All rights reserved.
//

#import <Analytics/SEGAnalytics.h>
#import <Segment/SEGAnalytics.h>
#import "AppDelegate.h"


Expand Down
4 changes: 1 addition & 3 deletions Examples/CocoapodsExample/CocoapodsExample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
// Copyright © 2016 Segment. All rights reserved.
//

#import <Analytics/SEGAnalytics.h>
// TODO: Test and see if this works
// @import Analytics;
#import <Segment/SEGAnalytics.h>
#import "ViewController.h"


Expand Down
8 changes: 4 additions & 4 deletions Examples/CocoapodsExample/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- Analytics (3.6.9)
- Analytics (4.0.5)

DEPENDENCIES:
- Analytics (from `../../`)

EXTERNAL SOURCES:
Analytics:
:path: ../../
:path: "../../"

SPEC CHECKSUMS:
Analytics: 6541ce337e99d9f7a2240a8b3953940a7be5f998
Analytics: ecaad22be45600b95b16849092e0548cf5a40968

PODFILE CHECKSUM: 20b258e875ed60a69591787e49bdc3ca9f7c4ad3

COCOAPODS: 1.3.1
COCOAPODS: 1.9.1
33 changes: 20 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,49 +1,56 @@
XC_ARGS := -workspace Analytics.xcworkspace GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES
XC_ARGS := -project Segment.xcodeproj GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES
IOS_XCARGS := $(XC_ARGS) -destination "platform=iOS Simulator,name=iPhone 11" -sdk iphonesimulator
TVOS_XCARGS := $(XC_ARGS) -destination "platform=tvOS Simulator,name=Apple TV"
XC_BUILD_ARGS := -scheme Analytics ONLY_ACTIVE_ARCH=NO
MACOS_XCARGS := $(XC_ARGS) -destination "platform=macOS"
XC_BUILD_ARGS := -scheme Segment ONLY_ACTIVE_ARCH=NO
XC_TEST_ARGS := GCC_GENERATE_TEST_COVERAGE_FILES=YES SWIFT_VERSION=5.0 RUN_E2E_TESTS=$(RUN_E2E_TESTS) WEBHOOK_AUTH_USERNAME=$(WEBHOOK_AUTH_USERNAME)

bootstrap:
.buildscript/bootstrap.sh

dependencies: Podfile Analytics.podspec
pod install

lint:
pod lib lint --allow-warnings

carthage:
carthage build --platform ios --no-skip-current

archive: carthage
carthage archive Analytics
carthage archive Segment

clean-ios:
set -o pipefail && xcodebuild $(IOS_XCARGS) -scheme Analytics clean | xcpretty
set -o pipefail && xcodebuild $(IOS_XCARGS) -scheme Segment clean | xcpretty

clean-tvos:
set -o pipefail && xcodebuild $(TVOS_XCARGS) -scheme Analytics clean | xcpretty
set -o pipefail && xcodebuild $(TVOS_XCARGS) -scheme Segment clean | xcpretty

clean-macos:
set -o pipefail && xcodebuild $(MACOS_XCARGS) -scheme Segment clean | xcpretty

clean: clean-ios clean-tvos
clean: clean-ios clean-tvos clean-macos

build-ios:
set -o pipefail && xcodebuild $(IOS_XCARGS) $(XC_BUILD_ARGS) | xcpretty

build-tvos:
set -o pipefail && xcodebuild $(TVOS_XCARGS) $(XC_BUILD_ARGS) | xcpretty

build-macos:
set -o pipefail && xcodebuild $(MACOS_XCARGS) $(XC_BUILD_ARGS) | xcpretty

build: build-ios build-tvos

test-ios:
@set -o pipefail && xcodebuild test $(IOS_XCARGS) -scheme AnalyticsTests $(XC_TEST_ARGS) | xcpretty --report junit
@set -o pipefail && xcodebuild test $(IOS_XCARGS) -scheme SegmentTests $(XC_TEST_ARGS) | xcpretty --report junit

test-tvos:
@set -o pipefail && xcodebuild test $(TVOS_XCARGS) -scheme AnalyticsTestsTVOS $(XC_TEST_ARGS) | xcpretty --report junit
@set -o pipefail && xcodebuild test $(TVOS_XCARGS) -scheme SegmentTests $(XC_TEST_ARGS) | xcpretty --report junit

test-macos:
@set -o pipefail && xcodebuild test $(MACOS_XCARGS) -scheme SegmentTests $(XC_TEST_ARGS) | xcpretty --report junit

test: test-ios test-tvos
test: test-ios test-tvos test-macos

xctest:
xctool $(IOS_XCARGS) -scheme AnalyticsTests $(XC_TEST_ARGS) run-tests -sdk iphonesimulator
xctool $(IOS_XCARGS) -scheme SegmentTests $(XC_TEST_ARGS) run-tests -sdk iphonesimulator

.PHONY: bootstrap dependencies lint carthage archive build test xctest clean
10 changes: 5 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import PackageDescription

let package = Package(
name: "Analytics",
name: "Segment",
platforms: [
.iOS(.v12), .tvOS(.v12)
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "Analytics",
targets: ["Analytics"]),
name: "Segment",
targets: ["Segment"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
Expand All @@ -22,9 +22,9 @@ let package = Package(
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "Analytics",
name: "Segment",
dependencies: [],
path: "Analytics/",
path: "Segment/",
exclude: ["SwiftSources"],
sources: ["Classes", "Internal"],
publicHeadersPath: "Classes",
Expand Down
15 changes: 0 additions & 15 deletions Podfile

This file was deleted.

16 changes: 0 additions & 16 deletions Podfile.lock

This file was deleted.

Loading