Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/mac-cain13/R.swift into m…
Browse files Browse the repository at this point in the history
…ac-cain13-master

# Conflicts:
#	Sources/RswiftCore/CallInformation.swift
#	Sources/rswift/main.swift
  • Loading branch information
maciejpiotrowski89 committed Nov 30, 2021
2 parents 454cd75 + 41ef672 commit 9ea44ad
Show file tree
Hide file tree
Showing 21 changed files with 414 additions and 199 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_11.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
18 changes: 10 additions & 8 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_11.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 All @@ -33,24 +33,26 @@ jobs:
asset_name: rswift-${{ github.event.release.tag_name }}-source.tar.gz
asset_content_type: application/tar+gzip

- name: Build
run: swift build -v -c release
- name: Build fat binary
run: |
swift build -c release --arch x86_64 --arch arm64
- name: Import Signing Certificates
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.APPLE_CERTS }}
p12-password: ${{ secrets.APPLE_CERTS_PASSWORD }}
- name: Code Sign
run: |
codesign --force --options runtime --sign 'Developer ID Application: Mathijs Kadijk (5Z49PA849J)' .build/release/rswift
codesign --force --options runtime --sign 'Developer ID Application: Mathijs Kadijk (5Z49PA849J)' .build/apple/Products/Release/rswift
- name: Store build artifact
uses: actions/upload-artifact@v1
with:
name: rswift-${{ github.event.release.tag_name }}
path: .build/release/rswift
path: .build/apple/Products/Release/rswift

- name: Archive ZIP
run: zip --junk-paths ${{ runner.temp }}/rswift-${{ github.event.release.tag_name }}.zip .build/release/rswift License
run: zip --junk-paths ${{ runner.temp }}/rswift-${{ github.event.release.tag_name }}.zip .build/apple/Products/Release/rswift License
- name: Notarize ZIP
run: |
sh notarize.sh
Expand Down Expand Up @@ -81,7 +83,7 @@ jobs:
- name: Archive PKG
run: |
mkdir -p $PKG_ROOT/$BINARY_ROOT
cp .build/release/rswift $PKG_ROOT/$BINARY_ROOT
cp .build/apple/Products/Release/rswift $PKG_ROOT/$BINARY_ROOT
pkgbuild --root $PKG_ROOT --identifier "nl.mathijskadijk.rswift" --version $TAG_NAME --install-location "/" --sign "Developer ID Installer: Mathijs Kadijk (5Z49PA849J)" $FILENAME
env:
TAG_NAME: ${{ github.event.release.tag_name }}
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: 9ec20617b14d9852e3692e3fc8e47cdda4abbb32

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
Loading

0 comments on commit 9ea44ad

Please sign in to comment.