Skip to content

Commit 2df7895

Browse files
committedOct 23, 2019
build: Add scripts to build and test using Xcode
- xcode-build.sh builds and optionally tests SwiftFoundation. usage: ./xcode-build.sh [--clean] [--debug|--release] [--test] - DarwinCompatibilityTests/xcode-build.sh builds and tests using the DarwinCompatibilityTests. usage: DarwinCompatibilityTests/xcode-build.sh [--clean]
1 parent e872f47 commit 2df7895

File tree

7 files changed

+153
-8
lines changed

7 files changed

+153
-8
lines changed
 

‎DarwinCompatibilityTests.xcodeproj/project.pbxproj

+9-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
B97E7856222AF995007596B0 /* TestPropertyListEncoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = B97E7855222AF995007596B0 /* TestPropertyListEncoder.swift */; };
2828
B987C65E2093C8AF0026B50D /* TestImports.swift in Sources */ = {isa = PBXBuildFile; fileRef = B987C65D2093C8AF0026B50D /* TestImports.swift */; };
2929
B98E33E02136AC120044EBE9 /* TestFileWithZeros.txt in Resources */ = {isa = PBXBuildFile; fileRef = B98E33DF2136AC120044EBE9 /* TestFileWithZeros.txt */; };
30+
B99EAE7023602FFA00C8FB46 /* TestsToSkip.txt in Resources */ = {isa = PBXBuildFile; fileRef = B99EAE6E23602FFA00C8FB46 /* TestsToSkip.txt */; };
31+
B99EAE7123602FFA00C8FB46 /* xcode-build.sh in Resources */ = {isa = PBXBuildFile; fileRef = B99EAE6F23602FFA00C8FB46 /* xcode-build.sh */; };
3032
B9C1C63422607372002BBEA0 /* FixtureValues.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9C1C63322607372002BBEA0 /* FixtureValues.swift */; };
3133
B9C89F361F6BF89C00087AF4 /* TestScanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9C89EE61F6BF88F00087AF4 /* TestScanner.swift */; };
3234
B9C89F371F6BF89C00087AF4 /* TestNSValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9C89EE71F6BF88F00087AF4 /* TestNSValue.swift */; };
@@ -186,6 +188,8 @@
186188
B97E7855222AF995007596B0 /* TestPropertyListEncoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestPropertyListEncoder.swift; path = TestFoundation/TestPropertyListEncoder.swift; sourceTree = "<group>"; };
187189
B987C65D2093C8AF0026B50D /* TestImports.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestImports.swift; path = TestFoundation/TestImports.swift; sourceTree = "<group>"; };
188190
B98E33DF2136AC120044EBE9 /* TestFileWithZeros.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = TestFileWithZeros.txt; path = TestFoundation/Resources/TestFileWithZeros.txt; sourceTree = "<group>"; };
191+
B99EAE6E23602FFA00C8FB46 /* TestsToSkip.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TestsToSkip.txt; sourceTree = "<group>"; };
192+
B99EAE6F23602FFA00C8FB46 /* xcode-build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "xcode-build.sh"; sourceTree = "<group>"; };
189193
B9C1C63322607372002BBEA0 /* FixtureValues.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = FixtureValues.swift; path = TestFoundation/FixtureValues.swift; sourceTree = "<group>"; };
190194
B9C89ED11F6BF67C00087AF4 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
191195
B9C89ED71F6BF77E00087AF4 /* DarwinCompatibilityTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DarwinCompatibilityTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -252,7 +256,7 @@
252256
B9C89F221F6BF89800087AF4 /* TestNSCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNSCache.swift; path = TestFoundation/TestNSCache.swift; sourceTree = "<group>"; };
253257
B9C89F231F6BF89800087AF4 /* TestNSDictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNSDictionary.swift; path = TestFoundation/TestNSDictionary.swift; sourceTree = "<group>"; };
254258
B9C89F241F6BF89800087AF4 /* TestNotificationCenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNotificationCenter.swift; path = TestFoundation/TestNotificationCenter.swift; sourceTree = "<group>"; };
255-
B9C89F251F6BF89800087AF4 /* TestProcess.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestProcess.swift; path = TestFoundation/TestProcess.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
259+
B9C89F251F6BF89800087AF4 /* TestProcess.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestProcess.swift; path = TestFoundation/TestProcess.swift; sourceTree = "<group>"; };
256260
B9C89F261F6BF89900087AF4 /* TestEnergyFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestEnergyFormatter.swift; path = TestFoundation/TestEnergyFormatter.swift; sourceTree = "<group>"; };
257261
B9C89F271F6BF89900087AF4 /* TestNSCompoundPredicate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNSCompoundPredicate.swift; path = TestFoundation/TestNSCompoundPredicate.swift; sourceTree = "<group>"; };
258262
B9C89F281F6BF89900087AF4 /* TestNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNotification.swift; path = TestFoundation/TestNotification.swift; sourceTree = "<group>"; };
@@ -472,6 +476,8 @@
472476
B9C89ED81F6BF77E00087AF4 /* DarwinCompatibilityTests */ = {
473477
isa = PBXGroup;
474478
children = (
479+
B99EAE6F23602FFA00C8FB46 /* xcode-build.sh */,
480+
B99EAE6E23602FFA00C8FB46 /* TestsToSkip.txt */,
475481
B9F3269E1FC714DD003C3599 /* DarwinShims.swift */,
476482
B9C89EDF1F6BF79000087AF4 /* TestFoundation */,
477483
B9C89EDB1F6BF77E00087AF4 /* Info.plist */,
@@ -563,6 +569,7 @@
563569
files = (
564570
B907F36F20BB188800013CBE /* NSString-ISO-8859-1-data.txt in Resources */,
565571
B9C89FBA1F6DCAEB00087AF4 /* NSString-UTF32-LE-data.txt in Resources */,
572+
B99EAE7023602FFA00C8FB46 /* TestsToSkip.txt in Resources */,
566573
B9C89FBB1F6DCAEB00087AF4 /* NSKeyedUnarchiver-EdgeInsetsTest.plist in Resources */,
567574
B9C89FBC1F6DCAEB00087AF4 /* NSKeyedUnarchiver-ConcreteValueTest.plist in Resources */,
568575
B9C89FBD1F6DCAEB00087AF4 /* NSKeyedUnarchiver-RectTest.plist in Resources */,
@@ -582,6 +589,7 @@
582589
B9C89FCA1F6DCAEB00087AF4 /* NSKeyedUnarchiver-RangeTest.plist in Resources */,
583590
B9C89FCB1F6DCAEB00087AF4 /* NSXMLDocumentTestData.xml in Resources */,
584591
B9C89FCC1F6DCAEB00087AF4 /* NSKeyedUnarchiver-NotificationTest.plist in Resources */,
592+
B99EAE7123602FFA00C8FB46 /* xcode-build.sh in Resources */,
585593
B9C89FCD1F6DCAEB00087AF4 /* PropertyList-1.0.dtd in Resources */,
586594
B9C89FCE1F6DCAEB00087AF4 /* Test.plist in Resources */,
587595
);

‎DarwinCompatibilityTests.xcodeproj/xcshareddata/xcschemes/xdgTestHelper.xcscheme

+12
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,27 @@
4747
ReferencedContainer = "container:DarwinCompatibilityTests.xcodeproj">
4848
</BuildableReference>
4949
<SkippedTests>
50+
<Test
51+
Identifier = "TestDateComponents/test_hash()">
52+
</Test>
5053
<Test
5154
Identifier = "TestFileHandle">
5255
</Test>
5356
<Test
5457
Identifier = "TestPipe">
5558
</Test>
59+
<Test
60+
Identifier = "TestURLComponents/test_hash()">
61+
</Test>
62+
<Test
63+
Identifier = "TestURLRequest/test_hash()">
64+
</Test>
5665
<Test
5766
Identifier = "TestURLSession">
5867
</Test>
68+
<Test
69+
Identifier = "TestXMLDocument/test_creatingAnEmptyDocumentAndNode()">
70+
</Test>
5971
</SkippedTests>
6072
</TestableReference>
6173
</Testables>
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
TestByteCountFormatter
2+
TestCodable
3+
TestDateComponents
4+
TestDateFormatter
5+
TestDateIntervalFormatter
6+
TestDecimal
7+
TestFileManager
8+
TestHTTPCookie
9+
TestHTTPCookieStorage
10+
TestHTTPURLResponse
11+
TestISO8601DateFormatter
12+
TestIndexPath
13+
TestIndexSet
14+
TestJSONEncoder
15+
TestJSONSerialization
16+
TestLengthFormatter
17+
TestMeasurement
18+
TestNSArray
19+
TestNSAttributedString
20+
TestNSCache
21+
TestNSData
22+
TestNSDateComponents
23+
TestNSDictionary
24+
TestNSGeometry
25+
TestNSKeyedArchiver
26+
TestNSMutableAttributedString
27+
TestNSNumber
28+
TestNSOrderedSet
29+
TestNSRegularExpression
30+
TestNSSet
31+
TestNSSortDescriptor
32+
TestNSString
33+
TestNSTextCheckingResult
34+
TestNSURLRequest
35+
TestNotificationQueue
36+
TestNumberFormatter
37+
TestObjCRuntime
38+
TestProcess
39+
TestProcessInfo
40+
TestRunLoop
41+
TestTimeZone
42+
TestURL
43+
TestURLComponents
44+
TestURLProtocol
45+
TestURLRequest
46+
TestURLResponse
47+
TestURLSessionFTP
48+
TestUnit
49+
TestUserDefaults
50+
TestXMLDocument
51+
TestXMLParser
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
DERIVED_DATA=dct-xcode-test-build
4+
if [ "$1" == "--clean" ]; then
5+
rm -rf "${DERIVED_DATA}"
6+
shift
7+
fi
8+
9+
if [ "$1" != "" ]; then
10+
xcodebuild -derivedDataPath $DERIVED_DATA -project DarwinCompatibilityTests.xcodeproj -scheme xdgTestHelper "-only-testing:DarwinCompatibilityTests/$1" test
11+
else
12+
xcodebuild -derivedDataPath $DERIVED_DATA -project DarwinCompatibilityTests.xcodeproj -scheme xdgTestHelper `sed 's/^/-skip-testing:DarwinCompatibilityTests\//g' DarwinCompatibilityTests/TestsToSkip.txt` test
13+
fi

‎Foundation.xcodeproj/project.pbxproj

+13-3
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,10 @@
424424
B933A79F1F3055F700FE6846 /* NSString-UTF32-LE-data.txt in Resources */ = {isa = PBXBuildFile; fileRef = B933A79D1F3055F600FE6846 /* NSString-UTF32-LE-data.txt */; };
425425
B940492D223B146800FB4384 /* TestProgressFraction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B940492C223B146800FB4384 /* TestProgressFraction.swift */; };
426426
B951B5EC1F4E2A2000D8B332 /* TestNSLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = B951B5EB1F4E2A2000D8B332 /* TestNSLock.swift */; };
427+
B95FC97522AF051B005DEA0A /* xcode-build.sh in Resources */ = {isa = PBXBuildFile; fileRef = B95FC97422AF051B005DEA0A /* xcode-build.sh */; };
427428
B95FC97622B84B0A005DEA0A /* TestNSSortDescriptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 152EF3932283457B001E1269 /* TestNSSortDescriptor.swift */; };
428429
B98E33DD2136AA740044EBE9 /* TestFileWithZeros.txt in Resources */ = {isa = PBXBuildFile; fileRef = B98E33DC2136AA740044EBE9 /* TestFileWithZeros.txt */; };
430+
B99EAE72236044C900C8FB46 /* SwiftXCTest.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B95FC97222AF0050005DEA0A /* SwiftXCTest.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
429431
B9C0E89620C31AB60064C68C /* CFInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5B5D888A1BBC963C00234F36 /* CFInternal.h */; settings = {ATTRIBUTES = (Private, ); }; };
430432
BB3D7558208A1E500085CFDC /* TestImports.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB3D7557208A1E500085CFDC /* TestImports.swift */; };
431433
BD8042161E09857800487EB8 /* TestLengthFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD8042151E09857800487EB8 /* TestLengthFormatter.swift */; };
@@ -672,6 +674,7 @@
672674
dstPath = "";
673675
dstSubfolderSpec = 10;
674676
files = (
677+
B99EAE72236044C900C8FB46 /* SwiftXCTest.framework in CopyFiles */,
675678
5BDC406E1BD6D8C400ED97BB /* SwiftFoundation.framework in CopyFiles */,
676679
1550111822EA43E00088F082 /* SwiftFoundationXML.framework in CopyFiles */,
677680
1550111C22EA43E20088F082 /* SwiftFoundationNetworking.framework in CopyFiles */,
@@ -934,7 +937,7 @@
934937
5B6E11A81DA45EB5009B48A3 /* CFDateFormatter_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFDateFormatter_Private.h; sourceTree = "<group>"; };
935938
5B6F17921C48631C00935030 /* TestNSNull.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestNSNull.swift; sourceTree = "<group>"; };
936939
5B6F17931C48631C00935030 /* TestNumberFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestNumberFormatter.swift; sourceTree = "<group>"; };
937-
5B6F17941C48631C00935030 /* TestProcess.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = TestProcess.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
940+
5B6F17941C48631C00935030 /* TestProcess.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = TestProcess.swift; sourceTree = "<group>"; };
938941
5B6F17951C48631C00935030 /* TestXMLDocument.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestXMLDocument.swift; sourceTree = "<group>"; };
939942
5B6F17961C48631C00935030 /* TestUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestUtils.swift; sourceTree = "<group>"; };
940943
5B7818591D6CB5CD004A01F2 /* CGFloat.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CGFloat.swift; sourceTree = "<group>"; };
@@ -1063,8 +1066,10 @@
10631066
B91095791EEF237800A71930 /* NSString-UTF16-BE-data.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "NSString-UTF16-BE-data.txt"; sourceTree = "<group>"; };
10641067
B933A79C1F3055F600FE6846 /* NSString-UTF32-BE-data.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = "NSString-UTF32-BE-data.txt"; sourceTree = "<group>"; };
10651068
B933A79D1F3055F600FE6846 /* NSString-UTF32-LE-data.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = "NSString-UTF32-LE-data.txt"; sourceTree = "<group>"; };
1066-
B940492C223B146800FB4384 /* TestProgressFraction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestProgressFraction.swift; path = TestFoundation/TestProgressFraction.swift; sourceTree = "<group>"; };
1069+
B940492C223B146800FB4384 /* TestProgressFraction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestProgressFraction.swift; sourceTree = "<group>"; };
10671070
B951B5EB1F4E2A2000D8B332 /* TestNSLock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestNSLock.swift; sourceTree = "<group>"; };
1071+
B95FC97222AF0050005DEA0A /* SwiftXCTest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SwiftXCTest.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1072+
B95FC97422AF051B005DEA0A /* xcode-build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "xcode-build.sh"; sourceTree = "<group>"; };
10681073
B98E33DC2136AA740044EBE9 /* TestFileWithZeros.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TestFileWithZeros.txt; sourceTree = "<group>"; };
10691074
B9974B8F1EDF4A22007F15B8 /* TransferState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransferState.swift; sourceTree = "<group>"; };
10701075
B9974B901EDF4A22007F15B8 /* MultiHandle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MultiHandle.swift; sourceTree = "<group>"; };
@@ -1328,7 +1333,7 @@
13281333
5B5D88531BBC938800234F36 = {
13291334
isa = PBXGroup;
13301335
children = (
1331-
B940492C223B146800FB4384 /* TestProgressFraction.swift */,
1336+
B95FC97422AF051B005DEA0A /* xcode-build.sh */,
13321337
B167A6641ED7303F0040B09A /* README.md */,
13331338
5BDC3F2C1BCC5DB500ED97BB /* Foundation */,
13341339
EAB57B681BD1A255004AC5C5 /* CoreFoundation */,
@@ -1338,6 +1343,7 @@
13381343
5B5D89AB1BBDCD0B00234F36 /* Frameworks */,
13391344
5B5D885E1BBC938800234F36 /* Products */,
13401345
1550110A22EA266C0088F082 /* SwiftFoundation copy-Info.plist */,
1346+
B95FC97222AF0050005DEA0A /* SwiftXCTest.framework */,
13411347
);
13421348
indentWidth = 4;
13431349
sourceTree = "<group>";
@@ -1819,6 +1825,7 @@
18191825
3EA9D66F1EF0532D00B362D6 /* TestJSONEncoder.swift */,
18201826
AA9E0E0C21FA6E0700963F4C /* TestPropertyListEncoder.swift */,
18211827
DCA8120A1F046D13000D0C86 /* TestCodable.swift */,
1828+
B940492C223B146800FB4384 /* TestProgressFraction.swift */,
18221829
C93559281C12C49F009FD6A9 /* TestAffineTransform.swift */,
18231830
EA66F63C1BF1619600136161 /* TestNSArray.swift */,
18241831
294E3C1C1CC5E19300E4F44C /* TestNSAttributedString.swift */,
@@ -2629,6 +2636,7 @@
26292636
isa = PBXResourcesBuildPhase;
26302637
buildActionMask = 2147483647;
26312638
files = (
2639+
B95FC97522AF051B005DEA0A /* xcode-build.sh in Resources */,
26322640
);
26332641
runOnlyForDeploymentPostprocessing = 0;
26342642
};
@@ -4032,6 +4040,7 @@
40324040
CLANG_ENABLE_MODULES = YES;
40334041
CLANG_ENABLE_OBJC_ARC = YES;
40344042
HEADER_SEARCH_PATHS = "$(CONFIGURATION_BUILD_DIR)/usr/local/include";
4043+
LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx @executable_path @executable_path/../Frameworks";
40354044
PRODUCT_NAME = "$(TARGET_NAME)";
40364045
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
40374046
SWIFT_VERSION = 5.0;
@@ -4044,6 +4053,7 @@
40444053
CLANG_ENABLE_MODULES = YES;
40454054
CLANG_ENABLE_OBJC_ARC = YES;
40464055
HEADER_SEARCH_PATHS = "$(CONFIGURATION_BUILD_DIR)/usr/local/include";
4056+
LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx @executable_path @executable_path/../Frameworks";
40474057
PRODUCT_NAME = "$(TARGET_NAME)";
40484058
SWIFT_VERSION = 5.0;
40494059
};

