Skip to content

Commit

Permalink
Added options for deploying, extra maven args, and skipping tests.
Browse files Browse the repository at this point in the history
Added script for downloading StrategoXT into the local Maven repository.
Ignore test-gen directories
  • Loading branch information
Gohla committed Jan 13, 2015
1 parent 32bc8ff commit 5016bb6
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.cache
/**/.cache
/**/test-gen
49 changes: 47 additions & 2 deletions strategoxt/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
49 changes: 47 additions & 2 deletions strategoxt/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
37 changes: 37 additions & 0 deletions strategoxt/download-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>4.0.0</modelVersion>
<artifactId>strategoxt-download</artifactId>
<packaging>pom</packaging>

<parent>
<groupId>org.metaborg</groupId>
<artifactId>org.metaborg.maven.parent</artifactId>
<version>1.3.0-SNAPSHOT</version>
<relativePath>../../spoofax-deploy/org.metaborg.maven.parent</relativePath>
</parent>

<dependencies>
<dependency>
<groupId>org.metaborg</groupId>
<artifactId>strategoxt-distrib</artifactId>
<version>${metaborg-version}</version>
<type>tar</type>
<classifier>bin</classifier>
</dependency>
<dependency>
<groupId>org.metaborg</groupId>
<artifactId>strategoxt-jar</artifactId>
<version>${metaborg-version}</version>
</dependency>
<dependency>
<groupId>org.metaborg</groupId>
<artifactId>strategoxt-min-jar</artifactId>
<version>${metaborg-version}</version>
</dependency>
</dependencies>
</project>
7 changes: 7 additions & 0 deletions strategoxt/download.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5016bb6

Please sign in to comment.