Skip to content

Instantly share code, notes, and snippets.

@terabyte
Created October 7, 2016 16:31
Show Gist options
  • Save terabyte/687d7fea5acc27aaf2f63ede09ef8895 to your computer and use it in GitHub Desktop.
Save terabyte/687d7fea5acc27aaf2f63ede09ef8895 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
eval export JAVA_HOME=\$JAVA_${QBT_ENV_JDK:-1_8}_HOME
if [ -d src ]; then "$INPUT_ARTIFACTS_DIR"/weak/qbt_fringe.linter.release/strong/qbt_fringe.linter.release/bin/linter -d src; fi
if [ -d test ]; then "$INPUT_ARTIFACTS_DIR"/weak/qbt_fringe.linter.release/strong/qbt_fringe.linter.release/bin/linter -d test; fi
# generate pom.xml with dependencies
echo "<project>
<modelVersion>4.0.0</modelVersion>
<groupId>qbt</groupId>
<artifactId>$PACKAGE_NAME</artifactId>
<version>1</version>" > pom.xml
# determine if we have any jars in our dependencies to add to our strong classpath
if [[ "x$(find $INPUT_ARTIFACTS_DIR/strong -name '*.jar')" != "x" ]]; then
echo " <dependencies>
<dependency>
<groupId>qbtDeps</groupId>
<artifactId>qbtDeps</artifactId>
<version>1.0</version>
<scope>system</scope>" >> pom.xml
for i in $(find $INPUT_ARTIFACTS_DIR/strong -type f -name '*.jar');
do echo " <systemPath>$i</systemPath>" >> pom.xml;
done
echo " </dependency>" >> pom.xml
echo " </dependencies>" >> pom.xml
fi
echo "</project>" >> pom.xml
$INPUT_ARTIFACTS_DIR/weak/3p.maven/strong/3p.maven/bin/mvn clean test package
# copy results to artifact dir
mkdir -p $OUTPUT_ARTIFACTS_DIR/jars
cp target/*.jar $OUTPUT_ARTIFACTS_DIR/jars/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment