Skip to content

Commit 76969d1

Browse files
Merge pull request #1177 from karimhm/swift-pm
Add Swift Package Manager support
2 parents 9d625f5 + c70cf76 commit 76969d1

File tree

190 files changed

+630
-82
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+630
-82
lines changed
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1230"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "XMPPFramework_XMPPFramework"
18+
BuildableName = "XMPPFramework_XMPPFramework"
19+
BlueprintName = "XMPPFramework_XMPPFramework"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "YES"
27+
buildForArchiving = "YES"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "XMPPFramework"
32+
BuildableName = "XMPPFramework"
33+
BlueprintName = "XMPPFramework"
34+
ReferencedContainer = "container:">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
<BuildActionEntry
38+
buildForTesting = "YES"
39+
buildForRunning = "YES"
40+
buildForProfiling = "YES"
41+
buildForArchiving = "YES"
42+
buildForAnalyzing = "YES">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "XMPPFrameworkSwift"
46+
BuildableName = "XMPPFrameworkSwift"
47+
BlueprintName = "XMPPFrameworkSwift"
48+
ReferencedContainer = "container:">
49+
</BuildableReference>
50+
</BuildActionEntry>
51+
<BuildActionEntry
52+
buildForTesting = "YES"
53+
buildForRunning = "YES"
54+
buildForProfiling = "NO"
55+
buildForArchiving = "NO"
56+
buildForAnalyzing = "YES">
57+
<BuildableReference
58+
BuildableIdentifier = "primary"
59+
BlueprintIdentifier = "XMPPFrameworkSwiftTests"
60+
BuildableName = "XMPPFrameworkSwiftTests"
61+
BlueprintName = "XMPPFrameworkSwiftTests"
62+
ReferencedContainer = "container:">
63+
</BuildableReference>
64+
</BuildActionEntry>
65+
<BuildActionEntry
66+
buildForTesting = "YES"
67+
buildForRunning = "YES"
68+
buildForProfiling = "NO"
69+
buildForArchiving = "NO"
70+
buildForAnalyzing = "YES">
71+
<BuildableReference
72+
BuildableIdentifier = "primary"
73+
BlueprintIdentifier = "XMPPFrameworkTests"
74+
BuildableName = "XMPPFrameworkTests"
75+
BlueprintName = "XMPPFrameworkTests"
76+
ReferencedContainer = "container:">
77+
</BuildableReference>
78+
</BuildActionEntry>
79+
<BuildActionEntry
80+
buildForTesting = "YES"
81+
buildForRunning = "YES"
82+
buildForProfiling = "YES"
83+
buildForArchiving = "YES"
84+
buildForAnalyzing = "YES">
85+
<BuildableReference
86+
BuildableIdentifier = "primary"
87+
BlueprintIdentifier = "XMPPFrameworkTestsShared"
88+
BuildableName = "XMPPFrameworkTestsShared"
89+
BlueprintName = "XMPPFrameworkTestsShared"
90+
ReferencedContainer = "container:">
91+
</BuildableReference>
92+
</BuildActionEntry>
93+
</BuildActionEntries>
94+
</BuildAction>
95+
<TestAction
96+
buildConfiguration = "Debug"
97+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
98+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
99+
shouldUseLaunchSchemeArgsEnv = "YES">
100+
<Testables>
101+
<TestableReference
102+
skipped = "NO">
103+
<BuildableReference
104+
BuildableIdentifier = "primary"
105+
BlueprintIdentifier = "XMPPFrameworkSwiftTests"
106+
BuildableName = "XMPPFrameworkSwiftTests"
107+
BlueprintName = "XMPPFrameworkSwiftTests"
108+
ReferencedContainer = "container:">
109+
</BuildableReference>
110+
</TestableReference>
111+
<TestableReference
112+
skipped = "NO">
113+
<BuildableReference
114+
BuildableIdentifier = "primary"
115+
BlueprintIdentifier = "XMPPFrameworkTests"
116+
BuildableName = "XMPPFrameworkTests"
117+
BlueprintName = "XMPPFrameworkTests"
118+
ReferencedContainer = "container:">
119+
</BuildableReference>
120+
</TestableReference>
121+
</Testables>
122+
</TestAction>
123+
<LaunchAction
124+
buildConfiguration = "Debug"
125+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
126+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
127+
launchStyle = "0"
128+
useCustomWorkingDirectory = "NO"
129+
ignoresPersistentStateOnLaunch = "NO"
130+
debugDocumentVersioning = "YES"
131+
debugServiceExtension = "internal"
132+
allowLocationSimulation = "YES">
133+
</LaunchAction>
134+
<ProfileAction
135+
buildConfiguration = "Release"
136+
shouldUseLaunchSchemeArgsEnv = "YES"
137+
savedToolIdentifier = ""
138+
useCustomWorkingDirectory = "NO"
139+
debugDocumentVersioning = "YES">
140+
<MacroExpansion>
141+
<BuildableReference
142+
BuildableIdentifier = "primary"
143+
BlueprintIdentifier = "XMPPFramework_XMPPFramework"
144+
BuildableName = "XMPPFramework_XMPPFramework"
145+
BlueprintName = "XMPPFramework_XMPPFramework"
146+
ReferencedContainer = "container:">
147+
</BuildableReference>
148+
</MacroExpansion>
149+
</ProfileAction>
150+
<AnalyzeAction
151+
buildConfiguration = "Debug">
152+
</AnalyzeAction>
153+
<ArchiveAction
154+
buildConfiguration = "Release"
155+
revealArchiveInOrganizer = "YES">
156+
</ArchiveAction>
157+
</Scheme>

