Previously we didn't show the description for the target if the target
definition specified a an alternate folder, e.g. `:app=src/app`. This
change fixes this.
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
Add `builder_describe_platform` function to builder.inc.sh, associated
documentation and unit test, and use it in Developer and Common build
scripts.
Relates-to: #11755
Previously with the right number of parameters that take values and the
right order it could happen that a parameter value got replaced by an
action when the script output the parameters. This change fixes this.
Fixes: #11676
The call to the command listed for `builder_run_action` was not properly
quoted, which meant that quoted parameters would have been corrupted,
for example:
builder_run_action clean rm -rf "temp folder/"
Would have run:
rm -rf temp folder/
When using module:target style dependencies, Builder would not track the
individual targets within the module, causing only the first target to
be built; subsequent dependency targets within that module would be
treated as already built.
This change means that builder will track individual targets within
the dependency. However, it is possible for targets to be built multiple
times if there a dependency listed for the entire module as well as for
the individual target within dependency, as in the following example,
where building project1 and project2 in one command would cause
module:mytarget to be built twice.
builder_describe project1 \
@/module
builder_describe project2 \
@/module:mytarget
This scenario should not break builds as they any configure+build
actions should be idempotent, but it could cause builds to be a little
slower, so should be corrected if identified. I do not currently plan to
further modify the dependency calculations to cater for this scenario.
Finally, if :mytarget is a child build, it is better to reference the
child module directly than the parent's target, for example:
builder_describe projec1 \
@/module/mytarget
This fixes the use of colors in the help output when `builder_term` is
used inside of `builder_describe` (e.g. `web/test.sh --help`). Previously
the escape sequences were not interpreted but directly output.
If you had an option with a parameter, e.g. "--outfile c,b", then the
"c,b" was being treated as a parameter for expansion, which caused it
to expand to e.g. "configure,build". Oops.
This sets us up to run all common/ and resources/ tests from a single
script, common/build.sh. This test will be run on each platform for all
changes made in common/ or resources/.
Also renamed files and paths for consistency in resources/ and updated
tests accordingly.
If a build script specified, e.g. :kmc-keyboard, :kmc-package, :kmc as
three targets, in that order, then passing :kmc as a parameter would
fail, because :kmc-keyboard, :kmc-package would be emitted to the match
result before finding :kmc.
Fixes#8471.
Ensures that `npm take-forever` (aka `npm ci`, `npm install`) only runs
once during a parent/child build script run.
Note that this also works even where build scripts manually call other
build scripts (e.g. input-processor as it is currently calling kmc
build manually) -- though this is not a recommended practice.
When running tests, discovered a number of typos in builder.inc.sh.
Also fixup pathing for builder include for all scripts under resources/
to ensure that we can maximize performance.
Improves build script performance by:
* using built-ins wherever possible (e.g. string splitting)
* eliminating redundant code
* using absolute (to $KEYMAN_ROOT) rather than relative paths to avoid realpath
* removing unnecessary `npm run` calls
BEFORE | AFTER
-------------------------------|----------------------
time ./core/build.sh --help |
real 0m2.116s | real 0m0.874s
user 0m0.578s | user 0m0.198s
sys 0m0.984s | sys 0m0.289s
-------------------------------|----------------------
time ./web/build.sh --help |
real 0m3.523s | real 0m0.757s
user 0m1.166s | user 0m0.320s
sys 0m2.273s | sys 0m0.455s
-------------------------------|----------------------
time ./web/build.sh -d |
real 1m34.750s | real 0m59.974s
user 0m9.721s | user 0m6.284s
sys 0m19.652s | sys 0m13.202s
@keymanapp-test-bot skip
Appending a `+` to a builder option will automatically pass that option to child scripts.
Applying #8371 to master branch and @darcywong00 will then re-apply to #7407
Fixes#8373.
Note that the core functionality requested in #8373 is already in place;
this commit just does some cleanup to make this easier to maintain in
the future:
* Uses `builder_is_debug_build` function to test for debug build
(instead of `builder_has_option --debug`, which would also work but
using the other function avoids typo issues with the option name).
* Renames `$_builder_debug` to `$_builder_debug_internal` to reduce
naming confusion
* Documents `$builder_debug`, `builder_is_debug_build`, and clarifies
usage of `--debug` option.
* Logs command line for dep builds (we could hide this in the future,
but it certainly doesn't hurt for now!)
We should not attempt to build dependencies when running `clean`. Note:
if your `clean` action requires dependencies, then something is very,
very wrong and you should fix that!