Skip to content

Commit 57d4aee

Browse files
committed
feat(common): add top-level build.sh
This top-level builder script will build as many projects as are possible to build on the current platform. For example, iOS and macOS projects can only be built on macOS; Windows and parts of Developer can only be built on Windows. Relates-to: #6268
1 parent c744cff commit 57d4aee

File tree

3 files changed

+51
-6
lines changed

3 files changed

+51
-6
lines changed

build.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
## START STANDARD BUILD SCRIPT INCLUDE
3+
# adjust relative paths as necessary
4+
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
5+
. "${THIS_SCRIPT%/*}/resources/build/builder.inc.sh"
6+
## END STANDARD BUILD SCRIPT INCLUDE
7+
8+
builder_describe "Keyman -- all projects" \
9+
":common" \
10+
":core" \
11+
":android" \
12+
":ios" \
13+
":linux" \
14+
":mac" \
15+
":web" \
16+
":windows" \
17+
":developer" \
18+
clean \
19+
configure \
20+
build \
21+
test \
22+
install \
23+
publish
24+
25+
builder_describe_platform \
26+
:android android-studio \
27+
:ios mac \
28+
:linux linux \
29+
:mac mac \
30+
:windows win
31+
32+
builder_parse "$@"
33+
34+
#-------------------------------------------------------------------------------------------------------------------
35+
36+
builder_run_child_actions clean configure build test publish install

resources/build/builder.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,12 +586,13 @@ Multiple targets can be listed. Each target must be followed by a comma
586586
separated list of platforms. The currently supported platforms are:
587587

588588
Operating System platforms:
589-
* `win`: Windows
590-
* `mac`: macOS
591-
* `linux`: Linux
589+
* `win`: Windows
590+
* `mac`: macOS
591+
* `linux`: Linux
592592

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

596597
Targets not specified will be built on all platforms.
597598

resources/builder.inc.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,12 +1945,13 @@ _builder_has_function_been_called() {
19451945
# linux Linux
19461946
#
19471947
# Development tooling platforms:
1948-
# delphi (On Windows only, Delphi is installed)
1948+
# delphi Delphi is installed (on Windows only)
1949+
# android Android Studio is installed
19491950
#
19501951
builder_describe_platform() {
19511952

19521953
local builder_platforms=(linux mac win)
1953-
local builder_tools=(delphi)
1954+
local builder_tools=(android-studio delphi)
19541955

19551956
# --- Detect platform ---
19561957

@@ -1978,6 +1979,13 @@ builder_describe_platform() {
19781979
fi
19791980
fi
19801981

1982+
# Detect Android Studio based on ANDROID_HOME environment variable
1983+
if [[ ! -z ${ANDROID_HOME+x} ]]; then
1984+
builder_installed_tools+=(android-studio)
1985+
fi
1986+
1987+
# --- Overrides ---
1988+
19811989
# For testing, we can override the current platform
19821990
if [[ ! -z "${BUILDER_PLATFORM_OVERRIDE+x}" ]]; then
19831991
builder_warn "BUILDER_PLATFORM_OVERRIDE variable found. Overriding detected platform '$builder_platform' with '$BUILDER_PLATFORM_OVERRIDE'"

0 commit comments

Comments
 (0)