Skip to content

Commit

Permalink
Support incremental maven builds in PTL
Browse files Browse the repository at this point in the history
`mvn install` is typically faster than `mvn clean install`, but it
leaves previous launcher jar in the target/. Let bin/ptl pick it up
nicely.

This also prevents the script from picking up a way-too-old launcher
jar, i.e. after project version change.
  • Loading branch information
findepi committed Feb 21, 2022
1 parent 276b8bb commit e5c4e52
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions testing/trino-product-tests-launcher/bin/run-launcher
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
#!/usr/bin/env bash

target="${BASH_SOURCE%/*/*}/target"
launcher_jar=( "${target}"/trino-product-tests-launcher-*-executable.jar )

if test "${#launcher_jar[@]}" -ne 1; then
echo "Found ${#launcher_jar[@]} launcher jars in ${target}: ${launcher_jar[*]}" >&2
echo "Run \`./mvnw clean install -pl :trino-product-tests-launcher\`" >&2
exit 3
fi
trino_version=$(./mvnw -B help:evaluate -Dexpression=pom.version -q -DforceStdout)
launcher_jar="${target}/trino-product-tests-launcher-${trino_version}-executable.jar"

if ! test -x "${launcher_jar[0]}"; then
# Most likely `*` glob was not expanded, file does not exist
echo "Could not find launcher jar in ${target}." >&2
if ! test -x "${launcher_jar}"; then
echo "Could not find launcher jar ${launcher_jar}." >&2
echo "Run \`./mvnw clean install -pl :trino-product-tests-launcher\`" >&2
exit 3
fi

0 comments on commit e5c4e52

Please sign in to comment.