Skip to content

Commit 41ef672

Browse files
authored
Merge pull request #723 from mac-cain13/cli-support
CLI support
2 parents 8607e84 + efa2cb3 commit 41ef672

File tree

20 files changed

+406
-202
lines changed

20 files changed

+406
-202
lines changed

.github/workflows/checks.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ on:
77
branches: '*'
88

99
env:
10-
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
10+
DEVELOPER_DIR: /Applications/Xcode_13.0.app/Contents/Developer
1111

1212
jobs:
1313
unit-tests:
14-
runs-on: macos-latest
14+
runs-on: macos-11
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v2
1818
- name: Pull cache
19-
uses: actions/cache@v1
19+
uses: actions/cache@v2
2020
with:
2121
path: .build
2222
key: ${{ runner.os }}spm${{ hashFiles('**/Package.resolved') }}
@@ -26,7 +26,7 @@ jobs:
2626
run: swift test -v
2727

2828
test-iOS:
29-
runs-on: macos-latest
29+
runs-on: macos-11
3030
needs: build
3131
steps:
3232
- name: Checkout
@@ -41,21 +41,21 @@ jobs:
4141
mv rswift-dev/rswift build/Debug/rswift
4242
chmod +x build/Debug/rswift
4343
- name: Pull cache
44-
uses: actions/cache@v1
45-
id: podcache
44+
uses: actions/cache@v2
45+
id: podcache-ios
4646
with:
4747
path: Examples/Pods
4848
key: ${{ runner.os }}pods${{ hashFiles('**/Podfile.lock') }}
4949
restore-keys: |
5050
${{ runner.os }}pods
5151
- name: Install pods
52-
if: steps.podcache.outputs.cache-hit != 'true'
52+
if: steps.podcache-ios.outputs.cache-hit != 'true'
5353
run: pod install --project-directory=Examples
5454
- name: Test
5555
run: fastlane scan --workspace "Examples/RswiftExamples.xcworkspace" --scheme "ResourceApp"
5656

5757
test-tvOS:
58-
runs-on: macos-latest
58+
runs-on: macos-11
5959
needs: build
6060
steps:
6161
- name: Checkout
@@ -70,26 +70,26 @@ jobs:
7070
mv rswift-dev/rswift build/Debug/rswift
7171
chmod +x build/Debug/rswift
7272
- name: Pull cache
73-
uses: actions/cache@v1
74-
id: podcache
73+
uses: actions/cache@v2
74+
id: podcache-tvos
7575
with:
7676
path: Examples/Pods
7777
key: ${{ runner.os }}pods${{ hashFiles('**/Podfile.lock') }}
7878
restore-keys: |
7979
${{ runner.os }}pods
8080
- name: Install pods
81-
if: steps.podcache.outputs.cache-hit != 'true'
81+
if: steps.podcache-tvos.outputs.cache-hit != 'true'
8282
run: pod install --project-directory=Examples
8383
- name: Test
8484
run: fastlane scan --workspace "Examples/RswiftExamples.xcworkspace" --scheme "ResourceApp-tvOS"
8585

8686
build:
87-
runs-on: macos-latest
87+
runs-on: macos-11
8888
steps:
8989
- name: Checkout
9090
uses: actions/checkout@v2
9191
- name: Pull cache
92-
uses: actions/cache@v1
92+
uses: actions/cache@v2
9393
with:
9494
path: .build
9595
key: ${{ runner.os }}spm${{ hashFiles('**/Package.resolved') }}

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ on:
55
types: created
66

77
env:
8-
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
8+
DEVELOPER_DIR: /Applications/Xcode_12.5.app/Contents/Developer
99

1010
jobs:
1111
release-build:
12-
runs-on: macos-latest
12+
runs-on: macos-11
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v2
8.86 KB
Loading
-93.5 KB
Binary file not shown.

Documentation/Migration.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,26 @@
22

33
Pointers for migration between major versions.
44

5+
## Upgrading to 6.0
6+
7+
- In the Build Phase, some changes are needed, [see an example screenshot](Images/BuildPhaseExample.png):
8+
* Uncheck "Based on dependency analysis" so that R.swift is run on each build
9+
* Remove `$TEMP_DIR/rswift-lastrun` from the "Input Files" of the Build Phase
10+
* Keep `$SRCROOT/[YOUR_PATH]/R.generated.swift` in the "Output Files" of the Build Phase unchanged
11+
512
## Upgrading to 5.0
613

714
- Make sure you use Xcode 10 since we've adjusted to the SDK changes
815
- At the moment we are compatible with both Swift 4 and 4.2, this is more an accident then a feature, beware that we might drop Swift 4 support anytime.
916

