From 5016bb6f3d5fbf7fc5e3f6ed59e7bd8e0f572bb9 Mon Sep 17 00:00:00 2001 From: Gabriel Konat Date: Tue, 13 Jan 2015 17:18:20 +0100 Subject: [PATCH] Added options for deploying, extra maven args, and skipping tests. Added script for downloading StrategoXT into the local Maven repository. Ignore test-gen directories --- .gitignore | 3 ++- strategoxt/bootstrap.sh | 49 +++++++++++++++++++++++++++++++++++-- strategoxt/build.sh | 49 +++++++++++++++++++++++++++++++++++-- strategoxt/download-pom.xml | 37 ++++++++++++++++++++++++++++ strategoxt/download.sh | 7 ++++++ 5 files changed, 140 insertions(+), 5 deletions(-) create mode 100644 strategoxt/download-pom.xml create mode 100755 strategoxt/download.sh diff --git a/.gitignore b/.gitignore index 16d3c4dbb..54e2e8f12 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.cache +/**/.cache +/**/test-gen \ No newline at end of file diff --git a/strategoxt/bootstrap.sh b/strategoxt/bootstrap.sh index 03c7d3235..3f6a93713 100755 --- a/strategoxt/bootstrap.sh +++ b/strategoxt/bootstrap.sh @@ -2,10 +2,55 @@ set -eu + +# Parse input +while getopts ":da:t" opt; do + case $opt in + d) + INPUT_MAVEN_PHASE="deploy" + ;; + a) + INPUT_MAVEN_ARGS=$OPTARG + ;; + t) + INPUT_SKIP_TESTS="true" + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + :) + echo "Option -$OPTARG requires an argument." >&2 + exit 2 + ;; + esac +done + + +# Set build vars +MAVEN_ARGS=${INPUT_MAVEN_ARGS:-""} +MAVEN_PHASE=${INPUT_MAVEN_PHASE:-"install"} + +SKIP_TESTS=${INPUT_SKIP_TESTS:-"false"} + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -mvn clean install -f "$DIR/bootstrap-pom.xml" -mvn clean install -f "$DIR/buildpoms/pom.xml" -Dstrategoxt-skip-build="true" + +# Run Maven builds +mvn \ + -f "$DIR/bootstrap-pom.xml" \ + -Dstrategoxt-skip-test="$SKIP_TESTS" \ + clean \ + $MAVEN_PHASE \ + $MAVEN_ARGS + +mvn \ + -f "$DIR/buildpoms/pom.xml" \ + -Dstrategoxt-skip-build="true" \ + clean \ + $MAVEN_PHASE \ + $MAVEN_ARGS + echo "Build output located at..." echo "StrategoXT distribution bootstrap 1: $DIR/buildpoms/bootstrap1/target" diff --git a/strategoxt/build.sh b/strategoxt/build.sh index 246e957df..85c467142 100755 --- a/strategoxt/build.sh +++ b/strategoxt/build.sh @@ -2,10 +2,55 @@ set -eu + +# Parse input +while getopts ":da:t" opt; do + case $opt in + d) + INPUT_MAVEN_PHASE="deploy" + ;; + a) + INPUT_MAVEN_ARGS=$OPTARG + ;; + t) + INPUT_SKIP_TESTS="true" + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + :) + echo "Option -$OPTARG requires an argument." >&2 + exit 2 + ;; + esac +done + + +# Set build vars +MAVEN_ARGS=${INPUT_MAVEN_ARGS:-""} +MAVEN_PHASE=${INPUT_MAVEN_PHASE:-"install"} + +SKIP_TESTS=${INPUT_SKIP_TESTS:-"false"} + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -mvn clean install -f "$DIR/build-pom.xml" -mvn clean install -f "$DIR/buildpoms/pom.xml" -Dstrategoxt-skip-build="true" + +# Run Maven builds +mvn \ + -f "$DIR/build-pom.xml" \ + -Dstrategoxt-skip-test="$SKIP_TESTS" \ + clean \ + $MAVEN_PHASE \ + $MAVEN_ARGS + +mvn \ + -f "$DIR/buildpoms/pom.xml" \ + -Dstrategoxt-skip-build="true" \ + clean \ + $MAVEN_PHASE \ + $MAVEN_ARGS + echo "Build output located at..." echo "StrategoXT distribution: $DIR/buildpoms/build/target" diff --git a/strategoxt/download-pom.xml b/strategoxt/download-pom.xml new file mode 100644 index 000000000..2f9d77685 --- /dev/null +++ b/strategoxt/download-pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + strategoxt-download + pom + + + org.metaborg + org.metaborg.maven.parent + 1.3.0-SNAPSHOT + ../../spoofax-deploy/org.metaborg.maven.parent + + + + + org.metaborg + strategoxt-distrib + ${metaborg-version} + tar + bin + + + org.metaborg + strategoxt-jar + ${metaborg-version} + + + org.metaborg + strategoxt-min-jar + ${metaborg-version} + + + \ No newline at end of file diff --git a/strategoxt/download.sh b/strategoxt/download.sh new file mode 100755 index 000000000..3a74da24b --- /dev/null +++ b/strategoxt/download.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -eu + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +mvn -f "$DIR/download-pom.xml" dependency:resolve \ No newline at end of file