Skip to content

Commit

Permalink
Merge pull request #11329 from keymanapp/chore/common/11324-this-scri…
Browse files Browse the repository at this point in the history
…pt-path

chore(common): maintenance on build scripts - cd
  • Loading branch information
mcdurdin authored May 3, 2024
2 parents acb23e8 + 50bcfa4 commit c997965
Show file tree
Hide file tree
Showing 104 changed files with 241 additions and 489 deletions.
9 changes: 1 addition & 8 deletions android/KMAPro/build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
#!/usr/bin/env bash
# Build Keyman for Android app (KMAPro)

# set -x
set -eu

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
. "$KEYMAN_ROOT/resources/build/build-help.inc.sh"
. "$KEYMAN_ROOT/resources/build/build-download-resources.sh"

# This script runs from its own folder
cd "$THIS_SCRIPT_PATH"

# ################################ Main script ################################

# Definition of global compile constants
Expand Down
9 changes: 1 addition & 8 deletions android/KMEA/build.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
#!/usr/bin/env bash
# Build Keyman Engine for Android using Keyman Web artifacts
#

#set -x
set -eu

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"

# This script runs from its own folder
cd "$THIS_SCRIPT_PATH"

# ################################ Main script ################################

# Definition of global compile constants
Expand Down
10 changes: 1 addition & 9 deletions android/Samples/KMSample1/build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
#!/usr/bin/env bash
#
# Samples: KMsample1

set -eu
# set -x: Debugging use, print each statement
# set -x

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"

# This script runs from its own folder
cd "$THIS_SCRIPT_PATH"

################################ Main script ################################

# Definition of global compile constants
Expand Down
10 changes: 1 addition & 9 deletions android/Samples/KMSample2/build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
#!/usr/bin/env bash
#
# Samples: KMSample2

set -eu
# set -x: Debugging use, print each statement
# set -x

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"

# This script runs from its own folder
cd "$THIS_SCRIPT_PATH"

################################ Main script ################################

# Definition of global compile constants
Expand Down
11 changes: 2 additions & 9 deletions android/Tests/KeyboardHarness/build.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
#!/usr/bin/env bash
#
# Build Test app: KeyboardHarness

#set -x
set -eu

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"

# This script runs from its own folder
cd "$THIS_SCRIPT_PATH"

################################ Main script ################################

# Definition of global compile constants
Expand All @@ -32,7 +25,7 @@ builder_describe "Build KeyboardHarness test app for Android." \
":app KeyboardHarness" \
"--ci Don't start the Gradle daemon. Use for CI"

# parse before describe outputs to check debug flags
# parse before describe outputs to check debug flags
builder_parse "$@"

ARTIFACT="app-release-unsigned.apk"
Expand Down
9 changes: 1 addition & 8 deletions android/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@
#
# Build Keyman Engine for Android, Keyman for Android, OEM FirstVoices Android app,
# Samples: KMsample1 and KMSample2, Test - KeyboardHarness

#set -x
set -eu

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"

# This script runs from its own folder
cd "$THIS_SCRIPT_PATH"

################################ Main script ################################

builder_describe \
Expand Down
2 changes: 1 addition & 1 deletion common/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

builder_describe "Keyman common and resources modules" \
Expand Down
8 changes: 1 addition & 7 deletions common/include/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@
#
# Creates keymanversion_build.h
#

# Exit on command failure and when using unset variables:
set -eu

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

cd "$THIS_SCRIPT_PATH"

builder_describe "Build keymanversion_build.h" configure build clean

builder_describe_outputs \
Expand Down
12 changes: 6 additions & 6 deletions common/linux/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

if [[ $BUILDER_OS != linux ]]; then
builder_echo grey "Platform is not linux; skipping common/linux"
exit 0
fi

#
# TODO: when we have linux-specific tests, add them here
# as child modules
Expand All @@ -23,6 +18,11 @@ builder_describe "Keyman common Linux modules" \

builder_parse "$@"

if [[ $BUILDER_OS != linux ]]; then
builder_echo grey "Platform is not linux; skipping common/linux"
exit 0
fi

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

builder_run_child_actions clean configure build test
12 changes: 6 additions & 6 deletions common/mac/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

if [[ $BUILDER_OS != mac ]]; then
builder_echo grey "Platform is not macOS; skipping common/mac"
exit 0
fi

#
# TODO: when we have mac-specific tests, add them here
# as child modules
Expand All @@ -23,6 +18,11 @@ builder_describe "Keyman common mac modules" \

builder_parse "$@"

if [[ $BUILDER_OS != mac ]]; then
builder_echo grey "Platform is not macOS; skipping common/mac"
exit 0
fi

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

builder_run_child_actions clean configure build test
9 changes: 2 additions & 7 deletions common/models/templates/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@
#
# Compile our sourcemap-path remapping module for use by Web builds, releases, etc.
#
set -eu

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")"
. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh"
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "$(dirname "$THIS_SCRIPT")/../../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"

# This script runs from its own folder
cd "$(dirname "$THIS_SCRIPT")"

################################ Main script ################################

builder_describe "Builds the predictive-text model template implementation module" \
Expand Down
8 changes: 1 addition & 7 deletions common/models/types/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@
#
# Packages the @keymanapp/models-types package.
#

# Exit on command failure and when using unset variables:
set -eu

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

cd "$THIS_SCRIPT_PATH"

. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"


Expand Down
9 changes: 2 additions & 7 deletions common/models/wordbreakers/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@
#
# Compile our sourcemap-path remapping module for use by Web builds, releases, etc.
#
set -eu

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")"
. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh"
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "$(dirname "$THIS_SCRIPT")/../../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"

# This script runs from its own folder
cd "$(dirname "$THIS_SCRIPT")"

################################ Main script ################################

builder_describe "Builds the predictive-text wordbreaker implementation module" \
Expand Down
9 changes: 1 addition & 8 deletions common/predictive-text/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,16 @@
# Compiles the Language Modeling Layer for common use in predictive text and autocorrective applications.
# Designed for optimal compatibility with the Keyman Suite.
#

# Exit on command failure and when using unset variables:
set -eu

# Include some helper functions from resources

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"

# This script runs from its own folder
cd "$(dirname "$THIS_SCRIPT")"

BUNDLE_CMD="node $KEYMAN_ROOT/common/web/es-bundling/build/common-bundle.mjs"

################################ Main script ################################
Expand Down
4 changes: 1 addition & 3 deletions common/test/keyboards/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

cd "$THIS_SCRIPT_PATH"

targets=()
# Build list of available targets from subfolders, if none specified
for d in */; do
Expand Down
3 changes: 0 additions & 3 deletions common/test/keyboards/issue/6254-invalid-version-99/build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env bash

set -e
set -u

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
Expand Down
5 changes: 1 addition & 4 deletions common/tools/hextobin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"

# This script runs from its own folder
cd "$THIS_SCRIPT_PATH"

################################ Main script ################################

builder_describe "Build hextobin" clean configure build
Expand Down
9 changes: 1 addition & 8 deletions common/tools/sourcemap-path-remapper/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@
# Compiles the JS sourcemap remapper tool used by some of our TS projects when complications
# arise with sourcemap handling.
#

# Exit on command failure and when using unset variables:
set -eu

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
. "${THIS_SCRIPT%/*}/../../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"

# This script runs from its own folder
cd "$THIS_SCRIPT_PATH"

################################ Main script ################################

builder_describe "Builds a sourcemap manipulation ES module for use in Web-related builds" \
Expand Down
Loading

0 comments on commit c997965

Please sign in to comment.