1017
If you are using the "New Build System":
11-
- In the Build Phase you must perform some changes, [see an example screenshot](Images/BuildPhaseExample.png):
18+
- In the Build Phase you must perform some changes:
1219
* Change the script to give the explicit output file, for example: `"$PODS_ROOT/R.swift/rswift" generate "$SRCROOT/[YOUR_PATH]/R.generated.swift"`
1320
* Add `$TEMP_DIR/rswift-lastrun` to the "Input Files" of the Build Phase
1421
* Add `$SRCROOT/[YOUR_PATH]/R.generated.swift` to the "Output Files" of the Build Phase
1522

1623
If you are using the "Legacy Build System":
17-
- Add the flag `--disable-input-output-files-validation` and *do not* add input/output files to the Build Phase, [See an example screenshot](Images/BuildPhaseExample_LegacyBuildSystem.png).
24+
- Add the flag `--disable-input-output-files-validation` and *do not* add input/output files to the Build Phase.
1825

1926
## Upgrading to 4.0
2027

Examples/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ SPEC CHECKSUMS:
2525

2626
PODFILE CHECKSUM: f469d71063f69d445c904540c317082849a4d112
2727

28-
COCOAPODS: 1.10.0
28+
COCOAPODS: 1.11.2

Examples/ResourceApp/ResourceApp.xcodeproj/project.pbxproj

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -715,11 +715,11 @@
715715
};
716716
D55C6CED1B5E172900301B0D /* R.swift */ = {
717717
isa = PBXShellScriptBuildPhase;
718+
alwaysOutOfDate = 1;
718719
buildActionMask = 2147483647;
719720
files = (
720721
);
721722
inputPaths = (
722-
"$(TEMP_DIR)/rswift-lastrun",
723723
);
724724
name = R.swift;
725725
outputPaths = (
@@ -978,7 +978,10 @@
978978
DEVELOPMENT_TEAM = "";
979979
INFOPLIST_FILE = ResourceApp/Info.plist;
980980
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
981-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
981+
LD_RUNPATH_SEARCH_PATHS = (
982+
"$(inherited)",
983+
"@executable_path/Frameworks",
984+
);
982985
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.$(PRODUCT_NAME:rfc1034identifier)";
983986
PRODUCT_NAME = "$(TARGET_NAME)";
984987
SWIFT_VERSION = 5.0;
@@ -993,10 +996,14 @@
993996
DEVELOPMENT_TEAM = "";
994997
INFOPLIST_FILE = ResourceApp/Info.plist;
995998
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
996-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
999+
LD_RUNPATH_SEARCH_PATHS = (
1000+
"$(inherited)",
1001+
"@executable_path/Frameworks",
1002+
);
9971003
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.$(PRODUCT_NAME:rfc1034identifier)";
9981004
PRODUCT_NAME = "$(TARGET_NAME)";
999-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
1005+
SWIFT_COMPILATION_MODE = wholemodule;
1006+
SWIFT_OPTIMIZATION_LEVEL = "-O";
10001007
SWIFT_VERSION = 5.0;
10011008
};
10021009
name = Release;
@@ -1012,7 +1019,11 @@
10121019
"$(inherited)",
10131020
);
10141021
INFOPLIST_FILE = ResourceAppTests/Info.plist;
1015-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1022+
LD_RUNPATH_SEARCH_PATHS = (
1023+
"$(inherited)",
1024+
"@executable_path/Frameworks",
1025+
"@loader_path/Frameworks",
1026+
);
10161027
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.$(PRODUCT_NAME:rfc1034identifier)";
10171028
PRODUCT_NAME = "$(TARGET_NAME)";
10181029
SWIFT_VERSION = 5.0;
@@ -1027,10 +1038,15 @@
10271038
BUNDLE_LOADER = "$(TEST_HOST)";
10281039
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
10291040
INFOPLIST_FILE = ResourceAppTests/Info.plist;
1030-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1041+
LD_RUNPATH_SEARCH_PATHS = (
1042+
"$(inherited)",
1043+
"@executable_path/Frameworks",
1044+
"@loader_path/Frameworks",
1045+
);
10311046
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.$(PRODUCT_NAME:rfc1034identifier)";
10321047
PRODUCT_NAME = "$(TARGET_NAME)";
1033-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
1048+
SWIFT_COMPILATION_MODE = wholemodule;
1049+
SWIFT_OPTIMIZATION_LEVEL = "-O";
10341050
SWIFT_VERSION = 5.0;
10351051
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ResourceApp.app/ResourceApp";
10361052
};

