Moving toward more standard project layout.

This commit is contained in:
Michael Bayne
2010-08-27 17:47:07 +00:00
parent 5a97565eaa
commit 6778ada227
14 changed files with 42 additions and 55 deletions
+23 -5
View File
@@ -8,8 +8,10 @@
<!-- various directories used when building things -->
<property name="src.dir" value="src/java"/>
<property name="test.dir" value="src/test/java"/>
<property name="deploy.dir" value="dist"/>
<property name="classes.dir" value="${deploy.dir}/classes"/>
<property name="tclasses.dir" value="${deploy.dir}/test-classes"/>
<property name="javadoc.dir" value="${deploy.dir}/docs"/>
<property name="libs.dir" value="lib"/>
@@ -28,6 +30,7 @@
<mkdir dir="${deploy.dir}"/>
<mkdir dir="${deploy.dir}/lib"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${tclasses.dir}"/>
<mkdir dir="${javadoc.dir}"/>
<copy todir="${classes.dir}">
<fileset dir="${src.dir}" includes="**/*.tmpl"/>
@@ -67,8 +70,10 @@
<taskdef name="grecord" classname="com.samskivert.depot.tools.GenRecordTask"
classpathref="classpath"/>
<!-- make sure the record class files are all compiled -->
<javac srcdir="src/java" destdir="${classes.dir}"
<javac destdir="${classes.dir}"
debug="on" optimize="${build.optimize}" deprecation="on">
<src name="${src.dir}"/>
<src name="${test.dir}"/>
<classpath refid="classpath"/>
<include name="**/*Record.java"/>
</javac>
@@ -105,6 +110,18 @@
</javac>
</target>
<target name="test-compile" depends="compile" description="Compiles test classes.">
<javac srcdir="${test.dir}" destdir="${tclasses.dir}" includeAntRuntime="false"
debug="on" optimize="${build.optimize}" source="1.5" target="1.5" encoding="utf-8">
<classpath>
<pathelement location="${classes.dir}"/>
<path refid="classpath"/>
</classpath>
<compilerarg value="-Xlint"/>
<compilerarg value="-Xlint:-serial"/>
</javac>
</target>
<!-- build the javadoc documentation -->
<target name="javadoc" depends="prepare,compute-builds"
description="Generates javadoc documentation.">
@@ -125,11 +142,11 @@
</target>
<!-- a target for rebuilding everything -->
<target name="all" depends="clean,prepare,compile,javadoc,dist"
<target name="all" depends="clean,compile,javadoc,dist"
description="Cleans and rebuilds everything including documentation."/>
<!-- runs our unit tests -->
<target name="tests" depends="prepare,compile" description="Runs the unit tests.">
<target name="tests" depends="test-compile" description="Runs the unit tests.">
<!-- allows passing -Dtest=NamePrefix to restrict to subset of tests -->
<property name="test" value=""/>
<taskdef name="unit" classpathref="classpath"
@@ -137,14 +154,15 @@
<unit printsummary="off" haltonfailure="yes" fork="${junit.fork}">
<classpath>
<pathelement location="${classes.dir}"/>
<pathelement location="${tclasses.dir}"/>
<pathelement location="${basedir}"/> <!-- for rsrc/ -->
<fileset dir="${deploy.dir}/lib" includes="*.jar"/>
</classpath>
<sysproperty key="com.samskivert.depot.debug" value="${debug}"/>
<formatter type="brief" usefile="false"/>
<batchtest>
<fileset dir="${src.dir}">
<include name="**/tests/**/${test}*Test.java"/>
<fileset dir="${test.dir}">
<include name="**/${test}*Test.java"/>
<exclude name="com/samskivert/depot/EHCacheAdapter.java" unless="ehcache.present"/>
</fileset>
</batchtest>
@@ -18,15 +18,13 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.depot.tests;
package com.samskivert.depot;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Arrays;
import com.samskivert.depot.Key;
import com.samskivert.depot.PersistentRecord;
import com.samskivert.depot.expression.ColumnExp;
import com.samskivert.depot.annotation.Column;
import com.samskivert.depot.annotation.Id;
@@ -18,17 +18,13 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.depot.tests;
package com.samskivert.depot;
import java.util.Set;
import org.junit.Test;
import static org.junit.Assert.*;
import com.samskivert.depot.DepotRepository;
import com.samskivert.depot.PersistenceContext;
import com.samskivert.depot.PersistentRecord;
/**
* Tests the handling of our various supported field types.
*/
@@ -18,7 +18,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.depot.tests;
package com.samskivert.depot;
import java.lang.reflect.Field;
@@ -27,7 +27,6 @@ import static org.junit.Assert.*;
import com.samskivert.util.ByteEnum;
import com.samskivert.depot.PersistentRecord;
import com.samskivert.depot.impl.FieldMarshaller;
/**
@@ -18,7 +18,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.depot.tests;
package com.samskivert.depot;
import java.util.Arrays;
@@ -18,16 +18,14 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.depot.tests;
package com.samskivert.depot;
import org.junit.Test;
import static org.junit.Assert.*;
import com.samskivert.depot.Key;
import com.samskivert.depot.expression.ColumnExp;
import com.samskivert.depot.impl.DepotUtil;
import static org.junit.Assert.*;
/**
* Tests some super basic {@link Key} stuff.
*/
@@ -18,10 +18,8 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.depot.tests;
package com.samskivert.depot;
import com.samskivert.depot.Key;
import com.samskivert.depot.PersistentRecord;
import com.samskivert.depot.expression.ColumnExp;
import com.samskivert.depot.annotation.Id;
@@ -18,23 +18,19 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.depot.tests;
package com.samskivert.depot;
import java.util.Collections;
import com.google.common.collect.Sets;
import com.samskivert.util.RandomUtil;
import com.samskivert.depot.Exps;
import com.samskivert.depot.Key;
import com.samskivert.depot.KeySet;
import com.samskivert.depot.PersistentRecord;
import com.samskivert.depot.annotation.Computed;
import com.samskivert.depot.clause.Where;
import org.junit.Test;
import static org.junit.Assert.*;
import com.samskivert.depot.annotation.Computed;
import com.samskivert.depot.clause.Where;
/**
* Tests queries.
*/
@@ -18,7 +18,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.depot.tests;
package com.samskivert.depot;
import java.sql.Date;
import java.sql.Timestamp;
@@ -28,8 +28,6 @@ import java.util.Properties;
import com.samskivert.jdbc.StaticConnectionProvider;
import com.samskivert.util.Calendars;
import com.samskivert.depot.PersistenceContext;
import static org.junit.Assert.*;
/**
@@ -18,7 +18,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.depot.tests;
package com.samskivert.depot;
import java.io.Serializable;
import java.util.Collections;
@@ -28,7 +28,6 @@ import java.util.Map;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.samskivert.depot.CacheAdapter;
import com.samskivert.util.Tuple;
/**
@@ -18,20 +18,18 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.depot.tests;
package com.samskivert.depot;
import java.sql.Date;
import java.sql.Timestamp;
import com.samskivert.depot.Key;
import com.samskivert.depot.PersistentRecord;
import com.samskivert.util.StringUtil;
import com.samskivert.depot.annotation.Entity;
import com.samskivert.depot.annotation.Id;
import com.samskivert.depot.annotation.Index;
import com.samskivert.depot.expression.ColumnExp;
import com.samskivert.util.StringUtil;
/**
* A test persistent object.
*/
@@ -18,14 +18,10 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.depot.tests;
package com.samskivert.depot;
import java.util.Set;
import com.samskivert.depot.DepotRepository;
import com.samskivert.depot.PersistenceContext;
import com.samskivert.depot.PersistentRecord;
/**
* A test tool for the Depot repository services.
*/
@@ -18,7 +18,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.depot.tests;
package com.samskivert.depot;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
@@ -37,11 +37,6 @@ import com.samskivert.util.ByteEnum;
import com.samskivert.depot.Key;
import com.samskivert.depot.expression.ColumnExp;
import com.samskivert.depot.DepotRepository;
import com.samskivert.depot.PersistenceContext;
import com.samskivert.depot.PersistentRecord;
import com.samskivert.depot.Transformer;
import com.samskivert.depot.Transformers;
import com.samskivert.depot.annotation.Column;
import com.samskivert.depot.annotation.Id;
import com.samskivert.depot.annotation.Transform;
@@ -18,7 +18,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.depot.tests;
package com.samskivert.depot;
import java.util.EnumSet;
import java.util.Set;
@@ -30,8 +30,6 @@ import com.google.common.collect.Sets;
import com.samskivert.util.ByteEnum;
import com.samskivert.depot.Transformers;
/**
* Tests the stock transformers.
*/