Skip to content

Commit 2a8940d

Browse files
committed
updated configuration for both SPM and cocoapod use, solidifed bundle references for cross-compatibility, updated travis.yml for tests, fole cleanup, updated schemes, added spm test script to workaround bug in swift test from CLI
1 parent 5317a3e commit 2a8940d

File tree

23 files changed

+366
-239
lines changed

23 files changed

+366
-239
lines changed

.travis.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
# * https://www.objc.io/issues/6-build-tools/travis-ci/
33
# * https://github.com/supermarin/xcpretty#usage
44

5-
osx_image: xcode11.5
5+
osx_image: xcode12
66
language: objective-c
77
# cache: cocoapods
8-
podfile: Example/Podfile
8+
podfile: Projects/CocoapodsExample/Podfile
99
before_install:
1010
- gem install cocoapods # Since Travis is not always on latest version
11-
- pod install --project-directory=Example
11+
- pod install --project-directory=Projects/CocoapodsExample
1212
script:
13+
# run cococoapod compatibility tests
1314
- pod lib lint --verbose
15+
# run swift-pm compatibility tests
16+
- ./swift-test

Package.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ let package = Package(
1616
name: "random-swift",
1717
resources: [
1818
.process("Resources/words.txt"),
19+
],
20+
swiftSettings: [
21+
.define("SPM")
1922
]
2023
),
2124
.testTarget(
2225
name: "random-swift-tests",
2326
dependencies: ["random-swift"],
27+
path: "Projects/CocoapodsExample/random-swift-ExampleTests/Sources",
2428
swiftSettings: [
25-
.define("TESTING")
29+
.define("SPMTEST")
2630
]
2731
)
2832
]

Projects/CocoapodsExample/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ target 'random-swift_Example' do
1414
# Pod install settings
1515
use_frameworks!
1616
pod 'random-swift', :path => '../../'
17-
target 'random-swift_Tests' do
17+
target 'random-swift-ExampleTests' do
1818
inherit! :search_paths
1919
end
2020
end
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- random-swift (1.0.0)
2+
- random-swift (1.0.1)
33

44
DEPENDENCIES:
55
- random-swift (from `../../`)
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
99
:path: "../../"
1010

1111
SPEC CHECKSUMS:
12-
random-swift: 55cfab96f01e2ce58b74f896f172c7cd96a10066
12+
random-swift: 7e338af36c478316bdf55b7a24d569f756d785be
1313

14-
PODFILE CHECKSUM: 6060fdd1c868d406b4a4ab0ec122c335573f4fb9
14+
PODFILE CHECKSUM: 0bea5696326438d8e9398148f6cc4410922f36f3
1515

16-
COCOAPODS: 1.10.0.rc.1
16+
COCOAPODS: 1.10.0
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
</dict>
22+
</plist>

Tests/random-swift-tests/Sources/ConfigurationTests.swift renamed to Projects/CocoapodsExample/random-swift-ExampleTests/Sources/RS0ConfigurationTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import XCTest
1010
#endif
1111
import random_swift
1212

13-
class ConfigurationTests: XCTestCase {
13+
class RS0ConfigurationTests: XCTestCase {
1414

1515
override func setUpWithError() throws {
1616
// Put setup code here. This method is called before the invocation of each test method in the class.

Tests/random-swift-tests/Sources/ComputedPropertyTests.swift renamed to Projects/CocoapodsExample/random-swift-ExampleTests/Sources/RS1ComputedPropertyTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
//
77

88
import XCTest
9-
import random_swift
9+
import random_swift
1010

11-
class ComputedPropertyTests: XCTestCase {
11+
class RS1ComputedPropertyTests: XCTestCase {
1212

1313
override func setUpWithError() throws {
1414
// Put setup code here. This method is called before the invocation of each test method in the class.

Tests/random-swift-tests/Sources/ObjectMethodTests.swift renamed to Projects/CocoapodsExample/random-swift-ExampleTests/Sources/RS2ObjectMethodTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import XCTest
1010
#endif
1111
import random_swift
1212

13-
class ObjectMethodTests: XCTestCase {
13+
class RS2ObjectMethodTests: XCTestCase {
1414

1515
override func setUpWithError() throws {
1616
// Put setup code here. This method is called before the invocation of each test method in the class.

Tests/random-swift-tests/Sources/RandomWordTests.swift renamed to Projects/CocoapodsExample/random-swift-ExampleTests/Sources/RS3RandomWordTests.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ import XCTest
1010
#endif
1111
import random_swift
1212

13-
class RandomWordTests: XCTestCase {
13+
class RS3RandomWordTests: XCTestCase {
1414

1515
override func setUpWithError() throws {
1616
// Put setup code here. This method is called before the invocation of each test method in the class.
17+
#if SPMTEST
18+
print("SPMTEST set in the env")
19+
print("test resource bundle: \(Bundle(for: RS3RandomWordTests.self).bundlePath)")
20+
#endif
1721
}
1822

1923
override func tearDownWithError() throws {
@@ -24,7 +28,6 @@ class RandomWordTests: XCTestCase {
2428

2529
for _ in 0 ... 235886 {
2630
let randomWord = Random.word
27-
//print("retrieved random word: \(randomWord)")
2831
XCTAssertFalse(randomWord.contains("::error::"))
2932
}
3033
}

Tests/random-swift-tests/Sources/ExtensionTests+StaticFuncTests.swift renamed to Projects/CocoapodsExample/random-swift-ExampleTests/Sources/RS4ExtensionTests+StaticFuncTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import XCTest
1010
#endif
1111
import random_swift
1212

13-
class ExtensionTests: XCTestCase {
13+
class RS4ExtensionTests: XCTestCase {
1414

1515
override func setUpWithError() throws {
1616
// Put setup code here. This method is called before the invocation of each test method in the class.

0 commit comments

Comments
 (0)