[Tynstep-svn] r34 - in trunk/StepDataLoader: . src/com/tyndalehouse/step/dataloader src/com/tyndalehouse/step/dataloader/loaders

ChrisBurrell at crosswire.org ChrisBurrell at crosswire.org
Sat Dec 12 09:27:52 MST 2009


Author: ChrisBurrell
Date: 2009-12-12 09:27:51 -0700 (Sat, 12 Dec 2009)
New Revision: 34

Added:
   trunk/StepDataLoader/build.xml
Modified:
   trunk/StepDataLoader/src/com/tyndalehouse/step/dataloader/Dataloader.java
   trunk/StepDataLoader/src/com/tyndalehouse/step/dataloader/loaders/SchemaLoader.java
Log:


Added: trunk/StepDataLoader/build.xml
===================================================================
--- trunk/StepDataLoader/build.xml	                        (rev 0)
+++ trunk/StepDataLoader/build.xml	2009-12-12 16:27:51 UTC (rev 34)
@@ -0,0 +1,60 @@
+<?xml version="1.0" ?>
+<project default="clean-build">
+	<property name="lib.dir" value="lib" />
+	<property name="output.dir" value="build" />
+	<property name="classes.dir" value="${output.dir}/classes" />
+	<property name="jar.dir" value="${output.dir}/jar" />
+
+	<property name="step.location.dir" value="../StepWebApp" />
+	<property name="step.db.dir" value="${step.location.dir}/war/StepDB" />
+	<property name="step.location.lib.dir" value="war/WEB-INF/lib" />
+
+	<property name="src.data.dir" value="data" />
+	<property name="src.sql.dir" value="sql" />
+
+	<property name="main-class" value="com.tyndalehouse.step.dataloader.Dataloader" />
+
+	<property name="jar.name" value="step-dataloader.jar" />
+		
+	<path id="classpath">
+		<fileset dir="${lib.dir}" includes="**/*.jar" />
+		<fileset dir="${step.location.dir}/${step.location.lib.dir}" includes="**/*.jar" />
+	</path>
+
+
+	<target name="clean">
+		<delete dir="${output.dir}" />
+	</target>
+
+
+	<target name="compile">
+		<mkdir dir="${classes.dir}" />
+		<javac srcdir="src" destdir="build/classes" classpathref="classpath" />
+		<copy todir="${classes.dir}">
+            <fileset dir="${src.data.dir}" />
+            <fileset dir="${src.sql.dir}" />
+        </copy>
+	</target>
+
+	<target name="jar" depends="compile">
+		<mkdir dir="${output.dir}/jar" />
+		<jar destfile="${jar.dir}/${jar.name}" basedir="${classes.dir}" >
+			<manifest>
+				<attribute name="Main-Class" value="${main-class}" />
+			</manifest>
+		</jar>
+	</target>
+
+
+    <target name="run" depends="jar">
+        <java fork="true" classname="${main-class}" >
+            <classpath>
+                <path refid="classpath"/>
+                <path location="${jar.dir}/${jar.name}"/>
+            </classpath>
+			<sysproperty key="db.location" value="${step.db.dir}" />
+        </java>
+    </target>
+
+ 	<target name="clean-build" depends="clean,jar,run"/>
+</project>
\ No newline at end of file

Modified: trunk/StepDataLoader/src/com/tyndalehouse/step/dataloader/Dataloader.java
===================================================================
--- trunk/StepDataLoader/src/com/tyndalehouse/step/dataloader/Dataloader.java	2009-12-08 19:04:54 UTC (rev 33)
+++ trunk/StepDataLoader/src/com/tyndalehouse/step/dataloader/Dataloader.java	2009-12-12 16:27:51 UTC (rev 34)
@@ -26,7 +26,10 @@
 	
 		SchemaLoader sl = new SchemaLoader();
 		TimelineLoader tl = new TimelineLoader();
+	
 		
+		
+		
 		long startTime= Calendar.getInstance().getTimeInMillis();
 
 		sl.recreateAll();

Modified: trunk/StepDataLoader/src/com/tyndalehouse/step/dataloader/loaders/SchemaLoader.java
===================================================================
--- trunk/StepDataLoader/src/com/tyndalehouse/step/dataloader/loaders/SchemaLoader.java	2009-12-08 19:04:54 UTC (rev 33)
+++ trunk/StepDataLoader/src/com/tyndalehouse/step/dataloader/loaders/SchemaLoader.java	2009-12-12 16:27:51 UTC (rev 34)
@@ -10,7 +10,9 @@
 		super();
 	}
 	
-	public SchemaLoader recreateAll() throws IOException, SQLException {		
+	public SchemaLoader recreateAll() throws IOException, SQLException {
+		//delete database first
+		//the recreate
 		executeFile("sql/com/tyndalehouse/step/dataloader/sql/create/1.schema.sql", true);
 		executeFile("sql/com/tyndalehouse/step/dataloader/sql/create/2.scripture_referencing.sql");
 		executeFile("sql/com/tyndalehouse/step/dataloader/sql/create/3.timeline.sql");




More information about the Tynstep-svn mailing list