.travis.yml

Lines changed: 42 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,49 @@
1-
osx_image: xcode9.3
21
language: objective-c
32

4-
cache:
5-
directories:
6-
- Carthage
7-
- Xcode/Testing-iOS/Pods
8-
- Xcode/Testing-macOS/Pods
3+
jobs:
4+
include:
5+
- stage: Swift PM
6+
osx_image: xcode12.2
7+
script:
8+
# Remove the Xcode project so `xcodebuild` would be able to test the Swift PM project.
9+
- rm -rf *.xcodeproj
10+
# Test the Swift PM project using `xcodebuild`.
11+
# The test is performed using `xcodebuild` rather than `swift test` due to this bug:
12+
# https://bugs.swift.org/browse/SR-13560
13+
- xcodebuild -scheme SPM_XMPPFramework-Package -destination "name=iPhone 11 Pro" test
914

10-
before_install:
11-
# - brew update
12-
# - brew outdated carthage || brew upgrade carthage
13-
- export IOS_SIMULATOR_DESTINATION="platform=iOS Simulator,name=iPhone 8,OS=11.3"
15+
- stage: Xcode Tests
16+
osx_image: xcode9.3
17+
cache:
18+
directories:
19+
- Carthage
20+
- Xcode/Testing-iOS/Pods
21+
- Xcode/Testing-macOS/Pods
1422

15-
install:
16-
- carthage bootstrap --no-build
17-
- cd Xcode
18-
- bundle install
19-
- bundle exec pod repo update --silent
20-
- bundle exec pod install --project-directory=Testing-iOS/
21-
- bundle exec pod install --project-directory=Testing-macOS/
22-
- cd ../
23+
before_install:
24+
# - brew update
25+
# - brew outdated carthage || brew upgrade carthage
26+
- export IOS_SIMULATOR_DESTINATION="platform=iOS Simulator,name=iPhone 8,OS=11.3"
2327

24-
before_script:
25-
- set -o pipefail
28+
install:
29+
- carthage bootstrap --no-build
30+
- cd Xcode
31+
- bundle install
32+
- bundle exec pod repo update --silent
33+
- bundle exec pod install --project-directory=Testing-iOS/
34+
- bundle exec pod install --project-directory=Testing-macOS/
35+
- cd ../
2636

27-
script:
28-
- xcodebuild -workspace Xcode/Testing-macOS/XMPPFrameworkTests.xcworkspace -scheme XMPPFrameworkTests -sdk macosx -destination 'platform=OS X,arch=x86_64' test | xcpretty -c
29-
- travis_retry xcodebuild -workspace Xcode/Testing-iOS/XMPPFrameworkTests.xcworkspace -scheme XMPPFrameworkTests -sdk iphonesimulator -destination "$IOS_SIMULATOR_DESTINATION" test | xcpretty -c
30-
- xcodebuild -workspace Xcode/Testing-macOS/XMPPFrameworkTests.xcworkspace -scheme XMPPFrameworkSwiftTests -sdk macosx -destination 'platform=OS X,arch=x86_64' test | xcpretty -c
31-
- travis_retry xcodebuild -workspace Xcode/Testing-iOS/XMPPFrameworkTests.xcworkspace -scheme XMPPFrameworkSwiftTests -sdk iphonesimulator -destination "$IOS_SIMULATOR_DESTINATION" test | xcpretty -c
37+
before_script:
38+
- set -o pipefail
3239

