Skip to content

Commit

Permalink
Swift from swiftgen SPM plugin to build phases scripts
Browse files Browse the repository at this point in the history
Unfortunatelly swiftgen SPM plugin has multiple issues with Xcode 15.
For now swiftgen execution must be switched to the build phase scripts.

Issues:
- SwiftGen/SwiftGenPlugin#14
- SwiftGen/SwiftGenPlugin#15
  • Loading branch information
Chlup committed Sep 22, 2023
1 parent df9a627 commit 9ff1a0d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 14 deletions.
6 changes: 1 addition & 5 deletions modules/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ let package = Package(
.package(url: "https://github.com/pointfreeco/swift-composable-architecture", from: "0.59.0"),
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "0.14.1"),
.package(url: "https://github.com/pointfreeco/swift-url-routing", from: "0.5.0"),
.package(url: "https://github.com/SwiftGen/SwiftGenPlugin", from: "6.6.0"),
.package(url: "https://github.com/zcash-hackworks/MnemonicSwift", from: "2.2.4"),
.package(url: "https://github.com/zcash/ZcashLightClientKit", from: "2.0.0-rc.1"),
.package(url: "https://github.com/firebase/firebase-ios-sdk", from: "10.11.0")
Expand Down Expand Up @@ -193,10 +192,7 @@ let package = Package(
),
.target(
name: "Generated",
resources: [.process("Resources")],
plugins: [
.plugin(name: "SwiftGenPlugin", package: "SwiftGenPlugin")
]
resources: [.process("Resources")]
),
.target(
name: "Home",
Expand Down
40 changes: 40 additions & 0 deletions secant.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@
buildConfigurationList = 0D26AF91299E8196005260EE /* Build configuration list for PBXNativeTarget "secant-mainnet" */;
buildPhases = (
0D26AE97299E8196005260EE /* Generate GoogleService-Info.plist */,
34968BEE2ABDC6FA0027F495 /* Swiftgen */,
0D26AE99299E8196005260EE /* SwiftLint */,
0D26AE9A299E8196005260EE /* Sources */,
0D26AF70299E8196005260EE /* Frameworks */,
Expand Down Expand Up @@ -639,6 +640,7 @@
buildConfigurationList = 0D4E7A2A26B364180058B01E /* Build configuration list for PBXNativeTarget "secant-testnet" */;
buildPhases = (
0D3B01ED298DB0FE007EBCDA /* Generate GoogleService-Info.plist */,
34968BED2ABDC6310027F495 /* Swiftgen */,
6696BA8726F0B1D200D5C875 /* SwiftLint */,
0D4E7A0126B364170058B01E /* Sources */,
0D4E7A0226B364170058B01E /* Frameworks */,
Expand Down Expand Up @@ -849,6 +851,44 @@
shellPath = /bin/zsh;
shellScript = "# this creates an empty file for the firebase SDK\n\necho \"Creating an empty file for the firebase SDK\"\n\nCRASH_REPORTER_FILE=\"./secant/Resources/GoogleService-Info.plist\"\nif [[ -f $CRASH_REPORTER_FILE ]]; then\n echo \"$CRASH_REPORTER_FILE Exists. Not doing anything.\"\nelse \n echo \"$CRASH_REPORTER_FILE does not exist. Will insert a DUMMY FILE\"\n\n echo \"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHBsaXN0IFBVQkxJQyAiLS8vQXBwbGUvL0RURCBQTElTVCAxLjAvL0VOIiAiaHR0cDovL3d3dy5hcHBsZS5jb20vRFREcy9Qcm9wZXJ0eUxpc3QtMS4wLmR0ZCI+CjxwbGlzdCB2ZXJzaW9uPSIxLjAiPgo8ZGljdD4KICAgIDxrZXk+SVNfRFVNTVlfRklMRTwva2V5PgogICAgPHRydWU+PC90cnVlPgo8L2RpY3Q+CjwvcGxpc3Q+Cg==\" | base64 --decode > $CRASH_REPORTER_FILE\nfi\n";
};
34968BED2ABDC6310027F495 /* Swiftgen */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = Swiftgen;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/zsh;
shellScript = "swiftgen_version=\"SwiftGen v6.6.2 (Stencil v0.15.1, StencilSwiftKit v2.10.1, SwiftGenKit v6.6.2)\"\n\nif which swiftgen >/dev/null; then\n if [[ $(swiftgen --version) != $swiftgen_version ]]; then\n echo \"warning: Compatible SwiftGen version not installed, download version $swiftgen_version. Currently installed version is $(swiftgen --version)\"\n fi\n \n echo \"Running swiftgen\" \n swiftgen config run --config modules/swiftgen.yml\nelse\n echo \"warning: swiftgen not installed\"\nfi\n";
};
34968BEE2ABDC6FA0027F495 /* Swiftgen */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = Swiftgen;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/zsh;
shellScript = "swiftgen_version=\"SwiftGen v6.6.2 (Stencil v0.15.1, StencilSwiftKit v2.10.1, SwiftGenKit v6.6.2)\"\n\nif which swiftgen >/dev/null; then\n if [[ $(swiftgen --version) != $swiftgen_version ]]; then\n echo \"warning: Compatible SwiftGen version not installed, download version $swiftgen_version. Currently installed version is $(swiftgen --version)\"\n fi\n \n echo \"Running swiftgen\" \n swiftgen config run --config modules/swiftgen.yml\nelse\n echo \"warning: swiftgen not installed\"\nfi\n";
};
6696BA8726F0B1D200D5C875 /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,6 @@
"version" : "0.5.0"
}
},
{
"identity" : "swiftgenplugin",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftGen/SwiftGenPlugin",
"state" : {
"revision" : "879b85a470cacd70c19e22eb7e11a3aed66f4068",
"version" : "6.6.2"
}
},
{
"identity" : "swiftui-navigation",
"kind" : "remoteSourceControl",
Expand Down

0 comments on commit 9ff1a0d

Please sign in to comment.