Skip to content

Commit

Permalink
Merge pull request #723 from mac-cain13/cli-support
Browse files Browse the repository at this point in the history
CLI support
  • Loading branch information
tomlokhorst authored Nov 18, 2021
2 parents 8607e84 + efa2cb3 commit 41ef672
Show file tree
Hide file tree
Showing 20 changed files with 406 additions and 202 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ on:
branches: '*'

env:
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_13.0.app/Contents/Developer

jobs:
unit-tests:
runs-on: macos-latest
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Pull cache
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}spm${{ hashFiles('**/Package.resolved') }}
Expand All @@ -26,7 +26,7 @@ jobs:
run: swift test -v

test-iOS:
runs-on: macos-latest
runs-on: macos-11
needs: build
steps:
- name: Checkout
Expand All @@ -41,21 +41,21 @@ jobs:
mv rswift-dev/rswift build/Debug/rswift
chmod +x build/Debug/rswift
- name: Pull cache
uses: actions/cache@v1
id: podcache
uses: actions/cache@v2
id: podcache-ios
with:
path: Examples/Pods
key: ${{ runner.os }}pods${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}pods
- name: Install pods
if: steps.podcache.outputs.cache-hit != 'true'
if: steps.podcache-ios.outputs.cache-hit != 'true'
run: pod install --project-directory=Examples
- name: Test
run: fastlane scan --workspace "Examples/RswiftExamples.xcworkspace" --scheme "ResourceApp"

test-tvOS:
runs-on: macos-latest
runs-on: macos-11
needs: build
steps:
- name: Checkout
Expand All @@ -70,26 +70,26 @@ jobs:
mv rswift-dev/rswift build/Debug/rswift
chmod +x build/Debug/rswift
- name: Pull cache
uses: actions/cache@v1
id: podcache
uses: actions/cache@v2
id: podcache-tvos
with:
path: Examples/Pods
key: ${{ runner.os }}pods${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}pods
- name: Install pods
if: steps.podcache.outputs.cache-hit != 'true'
if: steps.podcache-tvos.outputs.cache-hit != 'true'
run: pod install --project-directory=Examples
- name: Test
run: fastlane scan --workspace "Examples/RswiftExamples.xcworkspace" --scheme "ResourceApp-tvOS"

build:
runs-on: macos-latest
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Pull cache
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}spm${{ hashFiles('**/Package.resolved') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ on:
types: created

env:
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_12.5.app/Contents/Developer

jobs:
release-build:
runs-on: macos-latest
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
Binary file modified Documentation/Images/BuildPhaseExample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
11 changes: 9 additions & 2 deletions Documentation/Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,26 @@

Pointers for migration between major versions.

## Upgrading to 6.0

- In the Build Phase, some changes are needed, [see an example screenshot](Images/BuildPhaseExample.png):
* Uncheck "Based on dependency analysis" so that R.swift is run on each build
* Remove `$TEMP_DIR/rswift-lastrun` from the "Input Files" of the Build Phase
* Keep `$SRCROOT/[YOUR_PATH]/R.generated.swift` in the "Output Files" of the Build Phase unchanged

## Upgrading to 5.0

- Make sure you use Xcode 10 since we've adjusted to the SDK changes
- 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.

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

If you are using the "Legacy Build System":
- 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).
- Add the flag `--disable-input-output-files-validation` and *do not* add input/output files to the Build Phase.

## Upgrading to 4.0

Expand Down
2 changes: 1 addition & 1 deletion Examples/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: f469d71063f69d445c904540c317082849a4d112

COCOAPODS: 1.10.0
COCOAPODS: 1.11.2
32 changes: 24 additions & 8 deletions Examples/ResourceApp/ResourceApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -715,11 +715,11 @@
};
D55C6CED1B5E172900301B0D /* R.swift */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(TEMP_DIR)/rswift-lastrun",
);
name = R.swift;
outputPaths = (
Expand Down Expand Up @@ -978,7 +978,10 @@
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = ResourceApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -993,10 +996,14 @@
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = ResourceApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
};
name = Release;
Expand All @@ -1012,7 +1019,11 @@
"$(inherited)",
);
INFOPLIST_FILE = ResourceAppTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -1027,10 +1038,15 @@
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = ResourceAppTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ResourceApp.app/ResourceApp";
};
Expand Down
6 changes: 3 additions & 3 deletions Examples/RswiftUI/RswiftUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -267,13 +267,13 @@
/* Begin PBXShellScriptBuildPhase section */
E2CD1B012510E593000ACEFB /* R.swift */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$TEMP_DIR/rswift-lastrun",
);
name = R.swift;
outputFileListPaths = (
Expand All @@ -287,13 +287,13 @@
};
E2CD1B052510EF53000ACEFB /* R.swift */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$TEMP_DIR/rswift-lastrun",
);
name = R.swift;
outputFileListPaths = (
Expand Down
4 changes: 2 additions & 2 deletions Examples/RtvApp/RtvApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -235,11 +235,11 @@
/* Begin PBXShellScriptBuildPhase section */
DEF559A61CA487D6009B8C51 /* R.swift */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(TEMP_DIR)/rswift-lastrun",
);
name = R.swift;
outputPaths = (
Expand Down
22 changes: 16 additions & 6 deletions Examples/RwatchApp/RwatchApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -290,13 +290,13 @@
};
2F5FBC5B21355F2000A83A69 /* R.swift */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$(TEMP_DIR)/rswift-lastrun",
);
name = R.swift;
outputFileListPaths = (
Expand Down Expand Up @@ -387,7 +387,11 @@
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "ResourceApp-watchOS-Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.ResourceApp.watchkitapp.watchkitextension;
Expand Down Expand Up @@ -415,13 +419,18 @@
CODE_SIGN_STYLE = Automatic;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "ResourceApp-watchOS-Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.ResourceApp.watchkitapp.watchkitextension;
PRODUCT_NAME = "${TARGET_NAME}";
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 5.0;
Expand Down Expand Up @@ -479,7 +488,8 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 5.0;
Expand Down
12 changes: 6 additions & 6 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@
"repositoryURL": "https://github.com/kylef/Commander.git",
"state": {
"branch": null,
"revision": "4b6133c3071d521489a80c38fb92d7983f19d438",
"version": "0.9.1"
"revision": "4a1f2fb82fb6cef613c4a25d2e38f702e4d812c2",
"version": "0.9.2"
}
},
{
"package": "Spectre",
"repositoryURL": "https://github.com/kylef/Spectre.git",
"state": {
"branch": null,
"revision": "f14ff47f45642aa5703900980b014c2e9394b6e5",
"version": "0.9.0"
"revision": "26cc5e9ae0947092c7139ef7ba612e34646086c7",
"version": "0.10.1"
}
},
{
"package": "XcodeEdit",
"repositoryURL": "https://github.com/tomlokhorst/XcodeEdit",
"state": {
"branch": null,
"revision": "dab519997ca05833470c88f0926b27498911ecbf",
"version": "2.7.7"
"revision": "99547c5af5850155b52c43b716ba1b094b02a3b2",
"version": "2.8.0"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/kylef/Commander.git", from: "0.8.0"),
.package(url: "https://github.com/tomlokhorst/XcodeEdit", from: "2.7.0")
.package(url: "https://github.com/tomlokhorst/XcodeEdit", from: "2.8.0")
],
targets: [
.target(name: "rswift", dependencies: ["RswiftCore"]),
Expand Down
Loading

0 comments on commit 41ef672

Please sign in to comment.