‎Foundation.xcodeproj/xcshareddata/xcschemes/TestFoundation.xcscheme

+2-4
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@
8383
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
8484
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
8585
shouldUseLaunchSchemeArgsEnv = "YES">
86-
<Testables>
87-
</Testables>
8886
<MacroExpansion>
8987
<BuildableReference
9088
BuildableIdentifier = "primary"
@@ -94,8 +92,8 @@
9492
ReferencedContainer = "container:Foundation.xcodeproj">
9593
</BuildableReference>
9694
</MacroExpansion>
97-
<AdditionalOptions>
98-
</AdditionalOptions>
95+
<Testables>
96+
</Testables>
9997
</TestAction>
10098
<LaunchAction
10199
buildConfiguration = "Debug"

‎xcode-build.sh

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
3+
DERIVED_DATA=xcode-test-build
4+
5+
CLEAN=0
6+
CONFIG=Debug
7+
TEST=0
8+
TESTCASE=""
9+
10+
for i in "$@"
11+
do
12+
case $i in
13+
-h)
14+
echo "usage: $0 [--clean] [--debug|--release] [--test]"
15+
exit 0
16+
;;
17+
18+
--clean)
19+
CLEAN=1
20+
;;
21+
22+
--debug)
23+
CONFIG=Debug
24+
;;
25+
26+
--release)
27+
CONFIG=Release
28+
;;
29+
30+
--test)
31+
TEST=1
32+
;;
33+
*)
34+
TESTCASE="$i"
35+
break
36+
;;
37+
esac
38+
done
39+
40+
if [ $CLEAN = 1 ]; then
41+
echo Cleaning
42+
rm -rf "${DERIVED_DATA}"
43+
fi
44+
45+
xcodebuild -derivedDataPath $DERIVED_DATA -workspace Foundation.xcworkspace -scheme SwiftFoundation -configuration $CONFIG build || exit 1
46+
xcodebuild -derivedDataPath $DERIVED_DATA -workspace Foundation.xcworkspace -scheme SwiftFoundationNetworking -configuration $CONFIG build || exit 1
47+
48+
if [ $TEST = 1 ]; then
49+
echo Testing
50+
xcodebuild -derivedDataPath $DERIVED_DATA -workspace Foundation.xcworkspace -scheme TestFoundation -configuration $CONFIG build || exit 1
51+
$DERIVED_DATA/Build/Products/$CONFIG/TestFoundation.app/Contents/MacOS/TestFoundation $TESTCASE
52+
fi
53+

0 commit comments

Comments
 (0)
Please sign in to comment.