From 4e878664d41488471a98e36b76499c5df6afe96f Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 23 Jun 2021 06:15:53 +1000 Subject: [PATCH] docs: address review comments * Move old notes into an old/ folder to clarify their pending removal and add a note to the top of each file. * Cleanup macos.sh script to fix various issues. --- docs/build/index.md | 12 +-- docs/build/{ => old}/android-notes.md | 4 +- docs/build/{ => old}/core-desktop-notes.md | 2 + docs/build/{ => old}/ios-notes.md | 2 + docs/build/{ => old}/macos-notes.md | 2 + docs/build/{ => old}/web-notes.md | 2 + .../{sentry-cli-notes.md => sentry-cli.md} | 0 resources/devbox/macos/macos.sh | 93 ++++++++++++++----- 8 files changed, 89 insertions(+), 28 deletions(-) rename docs/build/{ => old}/android-notes.md (95%) rename docs/build/{ => old}/core-desktop-notes.md (98%) rename docs/build/{ => old}/ios-notes.md (91%) rename docs/build/{ => old}/macos-notes.md (86%) rename docs/build/{ => old}/web-notes.md (86%) rename docs/build/{sentry-cli-notes.md => sentry-cli.md} (100%) diff --git a/docs/build/index.md b/docs/build/index.md index c001d6a8f9..bca0627234 100644 --- a/docs/build/index.md +++ b/docs/build/index.md @@ -12,14 +12,14 @@ Keyman has a wide range of dependencies. We are working to reduce the complexity Additional notes are available in the following documents: -* [sentry-cli notes](sentry-cli-notes.md) +* [sentry-cli configuration](sentry-cli.md) Older notes: -* [Keyman for Android notes](android-notes.md) -* [Keyman for iOS notes](ios-notes.md) -* [Keyman for macOS notes](macos-notes.md) -* [KeymanWeb notes](web-notes.md) -* [Keyman Core Desktop notes](core-desktop-notes.md) +* [Keyman for Android notes](old/android-notes.md) +* [Keyman for iOS notes](old/ios-notes.md) +* [Keyman for macOS notes](old/macos-notes.md) +* [KeymanWeb notes](old/web-notes.md) +* [Keyman Core Desktop notes](old/core-desktop-notes.md) Many folders may also contain other build instructions in README.md files. diff --git a/docs/build/android-notes.md b/docs/build/old/android-notes.md similarity index 95% rename from docs/build/android-notes.md rename to docs/build/old/android-notes.md index b3e0dd8ad3..512044b881 100644 --- a/docs/build/android-notes.md +++ b/docs/build/old/android-notes.md @@ -1,7 +1,9 @@ # Keyman for Android configuration notes +WARNING: these are old configuration notes. See [index.md](../index.md) for current steps. + * Android Studio 4.1+ -* Java SE Development Kit 8 +* Java SE Development Kit 8 * [Node.js](https://nodejs.org/) 14.17+ (for building KeymanWeb) * [Pandoc](#Install-Pandoc) for generating offline help diff --git a/docs/build/core-desktop-notes.md b/docs/build/old/core-desktop-notes.md similarity index 98% rename from docs/build/core-desktop-notes.md rename to docs/build/old/core-desktop-notes.md index dc5f6ea9f9..4eceb94fd0 100644 --- a/docs/build/core-desktop-notes.md +++ b/docs/build/old/core-desktop-notes.md @@ -1,5 +1,7 @@ # Common/Core/Desktop configuration notes +WARNING: these are old configuration notes. See [index.md](../index.md) for current steps. + - Bash (for Windows, included with Git for Windows) - Python 3 - Meson build system 0.45+ (0.56+ for WASM) diff --git a/docs/build/ios-notes.md b/docs/build/old/ios-notes.md similarity index 91% rename from docs/build/ios-notes.md rename to docs/build/old/ios-notes.md index 33f772b624..47fd967f0e 100644 --- a/docs/build/ios-notes.md +++ b/docs/build/old/ios-notes.md @@ -1,5 +1,7 @@ # Keyman for iOS configuration notes +WARNING: these are old configuration notes. See [macos.md](../macos.md) for current steps. + ## Prerequisites * Xcode 11 * iOS 9+ diff --git a/docs/build/macos-notes.md b/docs/build/old/macos-notes.md similarity index 86% rename from docs/build/macos-notes.md rename to docs/build/old/macos-notes.md index 234e5be167..77a83bd038 100644 --- a/docs/build/macos-notes.md +++ b/docs/build/old/macos-notes.md @@ -1,5 +1,7 @@ # Keyman for macOS configuration notes +WARNING: these are old configuration notes. See [macos.md](../macos.md) for current steps. + ## Mac Tools Requirements/Setup * Install [Homebrew] *technically optional, but highly recommended* diff --git a/docs/build/web-notes.md b/docs/build/old/web-notes.md similarity index 86% rename from docs/build/web-notes.md rename to docs/build/old/web-notes.md index 0dbc0d06ee..23ebf26d61 100644 --- a/docs/build/web-notes.md +++ b/docs/build/old/web-notes.md @@ -1,5 +1,7 @@ # KeymanWeb configuration notes +WARNING: these are old configuration notes. See [index.md](../index.md) for current steps. + ## Minimum Web Compilation Requirements * [Java 7+](https://adoptopenjdk.net/releases.html) (required by the Google Closure Compiler) diff --git a/docs/build/sentry-cli-notes.md b/docs/build/sentry-cli.md similarity index 100% rename from docs/build/sentry-cli-notes.md rename to docs/build/sentry-cli.md diff --git a/resources/devbox/macos/macos.sh b/resources/devbox/macos/macos.sh index b15a3be708..0ddc488443 100755 --- a/resources/devbox/macos/macos.sh +++ b/resources/devbox/macos/macos.sh @@ -22,54 +22,81 @@ REQUIRE_SENTRYCLI=false # Parse args shopt -s nocasematch +PARAMFOUND=false + +function print_help() { + echo "Usage: macos.sh targets" + echo " targets: one or more of: " + echo " android ios macos web all" + echo " optional targets:" + echo " kmcomp pandoc sentry-cli" + echo "Targets will automatically include dependency targets." +} + while [[ $# -gt 0 ]] ; do key="$1" case $key in --help) - echo "Usage: macos.sh targets" - echo " targets: one or more of: " - echo " android ios macos web all" - echo " optional targets:" - echo " kmcomp pandoc sentry-cli" + print_help + exit 0 ;; android) - $REQUIRE_ANDROID=true + REQUIRE_ANDROID=true + PARAMFOUND=true ;; ios) - $REQUIRE_IOS=true + REQUIRE_IOS=true + PARAMFOUND=true ;; macos) - $REQUIRE_MACOS=true + REQUIRE_MACOS=true + PARAMFOUND=true ;; web) - $REQUIRE_WEB=true + REQUIRE_WEB=true + PARAMFOUND=true ;; kmcomp) - $REQUIRE_KMCOMP=true + REQUIRE_KMCOMP=true + PARAMFOUND=true ;; pandoc) - $REQUIRE_PANDOC=true + REQUIRE_PANDOC=true + PARAMFOUND=true ;; sentry-cli) - $REQUIRE_SENTRYCLI=true + REQUIRE_SENTRYCLI=true + PARAMFOUND=true ;; all) REQUIRE_ANDROID=true REQUIRE_IOS=true REQUIRE_MACOS=true REQUIRE_WEB=true + PARAMFOUND=true ;; *) - echo "Error: unrecognised parameter. Use --help for help" + echo "Error: unrecognised parameter." + echo + print_help + exit 1 ;; esac shift done +if ! $PARAMFOUND; then + echo "Error: must have a target parameter" + echo + print_help + exit 1 +fi + # This script will configure your development environment from a bare metal mac install. It should be idempotent. echo "This script will configure your macOS computer to build Keyman, installing build tools and prerequisites." echo "You can also do this yourself following the notes in building.md." +echo read -p "Press ENTER to start install" if $REQUIRE_IOS || $REQUIRE_ANDROID; then @@ -95,7 +122,7 @@ which brew || ( ## Install devchain components BREW_ALL="bash jq python3 meson ninja rustup-init coreutils" -BREW_WEB="node emscripten wasm-pack" +BREW_WEB="node emscripten wasm-pack openjdk@8" BREW_IOS="swiftlint carthage" BREW_MACOS="carthage cocoapods" BREW_ANDROID="openjdk@8 android-sdk android-studio ant gradle maven" @@ -134,16 +161,40 @@ $REQUIRE_ANDROID && ( sdkmanager --licenses ) -($REQUIRE_IOS || $REQUIRE_MACOS) && ( - # Assumes that xcode is installed into normal path - # as otherwise we get only the command line tools which - # won't build with xcode - sudo xcode-select -s /Applications/Xcode.app -) +# For now, we won't run this step automatically +# as it may interfere with other dev environments +#($REQUIRE_IOS || $REQUIRE_MACOS) && ( +# # Assumes that xcode is installed into normal path +# # as otherwise we get only the command line tools which +# # won't build with xcode +# echo "Selecting default xcodebuild command line tools from /Applications/Xcode.app" +# sudo xcode-select -s /Applications/Xcode.app +#) -# Add macos.env.sh to ~/.bashrc +# Add keyman.macos.env.sh to ~/.bashrc +echo "Adding environment variables to ~/.bashrc..." if [ ! -f ~/.bashrc ] || `grep "keyman.macos.env.sh" ~/.bashrc 2>/dev/null`; then echo "source $THIS_DIR/keyman.macos.env.sh" >> ~/.bashrc fi +echo "Configuration has completed successfully." +echo + +if $REQUIRE_MACOS || $REQUIRE_IOS; then + echo "The following components must be installed manually:" + echo " * XCode" + echo +fi + +if $REQUIRE_MACOS || $REQUIRE_IOS || $REQUIRE_ANDROID; then + echo "The following components should be started manually after this script completes, in order to install" + echo "additional components:" + if $REQUIRE_MACOS || $REQUIRE_IOS; then + echo " * XCode" + fi + if $REQUIRE_ANDROID; then + echo " * Android Studio" + fi + echo +fi