Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: b18acab60a
Fetching contributors…

Cannot retrieve contributors at this time

164 lines (133 sloc) 6.228 kb
<project name="fec-graph" default="tool" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="project.version" value="1.0"/>
<property name="project.main.class" value="org.followthedata.importer.Tool"/>
<property name="project.jar" value="${ant.project.name}-${project.version}.jar"/>
<property name="lib.dir" value="CODE/fecGraph/lib" />
<property name="build.dir" value="CODE/fecGraph/bin" />
<property name="src.dir" value="CODE/fecGraph/src" />
<property name="bin.dir" value="bin" />
<property name="fec.data.dir" location="FEC-DATA" />
<property name="neo4j.home.dir" location="neo4j-home" />
<property name="neo4j.data.dir" location="fec.graphdb" />
<property name="neo4j.version" value="1.8.RC1" />
<property name="neo4j.server" value="neo4j-community-${neo4j.version}" />
<!-- paths used for compilation and run -->
<path id="lib.path.id">
<fileset dir="${lib.dir}" />
</path>
<path id="run.path.id">
<path refid="lib.path.id" />
<path location="${build.dir}" />
</path>
<!-- here is the version of ivy we will use. change this property to try a newer
version if you want -->
<property name="ivy.install.version" value="2.0.0-beta1" />
<property name="ivy.jar.dir" value="${basedir}/ivy" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<target name="download-ivy" unless="skip.download">
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<echo message="installing ivy..."/>
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="install-ivy" depends="download-ivy" description="--> install ivy">
<path id="ivy.lib.path">
<pathelement location="${ivy.jar.file}"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<target name="initialize" depends="install-ivy, prep-data">
<ivy:retrieve pattern="${lib.dir}/[artifact]-[revision].[ext]" sync="true"/>
</target>
<target name="build" description="compile project">
<echo message="compiling..."/>
<mkdir dir="${build.dir}" />
<javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="lib.path.id" includeAntRuntime="false"/>
</target>
<target name="jar" depends="build">
<jar destfile="${lib.dir}/${project.jar}" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="${project.main.class}"/>
</manifest>
</jar>
</target>
<target name="tool" depends="jar">
<mkdir dir="${bin.dir}" />
<echo file="${bin.dir}/fec2graph">#!/usr/bin/env bash
exec java -Xmx1G -cp "${lib.dir}/*" ${project.main.class} "$@"
</echo>
<echo file="${bin.dir}/advancedImporter">#!/usr/bin/env bash
exec java -Xmx1G -cp "${lib.dir}/*" org.followthedata.importer.Importer "$@"
</echo>
<chmod file="${bin.dir}/fec2graph" perm="+x"/>
<chmod file="${bin.dir}/advancedImporter" perm="+x"/>
</target>
<!-- =================================
target: clean
================================= -->
<target name="clean" description="--> clean the project">
<delete includeemptydirs="true" quiet="true">
<fileset dir="${build.dir}" />
<fileset dir="${bin.dir}" />
</delete>
</target>
<!-- =================================
target: clean-ivy
================================= -->
<target name="clean-ivy" description="--> clean the ivy installation">
<delete dir="${ivy.jar.dir}"/>
</target>
<!-- =================================
target: clean-cache
================================= -->
<target name="clean-cache" depends="install-ivy"
description="--> clean the ivy cache">
<ivy:cleancache />
</target>
<!-- =================================
target: prep-data
================================= -->
<target name="prep-data">
<unzip dest="${fec.data.dir}">
<fileset dir="${fec.data.dir}">
<include name="**/*.zip" />
</fileset>
</unzip>
</target>
<!-- =================================
target: neo4j-install
================================= -->
<target name="-check-neo4j-install">
<available file="${neo4j.server}/bin/neo4j" property="neo4j.installed"/>
</target>
<target name="neo4j-install" depends="-check-neo4j-install" description="downloads Neo4j server" unless="${neo4j.installed}">
<get src="http://dist.neo4j.org/${neo4j.server}-unix.tar.gz" skipexisting="true" dest="."/>
<gunzip src="${neo4j.server}-unix.tar.gz"/>
<untar src="${neo4j.server}-unix.tar" dest="." />
<delete file="${neo4j.server}-unix.tar" />
<chmod file="${neo4j.server}/bin/neo4j" perm="+x"/>
</target>
<target name="neo4j-config" depends="neo4j-install" description="updates Neo4j configuration to use imported FEC graph database">
<exec executable="sed">
<arg value="-e"/>
<arg value="/org\.neo4j\.server\.database\.location/d"/>
<arg value="-i"/>
<arg value=""/>
<arg value="${neo4j.server}/conf/neo4j-server.properties"/>
</exec>
<echo file="${neo4j.server}/conf/neo4j-server.properties" append="true">org.neo4j.server.database.location=${neo4j.data.dir}
</echo>
</target>
<target name="neo4j-start" depends="neo4j-config">
<exec executable="${neo4j.server}/bin/neo4j">
<arg value="start" />
</exec>
</target>
<target name="neo4j-stop" depends="neo4j-config">
<exec executable="${neo4j.server}/bin/neo4j">
<arg value="stop" />
</exec>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.