Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 12b87a0126
Fetching contributors…

Cannot retrieve contributors at this time

454 lines (420 sloc) 20.795 kB
<project name="agraph-java-client" default="build"
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<property environment="env"/>
<!-- if these AGRAPH env vars are blank, the java test code will look elsewhere -->
<property name="env.AGRAPH_HOST" value=""/>
<property name="env.AGRAPH_PORT" value=""/>
<property name="env.root" value=""/>
<property name="DIST" value="DIST"/>
<!-- Version is parameterized instead of hard-coded in multiple places. -->
<!-- This same algorithm is in clojure/project.clj -->
<!-- VERSION and env.version are set in makefile. -->
<!-- git-branch-name is used as default for dev only. -->
<loadfile property="git-branch-name" srcFile=".git-branch-name"
failonerror="false">
<filterchain> <striplinebreaks/> </filterchain>
</loadfile>
<condition property="env.version"
value="${env.VERSION}"
else="${git-branch-name}-snapshot">
<and>
<isset property="env.VERSION"/>
<length string="${env.VERSION}" when="greater" length="0"/>
</and>
</condition>
<!-- Library. -->
<property name="src" location="src"/>
<property name="lib" location="lib"/>
<property name="build" location="classes"/>
<property name="jarfile" location="agraph.jar"/>
<property name="srcjarfile" location="agraph-src.jar"/>
<path id="classpath">
<path location="${lib}/json.jar"/>
<path location="${lib}/junit-4.8.1.jar"/>
<path location="${lib}/logging/commons-logging-1.1.1.jar"/>
<path location="${lib}/logging/slf4j-api-1.6.1.jar"/>
<path location="${lib}/logging/slf4j-jcl-1.6.1.jar"/>
<path location="${lib}/sesame-2.3.2/commons-codec-1.3.jar"/>
<path location="${lib}/sesame-2.3.2/commons-httpclient-3.1.jar"/>
<path location="${lib}/sesame-2.3.2/openrdf-sesame-2.3.2-onejar.jar"/>
<path location="${lib}/jena-2.6.2/arq-2.8.1.jar"/>
<path location="${lib}/jena-2.6.2/icu4j-3.4.4.jar"/>
<path location="${lib}/jena-2.6.2/iri-0.7.jar"/>
<path location="${lib}/jena-2.6.2/jena-2.6.2-tests.jar"/>
<path location="${lib}/jena-2.6.2/jena-2.6.2.jar"/>
<path location="${lib}/jena-2.6.2/lucene-core-2.3.1.jar"/>
<path location="${lib}/jena-2.6.2/stax-api-1.0.1.jar"/>
<path location="${lib}/jena-2.6.2/wstx-asl-3.2.9.jar"/>
<path location="${lib}/jena-2.6.2/xercesImpl-2.7.1.jar"/>
<path location="${lib}/commons-cli-1.2.jar"/>
<path location="${lib}/commons-pool-1.5.6.jar"/>
<path location="${lib}/servlet-api-2.5.jar"/>
</path>
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
<mkdir dir="target"/>
</target>
<target name="clean"
description="Remove generated files and directories.">
<delete dir="${build}"/>
<delete file="${jarfile}"/>
<delete file="${srcjarfile}"/>
<delete dir="doc"/>
<delete dir="target"/>
<delete file="agraph-java-client-test.jar"/>
<ant dir="clojure" target="clean" inheritall="false"/>
</target>
<target name="compile" depends="init"
description="Compile Java sources.">
<javac srcdir="${src}" destdir="${build}" encoding="utf8"
debug="true"
includes="**/*.java"
includeAntRuntime="false"
classpathref="classpath"/>
</target>
<target name="jar"
description="Build agraph.jar file."
depends="compile">
<manifestclasspath property="mf.path" jarfile="${jarfile}">
<classpath refid="classpath"/>
</manifestclasspath>
<tstamp prefix="jar">
<format property="datestamp" pattern="yyyy-MM-dd H:mm"/>
</tstamp>
<jar jarfile="${jarfile}">
<fileset dir="${build}" includes="**/*.class">
<exclude name="tutorial/**"/>
<exclude name="test/**"/>
<exclude name="*.class"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="AllegroGraph Java Client"/>
<attribute name="Implementation-Version" value="${env.version}"/>
<attribute name="Implementation-Vendor" value="Franz, Inc."/>
<attribute name="Implementation-URL" value="http://www.franz.com/agraph/"/>
<attribute name="Built-At" value="${jar.datestamp}"/>
<attribute name="Class-Path" value="${mf.path}"/>
</manifest>
</jar>
</target>
<target name="srcjar"
description="Build agraph-src.jar file."
depends="compile">
<manifestclasspath property="mf.path.src" jarfile="${srcjarfile}">
<classpath refid="classpath"/>
</manifestclasspath>
<tstamp prefix="srcjar">
<format property="datestamp" pattern="yyyy-MM-dd H:mm"/>
</tstamp>
<jar jarfile="${srcjarfile}">
<fileset dir="${src}" includes="**/*.java">
<exclude name="tutorial/**"/>
<exclude name="test/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="AllegroGraph Java Client Sources"/>
<attribute name="Implementation-Version" value="${env.version}"/>
<attribute name="Implementation-Vendor" value="Franz, Inc."/>
<attribute name="Implementation-URL" value="http://www.franz.com/agraph/"/>
<attribute name="Built-At" value="${srcjar.datestamp}"/>
<attribute name="Class-Path" value="${mf.path.src}"/>
</manifest>
</jar>
</target>
<target name="build" depends="clean, jar"
description="clean, and build jar">
</target>
<target name="test-jar"
description="Create jar file of test classes."
depends="compile">
<tstamp prefix="jar">
<format property="datestamp" pattern="yyyy-MM-dd H:mm"/>
</tstamp>
<jar jarfile="agraph-java-client-test.jar">
<fileset dir="${build}">
<include name="tutorial/**"/>
<include name="test/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="AllegroGraph Java Client Test Code"/>
<attribute name="Implementation-Version" value="${env.version}"/>
<attribute name="Implementation-Vendor" value="Franz, Inc."/>
<attribute name="Implementation-URL" value="http://www.franz.com/agraph/"/>
<attribute name="Built-At" value="${jar.datestamp}"/>
<attribute name="Class-Path" value="${mf.path}"/>
</manifest>
</jar>
</target>
<target name="javadoc"
description="Generate javadocs to the doc directory">
<delete dir="doc"/>
<javadoc destdir="doc"
access="public"
author="true"
doctitle="Franz, Inc. AllegroGraph ${env.version} Javadoc"
header="Franz Inc, AllegroGraph"
footer="Copyright &amp;copy; 2008-2011 Franz Inc."
overview="src/overview.html"
nodeprecated="false"
nodeprecatedlist="false"
noindex="false"
nonavbar="false"
notree="false"
packagenames="com.franz.agraph.jena,com.franz.agraph.repository,com.franz.openrdf.rio.nquads,com.franz.util,com.franz.agraph.pool"
source="1.6"
sourcepath="src"
splitindex="true"
use="true"
version="true"
classpathref="classpath">
<link href="http://download.oracle.com/javase/6/docs/api/" offline="true" packagelistLoc="lib/java"/>
<link href="http://openjena.org/javadoc/" offline="true" packagelistloc="lib/jena-2.6.2"/>
<link href="http://www.openrdf.org/doc/sesame2/2.3.2/apidocs/" offline="true" packagelistloc="lib/sesame-2.3.2"/>
</javadoc>
</target>
<target name="prepush"
description="Tests required before git push: clean, build, and run Java and Clojure client tests"
depends="build, test-prepush">
<ant dir="clojure" target="prepush" inheritall="false"/>
</target>
<target name="dist-init"
description="Creates the DIST dir, runs dependencies"
depends="clean, build, javadoc, srcjar">
<delete dir="${DIST}"/>
<mkdir dir="${DIST}"/>
<copy file="LICENSE" todir="${DIST}"/>
</target>
<macrodef name="run-java"
description="Run java class">
<attribute name="tasknamex" default="java"/>
<attribute name="classname"/>
<attribute name="arg"/>
<attribute name="maxmemory" default="1024m"/>
<attribute name="streamResults" default="false"/>
<sequential>
<property name="log" value="info"/>
<java classname="@{classname}" failonerror="true" taskname="@{tasknamex}"
fork="true" maxmemory="@{maxmemory}"
inputstring="">
<!-- inputstring so ant will not hang when placed in shell background. This assumes none of the java code uses input. -->
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.SimpleLog"/>
<sysproperty key="org.apache.commons.logging.simplelog.defaultlog"
value="${log}"/>
<sysproperty key="org.apache.commons.logging.simplelog.log.org"
value="info"/>
<sysproperty key="org.apache.commons.logging.simplelog.log.httpclient"
value="info"/>
<sysproperty key="org.apache.commons.logging.simplelog.showlogname"
value="true"/>
<sysproperty key="org.apache.commons.logging.simplelog.log.com"
value="info"/>
<sysproperty key="org.apache.commons.logging.simplelog.log.test"
value="info"/>
<sysproperty key="AGRAPH_HOST" value="${env.AGRAPH_HOST}"/>
<sysproperty key="AGRAPH_PORT" value="${env.AGRAPH_PORT}"/>
<sysproperty key="AGRAPH_ROOT" value="${env.root}"/>
<sysproperty key="com.franz.agraph.repository.AGRepositoryConnection.streamResults" value="@{streamResults}"/>
<classpath>
<path refid="classpath"/>
<path location="classes"/>
</classpath>
<arg value="@{arg}"/>
</java>
</sequential>
</macrodef>
<target name="test-junit"
depends="compile"
description="Run unit tests (use -Dcat=Prepush, Broken, or Stress)
(or use -Dtest=test.stress.TransactionStressTest)">
<property name="cat" value="Prepush"/>
<property name="prefix" value="test.TestSuites$"/>
<property name="test" value="${prefix}${cat}"/>
<property name="log" value="warn"/>
<junit printsummary="no" haltonfailure="yes">
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.SimpleLog"/>
<sysproperty key="org.apache.commons.logging.simplelog.defaultlog"
value="${log}"/>
<sysproperty key="org.apache.commons.logging.simplelog.log.org"
value="warn"/>
<sysproperty key="org.apache.commons.logging.simplelog.log.httpclient"
value="warn"/>
<sysproperty key="org.apache.commons.logging.simplelog.showlogname"
value="true"/>
<sysproperty key="AGRAPH_HOST" value="${env.AGRAPH_HOST}"/>
<sysproperty key="AGRAPH_PORT" value="${env.AGRAPH_PORT}"/>
<sysproperty key="AGRAPH_ROOT" value="${env.root}"/>
<classpath>
<path refid="classpath"/>
<path location="classes"/>
</classpath>
<formatter type="plain" usefile="no"/>
<test name="${test}"/>
</junit>
</target>
<target name="test-prepush"
depends="compile"
description="run prepush tests">
<run-java tasknamex="test" classname="test.TestRunner" arg="test.TestSuites$Prepush"/>
</target>
<target name="test-bigger"
depends="clean, test-dist, prepush, test-stress-events, test-stress"
description="run bigger tests, takes about 10 minutes">
</target>
<target name="test-broken"
depends="compile"
description="run tests known to be broken">
<run-java tasknamex="test" classname="test.TestRunner" arg="test.TestSuites$Broken"/>
</target>
<target name="test-stress"
depends="compile"
description="long-running stress tests">
<run-java tasknamex="test-stream" classname="test.TestRunner" arg="test.TestSuites$Prepush"
streamResults="true"/>
<run-java tasknamex="test" classname="test.TestRunner" arg="test.TestSuites$Stress"/>
</target>
<target name="test-temp"
depends="compile"
description="">
<property name="cat" value="Temp"/>
<property name="prefix" value="test.TestSuites$"/>
<property name="test" value="${prefix}${cat}"/>
<run-java tasknamex="test" classname="test.TestRunner" arg="${test}"
streamResults="${streamResults}"/>
</target>
<target name="test-stress-events"
depends="compile"
description="Run events.sh with small settings">
<exec executable="time" taskname="events"
failonerror="true">
<arg value="./events.sh"/>
<arg value="--catalog"/>
<arg value="java-catalog"/>
<arg value="--load"/>
<arg value="2"/>
<arg value="--query"/>
<arg value="2"/>
<arg value="--time"/>
<arg value="1"/>
<arg value="--size"/>
<arg value="100000"/>
</exec>
</target>
<!-- The testing/test-eclipse-workspace was created manually -->
<!-- because there is no easy way to create a workspace and import -->
<!-- a project using the eclipse command line. -->
<!-- Instructions to create manually: -->
<!-- 1. Run: ant test-dist-manual-step1 -->
<!-- 2. Run: eclipse -data target/manual-ws -->
<!-- 3. In the eclipse UI, import existing project, choose target/manual-ws/acjproject, Finish. -->
<!-- 4. Exit eclipse. -->
<!-- 5. Run: ant test-dist-manual-step2 -->
<!-- 6. Run: ant test-dist -->
<!-- 7. Run: git add testing/test-eclipse-workspace -->
<target name="test-dist-manual-step1">
<exec executable="make" taskname="make"
failonerror="true" timeout="20000">
<arg value="dist"/>
</exec>
<mkdir dir="target/manual-ws"/>
<untar src="agraph-${env.version}-client-java.tar.gz" compression="gzip" dest="target/manual-ws/acjproject"/>
</target>
<target name="test-dist-manual-step2">
<delete dir="testing/test-eclipse-workspace"/>
<copy todir="testing/test-eclipse-workspace">
<fileset dir="target/manual-ws">
<include name=".metadata/version.ini"/>
<include name=".metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version"/>
<include name=".metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index"/>
<include name=".metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version"/>
<include name=".metadata/.plugins/org.eclipse.core.resources/.root/1.tree"/>
<include name=".metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources"/>
</fileset>
</copy>
</target>
<target name="test-dist"
description="Tests distribution agraph*.tar.gz">
<exec executable="make" taskname="make"
failonerror="true" timeout="40000">
<env key="VERSION" value="${env.version}"/>
<arg value="dist"/>
</exec>
<copy todir="target/test-ws">
<fileset dir="testing/test-eclipse-workspace"/>
</copy>
<mkdir dir="target/test-ws/acjproject"/>
<untar src="agraph-${env.version}-client-java.tar.gz" compression="gzip" dest="target/test-ws/acjproject"/>
<exec executable="./eclipse-build.sh" taskname="eclipse-build.sh"
failonerror="true" timeout="80000">
<arg value="target/test-ws/"/>
<arg value="target/test-ws/acjproject/bin/tutorial/TutorialExamples.class"/>
</exec>
</target>
<target name="lubm-prolog"
depends="compile"
description="Run test.stress.Events">
<run-java tasknamex="lubm-prolog" classname="test.lubm.AGLubmProlog" arg=""/>
</target>
<target name="lubm-sparql"
depends="compile"
description="Run test.stress.Events">
<run-java tasknamex="lubm-sparql" classname="test.lubm.AGLubmSparql" arg=""/>
</target>
<target name="tutorial"
depends="compile"
description="Run tutorial example. Use -Dexample=5 for a specific example, default is all">
<property name="example" value="all"/>
<run-java tasknamex="tutorial" classname="tutorial.TutorialExamples" arg="${example}"/>
</target>
<target name="jena-tutorial"
depends="compile"
description="Run jena examples. Use -Dexample=5 for a specific example, default is all">
<property name="example" value="all"/>
<run-java tasknamex="jena-tutorial" classname="tutorial.JenaTutorialExamples" arg="${example}"/>
</target>
<target name="jena-compliance-tests"
depends="compile"
description="Run jena compliance tests.">
<run-java tasknamex="AGGraphMakerTest " classname="org.junit.runner.JUnitCore" arg="test.AGGraphMakerTest"/>
<run-java tasknamex="AGGraphTest " classname="org.junit.runner.JUnitCore" arg="test.AGGraphTest"/>
<run-java tasknamex="AGModelTest " classname="org.junit.runner.JUnitCore" arg="test.AGModelTest"/>
<run-java tasknamex="AGPrefixMappingTest" classname="org.junit.runner.JUnitCore" arg="test.AGPrefixMappingTest"/>
<run-java tasknamex="AGResultSetTest " classname="org.junit.runner.JUnitCore" arg="test.AGResultSetTest"/>
<run-java tasknamex="AGReifierTest " classname="org.junit.runner.JUnitCore" arg="test.AGReifierTest"/>
</target>
<target name="mvn-install"
depends="build"
description="install jars into local maven repo">
<path id="maven-ant-tasks.classpath" path="${user.home}/.m2/repository/org/apache/maven/maven-ant-tasks/2.0.10/maven-ant-tasks-2.0.10.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath" />
<copy file="pom.xml"
tofile="classes/pom.xml">
<filterset>
<filter token="AGRAPH_VERSION" value="${env.version}"/>
</filterset>
</copy>
<artifact:pom id="agraph" file="classes/pom.xml" />
<artifact:install file="${jarfile}">
<pom refid="agraph"/>
</artifact:install>
<artifact:pom id="sesame" file="pom-sesame.xml" />
<artifact:install file="lib/sesame-2.3.2/openrdf-sesame-2.3.2-onejar.jar">
<pom refid="sesame"/>
</artifact:install>
</target>
<target name="test-war"
depends="compile"
description="builds agraph-test.war">
<war destfile="target/agraph-test.war"
webxml="src/test/web/web.xml">
<classes dir="classes" includes="**/*"/>
<lib dir="lib" includes="*.jar" excludes="servlet-api-2.5.jar"/>
<lib dir="lib/sesame-2.3.2" includes="*.jar"/>
<lib dir="lib/logging" includes="*.jar"/>
</war>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.