Skip to content

Commit

Permalink
Merge pull request #12114 from keymanapp/feat/common/top-level-build.sh
Browse files Browse the repository at this point in the history
feat(common): add top-level build.sh
  • Loading branch information
mcdurdin authored Aug 9, 2024
2 parents 945da3d + 57d4aee commit 5708a25
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 6 deletions.
36 changes: 36 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

builder_describe "Keyman -- all projects" \
":common" \
":core" \
":android" \
":ios" \
":linux" \
":mac" \
":web" \
":windows" \
":developer" \
clean \
configure \
build \
test \
install \
publish

builder_describe_platform \
:android android-studio \
:ios mac \
:linux linux \
:mac mac \
:windows win

builder_parse "$@"

#-------------------------------------------------------------------------------------------------------------------

builder_run_child_actions clean configure build test publish install
9 changes: 5 additions & 4 deletions resources/build/builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,12 +586,13 @@ Multiple targets can be listed. Each target must be followed by a comma
separated list of platforms. The currently supported platforms are:

Operating System platforms:
* `win`: Windows
* `mac`: macOS
* `linux`: Linux
* `win`: Windows
* `mac`: macOS
* `linux`: Linux

Development tooling platforms:
* `delphi`: (On Windows only, Delphi is installed)
* `delphi`: Delphi is installed (Windows only)
* `android-studio`: Android Studio is installed (`$ANDROID_HOME` variable)

Targets not specified will be built on all platforms.

Expand Down
12 changes: 10 additions & 2 deletions resources/builder.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1945,12 +1945,13 @@ _builder_has_function_been_called() {
# linux Linux
#
# Development tooling platforms:
# delphi (On Windows only, Delphi is installed)
# delphi Delphi is installed (on Windows only)
# android Android Studio is installed
#
builder_describe_platform() {

local builder_platforms=(linux mac win)
local builder_tools=(delphi)
local builder_tools=(android-studio delphi)

# --- Detect platform ---

Expand Down Expand Up @@ -1978,6 +1979,13 @@ builder_describe_platform() {
fi
fi

# Detect Android Studio based on ANDROID_HOME environment variable
if [[ ! -z ${ANDROID_HOME+x} ]]; then
builder_installed_tools+=(android-studio)
fi

# --- Overrides ---

# For testing, we can override the current platform
if [[ ! -z "${BUILDER_PLATFORM_OVERRIDE+x}" ]]; then
builder_warn "BUILDER_PLATFORM_OVERRIDE variable found. Overriding detected platform '$builder_platform' with '$BUILDER_PLATFORM_OVERRIDE'"
Expand Down

0 comments on commit 5708a25

Please sign in to comment.