summaryrefslogtreecommitdiff
path: root/build.xml
diff options
context:
space:
mode:
Diffstat (limited to 'build.xml')
-rw-r--r--build.xml77
1 files changed, 77 insertions, 0 deletions
diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000..f6ef8be
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project default="create_run_jar" name="Create Runnable Jar for Project SSSync with libraries in sub-folder">
+ <!-- Hand-written (with help of Eclipse) -->
+
+ <!-- ANT 1.8 annoying warning work-around -->
+ <presetdef name="javac">
+ <javac includeantruntime="false"/>
+ </presetdef>
+
+ <target name="clean">
+ <ant antfile="build.xml" dir="src/main/" inheritAll="false" target="cleanall"/>
+ <delete file="build/SSSync.jar"/>
+ <delete file="build/sssync"/>
+ <delete dir="build/lib"/>
+ <delete dir="build/conf"/>
+ <delete dir="build/data"/>
+ </target>
+
+ <target name="build">
+ <ant antfile="build.xml" dir="src/main/" inheritAll="false" target="build"/>
+ </target>
+
+ <target depends="build" name="create_run_jar">
+ <mkdir dir="build"/>
+
+ <jar destfile="build/SSSync.jar">
+ <manifest>
+ <attribute name="Main-Class" value="SSSync"/>
+ <attribute name="Class-Path" value=". lib/junit.jar lib/org.hamcrest.core_1.1.0.jar lib/guava-16.0.1.jar lib/log4j-1.2.17.jar lib/snakeyaml-1.11.jar lib/commons-csv-1.0-SNAPSHOT.jar lib/ojdbc6.jar lib/mysql-connector-java-5.1.31-bin.jar lib/unboundid-ldapsdk-se.jar"/>
+ </manifest>
+ <fileset dir="src/main/bin">
+ <exclude name="**/*Test.class"/>
+ <exclude name="**/*Tests.class"/>
+ </fileset>
+ <fileset dir="src/core/bin">
+ <exclude name="**/*Test.class"/>
+ <exclude name="**/*Tests.class"/>
+ </fileset>
+ <fileset dir="src/connectors/bin">
+ <exclude name="**/*Test.class"/>
+ <exclude name="**/*Tests.class"/>
+ </fileset>
+ </jar>
+
+ <!-- copy doesn't preserve file's permission -->
+ <copy file="src/main/sssync.sh" tofile="build/sssync"/>
+ <exec executable="chmod">
+ <arg value="a+x"/>
+ <arg value="build/sssync"/>
+ </exec>
+
+ <delete dir="build/lib"/>
+ <mkdir dir="build/lib"/>
+ <copy file="src/core/lib/guava-16.0.1.jar" todir="build/lib"/>
+ <copy file="src/main/lib/log4j-1.2.17.jar" todir="build/lib"/>
+ <copy file="src/main/lib/snakeyaml-1.11.jar" todir="build/lib"/>
+ <copy file="src/connectors/lib/commons-csv-1.0-SNAPSHOT.jar" todir="build/lib"/>
+ <copy file="src/connectors/lib/ojdbc6.jar" todir="build/lib"/>
+ <copy file="src/connectors/lib/mysql-connector-java-5.1.31-bin.jar" todir="build/lib"/>
+ <copy file="src/connectors/lib/unboundid-ldapsdk-se.jar" todir="build/lib"/>
+
+ <delete dir="build/conf"/>
+ <mkdir dir="build/conf"/>
+ <copy file="src/main/conf/connections.yaml" todir="build/conf"/>
+ <copy file="src/main/conf/sssync.yaml" todir="build/conf"/>
+ <copy file="src/main/conf/log4j.properties" todir="build/conf"/>
+
+ <mkdir dir="build/conf/queries"/>
+ <copy file="src/main/conf/queries/people.sql" todir="build/conf/queries"/>
+ <copy file="src/main/conf/queries/structures.sql" todir="build/conf/queries"/>
+
+ <delete dir="build/data"/>
+ <mkdir dir="build/data"/>
+ <copy file="src/main/data/people_append.csv" todir="build/data"/>
+ <copy file="src/main/data/people_replace.csv" todir="build/data"/>
+ </target>
+</project>