33-
- xcodebuild -project XMPPFramework.xcodeproj -scheme "XMPPFramework (tvOS)" -sdk appletvsimulator -arch x86_64 build | xcpretty -c
34-
- xcodebuild -project Xcode/Testing-Carthage/XMPPFrameworkTests.xcodeproj -scheme "XMPPFrameworkTests (macOS)" -sdk macosx -arch x86_64 test | xcpretty -c
35-
- xcodebuild -project Xcode/Testing-Carthage/XMPPFrameworkSwiftTests.xcodeproj -scheme "XMPPFrameworkTests (macOS)" -sdk macosx -arch x86_64 test | xcpretty -c
36-
- travis_retry xcodebuild -project Xcode/Testing-Carthage/XMPPFrameworkTests.xcodeproj -scheme "XMPPFrameworkTests (iOS)" -sdk iphonesimulator -destination "$IOS_SIMULATOR_DESTINATION" test | xcpretty -c
40+
script:
41+
- xcodebuild -workspace Xcode/Testing-macOS/XMPPFrameworkTests.xcworkspace -scheme XMPPFrameworkTests -sdk macosx -destination 'platform=OS X,arch=x86_64' test | xcpretty -c
42+
- travis_retry xcodebuild -workspace Xcode/Testing-iOS/XMPPFrameworkTests.xcworkspace -scheme XMPPFrameworkTests -sdk iphonesimulator -destination "$IOS_SIMULATOR_DESTINATION" test | xcpretty -c
43+
- xcodebuild -workspace Xcode/Testing-macOS/XMPPFrameworkTests.xcworkspace -scheme XMPPFrameworkSwiftTests -sdk macosx -destination 'platform=OS X,arch=x86_64' test | xcpretty -c
44+
- travis_retry xcodebuild -workspace Xcode/Testing-iOS/XMPPFrameworkTests.xcworkspace -scheme XMPPFrameworkSwiftTests -sdk iphonesimulator -destination "$IOS_SIMULATOR_DESTINATION" test | xcpretty -c
45+
46+
- xcodebuild -project XMPPFramework.xcodeproj -scheme "XMPPFramework (tvOS)" -sdk appletvsimulator -arch x86_64 build | xcpretty -c
47+
- xcodebuild -project Xcode/Testing-Carthage/XMPPFrameworkTests.xcodeproj -scheme "XMPPFrameworkTests (macOS)" -sdk macosx -arch x86_64 test | xcpretty -c
48+
- xcodebuild -project Xcode/Testing-Carthage/XMPPFrameworkSwiftTests.xcodeproj -scheme "XMPPFrameworkTests (macOS)" -sdk macosx -arch x86_64 test | xcpretty -c
49+
- travis_retry xcodebuild -project Xcode/Testing-Carthage/XMPPFrameworkTests.xcodeproj -scheme "XMPPFrameworkTests (iOS)" -sdk iphonesimulator -destination "$IOS_SIMULATOR_DESTINATION" test | xcpretty -c

Extensions/CoreDataStorage/XMPPCoreDataStorage.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ - (NSString *)managedObjectModelName
8888

8989
- (NSBundle *)managedObjectModelBundle
9090
{
91+
#if SWIFT_PACKAGE && defined(SWIFTPM_MODULE_BUNDLE)
92+
return SWIFTPM_MODULE_BUNDLE;
93+
#else
9194
return [NSBundle bundleForClass:[self class]];
95+
#endif
9296
}
9397

9498
- (NSString *)defaultDatabaseFileName

Extensions/XEP-0045/HybridStorage/XMPPRoomHybridStorageProtected.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* E.g. [super insertOccupant...]
1010
**/
1111

12+
#import "XMPPRoomHybridStorage.h"
13+
1214
@interface XMPPRoomHybridStorage (Protected)
1315

1416
/**

0 commit comments

Comments
 (0)