Created
December 15, 2011 09:58
-
-
Save provegard/1480571 to your computer and use it in GitHub Desktop.
Script that downloads and builds defender-prototype and lambda (Project Lambda).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script that downloads and builds defender-prototype and lambda (Project Lambda). | |
set -e | |
set -u | |
function error_exit() | |
{ | |
echo >&2 $@ | |
exit 1 | |
} | |
[[ -e defender-prototype ]] && error_exit "Won't overwrite existing defender-prototype directory." | |
[[ -e lambda ]] && error_exit "Won't overwrite existing lambda directory." | |
[[ -x $(which hg) ]] || error_exit "Please install Mercurial (hg)." | |
[[ -x $(which wget) ]] || error_exit "Please install wget." | |
[[ -x $(which unzip) ]] || error_exit "Please install unzip." | |
DEFENDER_PROTOTYPE_URL=http://hg.openjdk.java.net/lambda/defender-prototype | |
LAMBDA_URL=http://hg.openjdk.java.net/lambda/lambda | |
TESTNG_URL=http://testng.org/testng-6.2.zip | |
ASM_URL=http://download.forge.objectweb.org/asm/asm-4.0-bin.zip | |
# defender-prototype | |
# -- download repo | |
hg clone $DEFENDER_PROTOTYPE_URL | |
# -- download required libraries | |
cd $(basename $DEFENDER_PROTOTYPE_URL) | |
mkdir lib && cd lib | |
wget $TESTNG_URL | |
unzip -e -j $(basename $TESTNG_URL) testng-6.2/testng-6.2.jar | |
wget $ASM_URL | |
unzip -e -j $(basename $ASM_URL) asm-4.0/lib/asm-4.0.jar | |
rm $(basename $TESTNG_URL) $(basename $ASM_URL) | |
cd .. | |
# -- build | |
ant | |
cd .. | |
# lambda | |
# -- download repo and source | |
hg clone $LAMBDA_URL | |
cd $(basename $LAMBDA_URL) | |
sh get_source.sh | |
# -- set environment | |
export ALT_BOOTDIR=$(readlink -f $(dirname $(readlink -f $(which javac)))/..) | |
export ALLOW_DOWNLOADS=true | |
export LANG=C | |
unset JAVA_HOME | |
# -- build | |
make sanity && make all 2>&1 | tee build.log | |
cd .. | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment