Skip to content

Commit

Permalink
first version of build.xml, and also with travis-build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesZ-Chen committed May 16, 2016
1 parent 3e7d0e2 commit 607efbf
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .travis-build-without-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
ROOT=$TRAVIS_BUILD_DIR/..

# Fail the whole script if any command fails
set -e

export SHELLOPTS

export JAVA_HOME=${JAVA_HOME:-$(dirname $(dirname $(dirname $(readlink -f $(/usr/bin/which java)))))}

export JSR308=$ROOT
export AFU=$ROOT/annotation-tools/annotation-file-utilities
export CHECKERFRAMEWORK=$ROOT/checker-framework

export PATH=$AFU/scripts:$JAVA_HOME/bin:$PATH

## Build Checker Framework
if [ -d $ROOT/checker-framework ] ; then
# Older versions of git don't support the -C command-line option
(cd $ROOT/checker-framework && git pull)
else
(cd $ROOT && git clone --depth 1 https://github.com/pascaliUWat/checker-framework.git)
fi

# This also builds annotation-tools and jsr308-langtools
(cd $ROOT/checker-framework/ && ./.travis-build-without-test.sh)

## Build plume-lib
if [ -d $ROOT/plume-lib ] ; then
# Older versions of git don't support the -C command-line option
(cd $ROOT/plume-lib && git pull)
else
(cd $ROOT && git clone --depth 1 https://github.com/mernst/plume-lib.git)
fi

(cd $ROOT/plume-lib/ && make)

#build this checker
ant -f $TRAVIS_BUILD_DIR/build.xml
11 changes: 11 additions & 0 deletions .travis-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
ROOT=$TRAVIS_BUILD_DIR/..

# Fail the whole script if any command fails
set -e

export SHELLOPTS

. ./.travis-build-without-test.sh

ant -f $TRAVIS_BUILD_DIR/tests.xml run-tests
50 changes: 50 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<project name="ReadChecker" basedir="." default="build-checker">
<property name="checker-framework" value="${basedir}/../checker-framework"/>
<property name="jsr308-langtools" value="${basedir}/../jsr308-langtools"/>

<property name="checker.bin" value="${basedir}/bin"/>
<property name="checker.src" value="${basedir}/src"/>
<property name="build.deps" value="${basedir}/build-deps"/>
<!-- <symlink link="${dir.top}/foo" resource="${dir.top}/subdir/bar.foo"/> -->

<target name="prep">
<mkdir dir="${checker.bin}"/>
<mkdir dir="${build.deps}"/>

<symlink link="${build.deps}/framework.jar" resource="${checker-framework}/framework/dist/framework.jar" overwrite="true"/>
<symlink link="${build.deps}/javac.jar" resource="${jsr308-langtools}/dist/lib/javac.jar" overwrite="true"/>
</target>

<target name="build-checker" depends="prep">
<pathconvert pathsep=":" property="build.classpath">
<path>
<fileset dir="${build.deps}">
<include name="*.jar"/>
</fileset>
</path>
</pathconvert>

<pathconvert pathsep=" " property="src.checker">
<path>
<fileset dir="${checker.src}">
<include name="**/*.java"/>
</fileset>
</path>
</pathconvert>

<java fork="true"
failonerror="true"
classpath="${build.classpath}"
classname="com.sun.tools.javac.Main">
<jvmarg line="-Xbootclasspath/p:${javac.lib}"/>
<arg value="-g"/>
<!-- To not get a warning about bootstrap classpath -->
<arg value="-Xlint:-options"/>
<arg line="-sourcepath ${checker.src}"/>
<arg line="-d ${checker.bin}"/>
<arg line="${src.checker}"/>
</java>
</target>


</project>

0 comments on commit 607efbf

Please sign in to comment.