Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
jtreg-jenkins-build-original.sh
#!/bin/bash
function copyJCovJars() {
Downloading JCov to $WORKSPACE folder
tempDirJCov=jcov
rm -fr $tempDirJCov
mkdir -p $tempDirJCov/lib
#cd ../jcov/JCOV_BUILD/jcov_2.0
#cp -f *.jar $WORKSPACE/$tempDirJCov/lib
wget https://adopt-openjdk.ci.cloudbees.com/view/OpenJDK%20code-tools/job/jcov/ws/jcov-2.0-beta-1.tar.gz
tar -zxvf jcov-2.0-beta-1.tar.gz
cp -fr JCOV_BUILD/jcov_2.0/*.jar $tempDirJCov/lib
export JCOV_HOME=$tempDirJCov
echo "JCOV_HOME = $JCOV_HOME"
}
function copyAsmTools() {
echo copying AsmTools to $WORKSPACE folder
tempDirAsmTools=asmtools
rm -fr $tempDirAsmTools
mkdir -p $tempDirAsmTools
cd ../asmtools
cp -fr asmtools-5.0-build/ $WORKSPACE/$tempDirAsmTools/
export ASMTOOLS_HOME=$tempDirAsmTools/asmtools-5.0-build/
echo "ASMTOOLS_HOME = $ASMTOOLS_HOME"
cd $WORKSPACE
}
function copyJtHarness() {
if [ ! -d jtharness ]; then
echo "Downloading JTHarness"
#wget http://download.java.net/jtharness/4.4.1/Rel/jtharness-4_4_1-MR1-bin-b13-20_dec_2011.zip
wget https://adopt-openjdk.ci.cloudbees.com/view/OpenJDK/job/jtharness/lastSuccessfulBuild/artifact/jtharness-4.6.tar.gz
tar -zxvf jtharness-4.6.tar.gz
fi
export JTHARNESS_HOME=jtharness
unset JAVATEST_HOME
}
tagName=$(hg tags | grep jtreg | head -1 | gawk '{ print $1 }')
echo "Tag:" ${tagName}
versionAndBuildNumber=$(echo ${tagName}| awk '{split($0,a,"jtreg"); print a[2]}')
versionNumber=$(echo ${versionAndBuildNumber} | awk '{split($0,a,"-"); print a[1]}')
buildNumber=$(echo ${versionAndBuildNumber} | awk '{split($0,a,"-"); print a[2]}')
echo "VersionNumber:" ${versionNumber}
echo "BuildNumber:" ${buildNumber}
cd ..
rm -fr jtreg
hg clone http://hg.openjdk.java.net/code-tools/jtreg -r ${tagName}
cd jtreg
hg log -l 1
hg tags
if [ ! -d jh2.0 ]; then
echo "Downloading JavaHelp 2.0.5"
wget http://download.java.net/javadesktop/javahelp/javahelp2_0_05.zip
unzip -o javahelp2_0_05.zip
fi
rm -fr jtharness
copyJtHarness
if [ ! -d junit ]; then
echo "Downloading JUnit"
mkdir junit
cd junit
wget http://repo1.maven.org/maven2/junit/junit/4.8.2/junit-4.8.2.jar
mv junit-4.8.2.jar junit.jar
cd ..
fi
if [ ! -d testng ]; then
echo "Downloading TestNG"
wget http://testng.org/testng-6.8.zip
unzip -o testng-6.8.zip
mv testng-6.8 testng
mv testng/testng-6.8.jar testng/testng.jar
fi
if [ ! -d jcommander ]; then
echo "Downloading JCommander"
mkdir jcommander
cd jcommander
wget http://repo1.maven.org/maven2/com/beust/jcommander/1.7/jcommander-1.7.jar
mv jcommander-1.7.jar jcommander.jar
cd ..
fi
ls -lash
rm -fr build
rm -fr dist
copyJCovJars
copyAsmTools
ant -v -f make/build.xml -Djunit.jar=./junit/junit.jar -Dtestng.jar=./testng/testng.jar -Djavatest.home=jtharness -Djavatest.jar=jtharness/lib/javatest.jar -Djavahelp.home=./jh2.0 -Djhall.jar=./jh2.0/javahelp/lib/jhall.jar -Djh.jar=./jh2.0/javahelp/lib/jh.jar -Dbuild.version=${versionNumber} -Dbuild.number=${buildNumber} -Djcov.home=$tempDirJCov
rm -f *.zip
rm -f *.tar.gz
pwd
cp -r ./dist/jtreg .
cp jcommander/jcommander.jar ./dist/jtreg/lib
chmod u+x ./dist/jtreg/win32/bin/.
ls -lash
artifact=${tagName}
cd ./dist
tar fcv $artifact.tar jtreg
mv $artifact.tar ..
cd ..
gzip -9 ${artifact}.tar
rm -fr ${artifact}
echo "Finished creating artifact"
cp ${artifact}.tar.gz jtreg-4.2.0-SNAPSHOT.tar.gz
rm -fr $tempDirJCov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.