Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ios,mac): support build on Apple Silicon using Xcode 15.3 #11302

Merged
merged 17 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ios/engine/KMEI/KeymanEngine.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env bash";
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n. \"$KEYMAN_ROOT/resources/build/xcode-utils.sh\"\n\nphaseSetBundleVersions true\n";
shellScript = "\"$KEYMAN_ROOT/resources/build/xcode-wrap.sh\" \"$KEYMAN_ROOT/resources/build/set-bundle-versions-tagged.sh\"\n";
showEnvVarsInLog = 0;
};
CEC0C66F2410B005003E1BCD /* Run Script - upload dsyms to Sentry */ = {
Expand Down
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 @@ -1002,7 +1002,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env bash";
shellScript = ". \"$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";
shellScript = "\"$KEYMAN_ROOT/resources/build/xcode-wrap.sh\" \"$KEYMAN_ROOT/resources/build/set-bundle-versions-and-settings.sh\"\n";
showEnvVarsInLog = 0;
};
CED3CFDA240E49DF001540A1 /* ShellScript */ = {
Expand All @@ -1020,7 +1020,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env bash";
shellScript = ". \"$KEYMAN_ROOT/resources/build/xcode-utils.sh\"\n\n# Calls resource script to update build products' versioning.\nphaseSetBundleVersions\n";
shellScript = "\"$KEYMAN_ROOT/resources/build/xcode-wrap.sh\" \"$KEYMAN_ROOT/resources/build/set-bundle-versions-untagged.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
6 changes: 4 additions & 2 deletions mac/Keyman4Mac/Keyman4Mac.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.13;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = org.sil.Keyman4Mac;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -425,7 +425,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = org.sil.Keyman4Mac;
PRODUCT_NAME = "$(TARGET_NAME)";
PRODUCT_VERSION = 0.0.1;
Expand All @@ -451,6 +451,7 @@
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Keyman4Mac.app/Contents/MacOS/Keyman4Mac";
};
Expand All @@ -471,6 +472,7 @@
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Keyman4Mac.app/Contents/MacOS/Keyman4Mac";
};
Expand Down
8 changes: 4 additions & 4 deletions mac/Keyman4MacIM/Keyman4MacIM.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.13;
ONLY_ACTIVE_ARCH = YES;
OTHER_CODE_SIGN_FLAGS = "--timestamp --verbose";
PRODUCT_BUNDLE_IDENTIFIER = "keyman.inputmethod.$(PRODUCT_NAME:rfc1034identifier)";
Expand Down Expand Up @@ -1358,7 +1358,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.13;
OTHER_CODE_SIGN_FLAGS = "--timestamp --verbose";
PRODUCT_BUNDLE_IDENTIFIER = "keyman.inputmethod.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1402,7 +1402,7 @@
"@loader_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = org.sil.consoleTestbed.KeymanTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1436,7 +1436,7 @@
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = org.sil.consoleTestbed.KeymanTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@
"$(PROJECT_DIR)/../../core/build/mac-x86_64/debug/subprojects/icu/source/i18n",
"$(PROJECT_DIR)/../../core/build/mac/debug",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.13;
ONLY_ACTIVE_ARCH = NO;
"OTHER_LDFLAGS[arch=*]" = "-lstdc++";
PRODUCT_BUNDLE_IDENTIFIER = org.sil.KeymanEngine4Mac;
Expand Down Expand Up @@ -728,7 +728,7 @@
"$(PROJECT_DIR)/../../core/build/mac-x86_64/release/subprojects/icu/source/i18n",
"$(PROJECT_DIR)/../../core/build/mac/release",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.13;
"OTHER_LDFLAGS[arch=*]" = "-lstdc++";
PRODUCT_BUNDLE_IDENTIFIER = org.sil.KeymanEngine4Mac;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -753,6 +753,7 @@
);
INFOPLIST_FILE = KeymanEngine4MacTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = "Tavultesoft.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
Expand All @@ -768,6 +769,7 @@
);
INFOPLIST_FILE = KeymanEngine4MacTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = "Tavultesoft.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
Expand Down
11 changes: 11 additions & 0 deletions resources/build/set-bundle-versions-and-settings.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#!/bin/bash
#!/usr/bin/env bash

We should be using env throughout to signify that we want the bash version from the path, even though we are attempting to run the scripts with the correct version of 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 true

setSettingsBundleVersion
7 changes: 7 additions & 0 deletions resources/build/set-bundle-versions-tagged.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/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

source "$KEYMAN_ROOT/resources/build/xcode-utils.sh"
phaseSetBundleVersions true
6 changes: 6 additions & 0 deletions resources/build/set-bundle-versions-untagged.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Calls script in xcode-utils to update the version

source "$KEYMAN_ROOT/resources/build/xcode-utils.sh"
phaseSetBundleVersions
11 changes: 11 additions & 0 deletions resources/build/xcode-wrap.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see if we can move this to resources/build/mac as well A18S1

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

echo "wrap script for arch $(arch)"
if [[ $(arch) == i386 ]] && [[ -f /usr/local/bin/bash ]]; then
/usr/local/bin/bash -l "$@" || exit $?
elif [[ $(arch) == arm64 ]] && [[ -f /opt/homebrew/bin/bash ]]; then
/opt/homebrew/bin/bash -l "$@" || exit $?
else
>&2 echo "Could not start build due to missing homebrew bash"
exit 55
fi
2 changes: 1 addition & 1 deletion resources/devbox/macos/macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ which brew || (
## Install devchain components

BREW_ALL="bash jq python3 meson ninja coreutils pyenv"
BREW_WEB="node emscripten openjdk@8"
BREW_WEB="node emscripten"
BREW_IOS="swiftlint carthage"
BREW_MACOS="carthage cocoapods"
BREW_ANDROID="openjdk@8 android-sdk android-studio ant gradle maven"
Expand Down
Loading