Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(linux): Fix build scripts #9781

Merged
merged 3 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 16 additions & 31 deletions linux/ibus-keyman/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,46 +49,31 @@ else
MESON_COVERAGE=
fi

if builder_start_action clean; then
rm -rf "$THIS_SCRIPT_PATH/../build/"
builder_finish_action success clean
fi

if builder_start_action configure; then
cd "$THIS_SCRIPT_PATH"
# shellcheck disable=SC2086
meson setup "$MESON_PATH" --werror --buildtype $MESON_TARGET ${MESON_COVERAGE} "${builder_extra_params[@]}"
builder_finish_action success configure
fi

if builder_start_action build; then
cd "$THIS_SCRIPT_PATH/$MESON_PATH"
ninja
builder_finish_action success build
fi
configure_action() {
# shellcheck disable=SC2086,SC2154
meson setup ${MESON_COVERAGE} --werror --buildtype $MESON_TARGET "${builder_extra_params[@]}" "$MESON_PATH"
}

if builder_start_action test; then
cd "$THIS_SCRIPT_PATH/$MESON_PATH"
test_action() {
if builder_has_option --no-integration; then
# shellcheck disable=SC2086,SC2154
meson test --print-errorlogs $builder_verbose setup-src-test keymanutil-tests print-kmpdetails-test print-kmp-test bcp47-util-tests teardown-src-test
else
# shellcheck disable=SC2086
meson test --print-errorlogs $builder_verbose
fi
if builder_has_option --coverage; then
# Note: requires lcov > 1.16 to properly work (see https://github.com/mesonbuild/meson/issues/6747)
ninja coverage-html
fi
builder_finish_action success test
fi
}

if builder_start_action install; then
cd "$THIS_SCRIPT_PATH/$MESON_PATH"
ninja install
builder_finish_action success install
fi
builder_run_action clean rm -rf "$THIS_SCRIPT_PATH/../build/"
builder_run_action configure configure_action

if builder_start_action uninstall; then
cd "$THIS_SCRIPT_PATH/$MESON_PATH"
ninja uninstall
builder_finish_action success uninstall
fi
[ -d "$MESON_PATH" ] && cd "$MESON_PATH"

builder_run_action build ninja
builder_run_action test test_action
builder_run_action install ninja install
builder_run_action uninstall ninja uninstall
37 changes: 15 additions & 22 deletions linux/keyman-system-service/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,26 @@ else
MESON_COVERAGE=
fi

builder_run_action clean rm -rf "$THIS_SCRIPT_PATH/build/"
configure_action() {
# shellcheck disable=SC2086,SC2154
meson setup ${MESON_COVERAGE} --werror --buildtype $MESON_TARGET "${builder_extra_params[@]}" "$MESON_PATH"
}

# shellcheck disable=SC2086
builder_run_action configure meson setup "$MESON_PATH" --werror --buildtype $MESON_TARGET ${MESON_COVERAGE} "${builder_extra_params[@]}"

cd "$MESON_PATH" || true

if builder_start_action build; then
ninja
builder_finish_action success build
fi

if builder_start_action test; then
test_action() {
# shellcheck disable=SC2086,SC2154
meson test --print-errorlogs $builder_verbose
if builder_has_option --coverage; then
# Note: requires lcov > 1.16 to properly work (see https://github.com/mesonbuild/meson/issues/6747)
ninja coverage-html
fi
builder_finish_action success test
fi
}

if builder_start_action install; then
ninja install
builder_finish_action success install
fi
builder_run_action clean rm -rf "$THIS_SCRIPT_PATH/build/"
builder_run_action configure configure_action

if builder_start_action uninstall; then
ninja uninstall
builder_finish_action success uninstall
fi
[ -d "$MESON_PATH" ] && cd "$MESON_PATH"

builder_run_action build ninja
builder_run_action test test_action
builder_run_action install ninja install
builder_run_action uninstall ninja uninstall