ff85c2d3f9f7967ca3eba4e274ee6bde2c8c3ad9
[jalview.git] / getdown / src / getdown / mvn_cmd
1 #!/usr/bin/env bash
2
3 if [ x$JVLVERSION != x ]; then
4   export VERSION=$JVLVERSION
5 else
6   export VERSION=1.8.3-1.2.7_JVL
7 fi
8
9 if [ x${VERSION%_JVL} = x$VERSION ]; then
10   VERSION=${VERSION}_JVL
11 fi
12
13 echo "Setting VERSION to '$VERSION'"
14 perl -p -i -e 's|(<version>)[^<]*JVL[^<]*(</version>)|${1}$ENV{VERSION}${2}|;' pom.xml */pom.xml
15 mvn package -Dgetdown.host.whitelist="jalview.org,*.jalview.org" -Dallow_file_protocol=false -Dconnect_timeout=8 -Dread_timeout=15
16 RET=$?
17 if [ x$RET = x0 ]; then
18   cp launcher/target/getdown-launcher-$VERSION.jar ../../../getdown/lib/getdown-launcher.jar && echo "Copied getdown-launcher-$VERSION.jar to getdown/lib"
19   cp core/target/getdown-core-$VERSION.jar ../../../getdown/lib/getdown-core.jar && echo "Copied getdown-core-$VERSION.jar to getdown/lib"
20   cp core/target/getdown-core-$VERSION.jar ../../../j8lib/getdown-core.jar && echo "Copied getdown-core-$VERSION.jar to j8lib"
21   cp core/target/getdown-core-$VERSION.jar ../../../j11lib/getdown-core.jar && echo "Copied getdown-core-$VERSION.jar to j11lib"
22   echo "$VERSION" > ../../../getdown/lib/JVL_VERSION
23 fi
24
25 VERSION=${VERSION/JVL/FJVL}
26 echo "Setting VERSION to '$VERSION'"
27 perl -p -i -e 's|(<version>)[^<]*JVL[^<]*(</version>)|${1}$ENV{VERSION}${2}|;' pom.xml */pom.xml
28 mvn package -Dgetdown.host.whitelist="jalview.org,*.jalview.org" -Dallow_file_protocol=true -Dconnect_timeout=4 -Dread_timeout=4
29 RET=$?
30 if [ x$RET = x0 ]; then
31   cp launcher/target/getdown-launcher-$VERSION.jar ../../../getdown/lib/getdown-launcher-local.jar && echo "Copied getdown-launcher-$VERSION.jar to getdown/lib/getdown-launcher-local.jar"
32   echo "$VERSION" > ../../../getdown/lib/FJVL_VERSION
33 fi