Examples/RswiftUI/RswiftUI.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 52;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -267,13 +267,13 @@
267267
/* Begin PBXShellScriptBuildPhase section */
268268
E2CD1B012510E593000ACEFB /* R.swift */ = {
269269
isa = PBXShellScriptBuildPhase;
270+
alwaysOutOfDate = 1;
270271
buildActionMask = 2147483647;
271272
files = (
272273
);
273274
inputFileListPaths = (
274275
);
275276
inputPaths = (
276-
"$TEMP_DIR/rswift-lastrun",
277277
);
278278
name = R.swift;
279279
outputFileListPaths = (
@@ -287,13 +287,13 @@
287287
};
288288
E2CD1B052510EF53000ACEFB /* R.swift */ = {
289289
isa = PBXShellScriptBuildPhase;
290+
alwaysOutOfDate = 1;
290291
buildActionMask = 2147483647;
291292
files = (
292293
);
293294
inputFileListPaths = (
294295
);
295296
inputPaths = (
296-
"$TEMP_DIR/rswift-lastrun",
297297
);
298298
name = R.swift;
299299
outputFileListPaths = (

Examples/RtvApp/RtvApp.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 52;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -235,11 +235,11 @@
235235
/* Begin PBXShellScriptBuildPhase section */
236236
DEF559A61CA487D6009B8C51 /* R.swift */ = {
237237
isa = PBXShellScriptBuildPhase;
238+
alwaysOutOfDate = 1;
238239
buildActionMask = 2147483647;
239240
files = (
240241
);
241242
inputPaths = (
242-
"$(TEMP_DIR)/rswift-lastrun",
243243
);
244244
name = R.swift;
245245
outputPaths = (

Examples/RwatchApp/RwatchApp.xcodeproj/project.pbxproj

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -290,13 +290,13 @@
290290
};
291291
2F5FBC5B21355F2000A83A69 /* R.swift */ = {
292292
isa = PBXShellScriptBuildPhase;
293+
alwaysOutOfDate = 1;
293294
buildActionMask = 2147483647;
294295
files = (
295296
);
296297
inputFileListPaths = (
297298
);
298299
inputPaths = (
299-
"$(TEMP_DIR)/rswift-lastrun",
300300
);
301301
name = R.swift;
302302
outputFileListPaths = (
@@ -387,7 +387,11 @@
387387
DEBUG_INFORMATION_FORMAT = dwarf;
388388
GCC_C_LANGUAGE_STANDARD = gnu11;
389389
INFOPLIST_FILE = "ResourceApp-watchOS-Extension/Info.plist";
390-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
390+
LD_RUNPATH_SEARCH_PATHS = (
391+
"$(inherited)",
392+
"@executable_path/Frameworks",
393+
"@executable_path/../../Frameworks",
394+
);
391395
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
392396
MTL_FAST_MATH = YES;
393397
PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.ResourceApp.watchkitapp.watchkitextension;
@@ -415,13 +419,18 @@
415419
CODE_SIGN_STYLE = Automatic;
416420
GCC_C_LANGUAGE_STANDARD = gnu11;
417421
INFOPLIST_FILE = "ResourceApp-watchOS-Extension/Info.plist";
418-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
422+
LD_RUNPATH_SEARCH_PATHS = (
423+
"$(inherited)",
424+
"@executable_path/Frameworks",
425+
"@executable_path/../../Frameworks",
426+
);
419427
MTL_FAST_MATH = YES;
420428
PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.ResourceApp.watchkitapp.watchkitextension;
421429
PRODUCT_NAME = "${TARGET_NAME}";
422430
SDKROOT = watchos;
423431
SKIP_INSTALL = YES;
424-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
432+
SWIFT_COMPILATION_MODE = wholemodule;
433+
SWIFT_OPTIMIZATION_LEVEL = "-O";
425434
SWIFT_VERSION = 5.0;
426435
TARGETED_DEVICE_FAMILY = 4;
427436
WATCHOS_DEPLOYMENT_TARGET = 5.0;
@@ -479,7 +488,8 @@
479488
PRODUCT_NAME = "$(TARGET_NAME)";
480489
SDKROOT = watchos;
481490
SKIP_INSTALL = YES;
482-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
491+
SWIFT_COMPILATION_MODE = wholemodule;
492+
SWIFT_OPTIMIZATION_LEVEL = "-O";
483493
SWIFT_VERSION = 4.2;
484494
TARGETED_DEVICE_FAMILY = 4;
485495
WATCHOS_DEPLOYMENT_TARGET = 5.0;

0 commit comments

Comments
 (0)