Skip to content

Commit

Permalink
chore(ios): modify version scripts
Browse files Browse the repository at this point in the history
Wrap scripts for FirstVoices so that environment variables are retained
  • Loading branch information
sgschantz committed Apr 29, 2024
1 parent a59850e commit ec64a98
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 12 deletions.
4 changes: 2 additions & 2 deletions ios/keyman/Keyman/Keyman.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env bash";
shellScript = "verstr1=$(/usr/libexec/PlistBuddy -c \"Print CFBundleShortVersionString\" \"$SRCROOT/Keyman-Info.plist\")\nverstr2=$(/usr/libexec/PlistBuddy -c \"Print CFBundleVersion\" \"$SRCROOT/Keyman-Info.plist\")\n/usr/libexec/PlistBuddy \"$SRCROOT/Settings.bundle/Root.plist\" -c \"set PreferenceSpecifiers:0:DefaultValue $verstr1 (build $verstr2)\"\n\nif which swiftlint >/dev/null; then\n swiftlint --config ../../.swiftlint.yml\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
shellScript = "#verstr1=$(/usr/libexec/PlistBuddy -c \"Print CFBundleShortVersionString\" \"$SRCROOT/Keyman-Info.plist\")\n#verstr2=$(/usr/libexec/PlistBuddy -c \"Print CFBundleVersion\" \"$SRCROOT/Keyman-Info.plist\")\n#/usr/libexec/PlistBuddy \"$SRCROOT/Settings.bundle/Root.plist\" -c \"set PreferenceSpecifiers:0:DefaultValue $verstr1 (build $verstr2)\"\n\nif which swiftlint >/dev/null; then\n swiftlint --config ../../.swiftlint.yml\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
showEnvVarsInLog = 0;
};
CE002CB32408B372002026CE /* Run Script - upload dsyms to sentry */ = {
Expand Down Expand Up @@ -1002,7 +1002,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env bash";
shellScript = "\"$KEYMAN_ROOT/resources/build/xcode-wrap.sh\" \"$KEYMAN_ROOT/resources/build/set-bundle-versions-and-settings.sh\"\n";
shellScript = "\"$KEYMAN_ROOT/resources/build/xcode-wrap.sh\" \"$KEYMAN_ROOT/resources/build/set-bundle-versions-and-settings-tagged.sh\"\n";
showEnvVarsInLog = 0;
};
CED3CFDA240E49DF001540A1 /* ShellScript */ = {
Expand Down
12 changes: 6 additions & 6 deletions oem/firstvoices/ios/FirstVoices.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,8 @@
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = ". \"$KEYMAN_ROOT/resources/build/xcode-utils.sh\"\n\n# Calls resource script to update build products' versioning.\nphaseSetBundleVersions\n";
shellPath = "/usr/bin/env bash";
shellScript = "\"$KEYMAN_ROOT/resources/build/xcode-wrap.sh\" \"$KEYMAN_ROOT/resources/build/set-bundle-versions-untagged.sh\"\n";
showEnvVarsInLog = 0;
};
37DF007C24595F6F00C73128 /* ShellScript */ = {
Expand All @@ -457,8 +457,8 @@
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\n. \"$KEYMAN_ROOT/resources/build/xcode-utils.sh\"\n\n# Calls resource script to update build products' versioning.\n# true: applies VERSION_WITH_TAG to custom KeymanVersionWithTag plist member used for in-app display\nphaseSetBundleVersions true\n\n# Also updates the version string for Settings\nsetSettingsBundleVersion\n";
shellPath = "/usr/bin/env bash";
shellScript = "\"$KEYMAN_ROOT/resources/build/xcode-wrap.sh\" \"$KEYMAN_ROOT/resources/build/set-bundle-versions-and-settings-untagged.sh\"\n";
showEnvVarsInLog = 0;
};
9800EC5D1C029FCD00BF0FB5 /* ShellScript */ = {
Expand All @@ -471,8 +471,8 @@
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "verstr1=$(/usr/libexec/PlistBuddy -c \"Print CFBundleShortVersionString\" \"$SRCROOT/FirstVoices/Info.plist\")\nverstr2=$(/usr/libexec/PlistBuddy -c \"Print CFBundleVersion\" \"$SRCROOT/FirstVoices/Info.plist\")\n/usr/libexec/PlistBuddy \"$SRCROOT/Settings.bundle/Root.plist\" -c \"set PreferenceSpecifiers:0:DefaultValue $verstr1 (build $verstr2)\"\n";
shellPath = "/usr/bin/env bash";
shellScript = "#verstr1=$(/usr/libexec/PlistBuddy -c \"Print CFBundleShortVersionString\" \"$SRCROOT/FirstVoices/Info.plist\")\n#verstr2=$(/usr/libexec/PlistBuddy -c \"Print CFBundleVersion\" \"$SRCROOT/FirstVoices/Info.plist\")\n#/usr/libexec/PlistBuddy \"$SRCROOT/Settings.bundle/Root.plist\" -c \"set PreferenceSpecifiers:0:DefaultValue $verstr1 (build $verstr2)\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Calls script in xcode-utils to update the version
# true: applies VERSION_WITH_TAG to custom KeymanVersionWithTag plist member used for in-app display
Expand Down
11 changes: 11 additions & 0 deletions resources/build/set-bundle-versions-and-settings-untagged.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

# Calls script in xcode-utils to update the version
# true: applies VERSION_WITH_TAG to custom KeymanVersionWithTag plist member used for in-app display
# updates the version string for Settings

source "$KEYMAN_ROOT/resources/build/xcode-utils.sh"

phaseSetBundleVersions

setSettingsBundleVersion
2 changes: 1 addition & 1 deletion resources/build/set-bundle-versions-tagged.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Calls script in xcode-utils to update the version
# true: applies VERSION_WITH_TAG to custom KeymanVersionWithTag plist member used for in-app display
Expand Down
2 changes: 1 addition & 1 deletion resources/build/set-bundle-versions-untagged.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Calls script in xcode-utils to update the version

Expand Down
2 changes: 2 additions & 0 deletions resources/build/xcode-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# - echo "warning: foo" will generate an actual compile warning within Xcode: "foo"
# - echo "error: bar" will likewise generate a compile error within Xcode: "bar"

set -eu

function buildWarning() {
echo "warning: $1"
}
Expand Down
2 changes: 1 addition & 1 deletion resources/build/xcode-wrap.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

echo "wrap script for arch $(arch)"
if [[ $(arch) == i386 ]] && [[ -f /usr/local/bin/bash ]]; then
Expand Down

0 comments on commit ec64a98

Please sign in to comment.