Factored Narya into two Maven modules: core and tools.

This will allow us to properly ship narya-tools.jar to Maven Central which is
necessary for Nenya and Vilya (and any other Narya-using project) to themselves
be built.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6776 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2012-02-03 21:25:13 +00:00
parent d73949838d
commit a7e0893191
781 changed files with 173 additions and 109 deletions
+24 -30
View File
@@ -2,9 +2,9 @@
<!-- build configuration --> <!-- build configuration -->
<project name="narya" default="compile" xmlns:artifact="urn:maven-artifact-ant"> <project name="narya" default="compile" xmlns:artifact="urn:maven-artifact-ant">
<property name="deploy.dir" location="dist"/> <property name="deploy.dir" location="dist"/>
<property name="src.dir" location="src/main/java"/> <property name="src.dir" location="core/src/main/java"/>
<property name="asrc.dir" location="src/main/as"/> <property name="asrc.dir" location="core/src/main/as"/>
<property name="tsrc.dir" location="src/test/java"/> <property name="tsrc.dir" location="core/src/test/java"/>
<property name="classes.dir" location="${deploy.dir}/classes"/> <property name="classes.dir" location="${deploy.dir}/classes"/>
<property name="tclasses.dir" location="${deploy.dir}/test-classes"/> <property name="tclasses.dir" location="${deploy.dir}/test-classes"/>
@@ -13,18 +13,18 @@
<import file="${user.home}/.m2/ooo-build/${ooo-build.vers}/ooo-build.xml"/> <import file="${user.home}/.m2/ooo-build/${ooo-build.vers}/ooo-build.xml"/>
<target name="-prepare" depends="-init-ooo"> <target name="-prepare" depends="-init-ooo">
<mavendep pom="pom.xml"/> <mavendep pom="core/pom.xml" id="pom"/>
<mavendep pom="etc/as-pom.xml" pathProp="aslib.path"/> <mavendep pom="etc/as-pom.xml" pathProp="aslib.path"/>
<mavendep pom="pom.xml" id="test" scope="test"/> <mavendep pom="core/pom.xml" id="test" scope="test"/>
<mkdir dir="${deploy.dir}"/> <mkdir dir="${deploy.dir}"/>
<mkdir dir="${deploy.dir}/lib"/> <mkdir dir="${deploy.dir}/lib"/>
<mkdir dir="${classes.dir}"/> <mkdir dir="${classes.dir}"/>
<mkdir dir="${tclasses.dir}"/> <mkdir dir="${tclasses.dir}"/>
<copy todir="${classes.dir}"> <copy todir="${classes.dir}">
<fileset dir="src/main/resources" includes="**"/> <fileset dir="core/src/main/resources" includes="**"/>
</copy> </copy>
<path id="built.classpath"> <path id="built.classpath">
<path refid="pom.xml.path"/> <path refid="pom.path"/>
<pathelement location="${classes.dir}"/> <pathelement location="${classes.dir}"/>
</path> </path>
<path id="test.classpath"> <path id="test.classpath">
@@ -37,11 +37,10 @@
<target name="-preptools" depends="-prepare"> <target name="-preptools" depends="-prepare">
<!-- Turn off generation checking if enablegencheck hasn't already set this property --> <!-- Turn off generation checking if enablegencheck hasn't already set this property -->
<property name="gencheck" value="false"/> <property name="gencheck" value="false"/>
<ooojavac version="1.5" srcdir="${src.dir}" destdir="${classes.dir}" <artifact:dependencies pathId="tools.classpath">
classpathref="pom.xml.path"> <dependency groupId="com.threerings" artifactId="narya-tools" version="1.11-SNAPSHOT"/>
<include name="com/threerings/presents/tools/**"/> </artifact:dependencies>
</ooojavac> <taskdef resource="com/threerings/presents/tools.properties" classpathref="tools.classpath"/>
<taskdef resource="com/threerings/presents/tools.properties" classpathref="built.classpath"/>
</target> </target>
<target name="clean" depends="-init-ooo" description="Cleans out build results"> <target name="clean" depends="-init-ooo" description="Cleans out build results">
@@ -61,8 +60,8 @@
<target name="compile" depends="-prepare" description="Builds the Java code."> <target name="compile" depends="-prepare" description="Builds the Java code.">
<ooojavac version="1.5" srcdir="${src.dir}" destdir="${classes.dir}" <ooojavac version="1.5" srcdir="${src.dir}" destdir="${classes.dir}"
classpathref="pom.xml.path"/> classpathref="pom.path"/>
<copy todir="${tclasses.dir}"><fileset dir="src/test/resources" includes="**"/></copy> <copy todir="${tclasses.dir}"><fileset dir="core/src/test/resources" includes="**"/></copy>
<ooojavac srcdir="${tsrc.dir}" destdir="${tclasses.dir}" <ooojavac srcdir="${tsrc.dir}" destdir="${tclasses.dir}"
version="1.5" classpathref="test.classpath"/> version="1.5" classpathref="test.classpath"/>
</target> </target>
@@ -114,10 +113,7 @@
<!-- build our main jar file --> <!-- build our main jar file -->
<jar destfile="${deploy.dir}/${ant.project.name}.jar"> <jar destfile="${deploy.dir}/${ant.project.name}.jar">
<fileset dir="${classes.dir}" includes="**"/> <fileset dir="${classes.dir}" includes="**"/>
</jar> <!-- we export a small selection of classes for use by GWT -->
<!-- we export a small selection of classes for use by GWT -->
<jar destfile="${deploy.dir}/${ant.project.name}-gwt.jar">
<fileset dir="${src.dir}"> <fileset dir="${src.dir}">
<include name="**/web/server/*Exception.java"/> <include name="**/web/server/*Exception.java"/>
<include name="**/web/client/*.java"/> <include name="**/web/client/*.java"/>
@@ -133,7 +129,7 @@
classpathref="built.classpath"/> classpathref="built.classpath"/>
<!-- make sure the record class files are all compiled --> <!-- make sure the record class files are all compiled -->
<ooojavac version="1.5" srcdir="${src.dir}" destdir="${classes.dir}" <ooojavac version="1.5" srcdir="${src.dir}" destdir="${classes.dir}"
classpathref="pom.xml.path"> classpathref="pom.path">
<include name="**/*Record.java"/> <include name="**/*Record.java"/>
</ooojavac> </ooojavac>
<!-- now update the source files --> <!-- now update the source files -->
@@ -155,7 +151,7 @@
description="Generates additional methods for distributed object classes"> description="Generates additional methods for distributed object classes">
<!-- make sure the dobject class files are all compiled --> <!-- make sure the dobject class files are all compiled -->
<ooojavac version="1.5" srcdir="${src.dir}" destdir="${classes.dir}" <ooojavac version="1.5" srcdir="${src.dir}" destdir="${classes.dir}"
classpathref="pom.xml.path"> classpathref="pom.path">
<include name="**/*Object.java"/> <include name="**/*Object.java"/>
</ooojavac> </ooojavac>
<!-- now generate the associated files --> <!-- now generate the associated files -->
@@ -168,7 +164,7 @@
description="Generates marshaller and dispatcher classes for all invocation services"> description="Generates marshaller and dispatcher classes for all invocation services">
<!-- make sure the service class files are all compiled --> <!-- make sure the service class files are all compiled -->
<ooojavac version="1.5" srcdir="${src.dir}" destdir="${classes.dir}" <ooojavac version="1.5" srcdir="${src.dir}" destdir="${classes.dir}"
classpathref="pom.xml.path"> classpathref="pom.path">
<include name="**/*Service.java"/> <include name="**/*Service.java"/>
<exclude name="**/InvocationService.java"/> <exclude name="**/InvocationService.java"/>
</ooojavac> </ooojavac>
@@ -198,7 +194,7 @@
<fileset dir="${tsrc.dir}" includes="**/*Service.java"/> <fileset dir="${tsrc.dir}" includes="**/*Service.java"/>
</genservice> </genservice>
<gencppservice header="etc/SOURCE_HEADER" classpathref="built.classpath" <gencppservice header="etc/SOURCE_HEADER" classpathref="built.classpath"
cpproot="src/cpp" checking="${gencheck}"> cpproot="core/src/cpp" checking="${gencheck}">
<fileset dir="${src.dir}" includes="**/RegistrationService.java"/> <fileset dir="${src.dir}" includes="**/RegistrationService.java"/>
</gencppservice> </gencppservice>
</target> </target>
@@ -207,7 +203,7 @@
description="Generates sender and decoder classes for all invocation receivers"> description="Generates sender and decoder classes for all invocation receivers">
<!-- make sure the receiver class files are all compiled --> <!-- make sure the receiver class files are all compiled -->
<ooojavac version="1.5" srcdir="${src.dir}" destdir="${classes.dir}" <ooojavac version="1.5" srcdir="${src.dir}" destdir="${classes.dir}"
classpathref="pom.xml.path"> classpathref="pom.path">
<include name="**/*Receiver.java"/> <include name="**/*Receiver.java"/>
<exclude name="**/InvocationReceiver.java"/> <exclude name="**/InvocationReceiver.java"/>
</ooojavac> </ooojavac>
@@ -223,7 +219,7 @@
everything for it --> everything for it -->
<target name="gencppstream" depends="-preptools,compile" <target name="gencppstream" depends="-preptools,compile"
description="Generates C++ streamable classes."> description="Generates C++ streamable classes.">
<gencppstreamable classpathref="built.classpath" cpproot="src/cpp" checking="${gencheck}"> <gencppstreamable classpathref="built.classpath" cpproot="core/src/cpp" checking="${gencheck}">
<generate class="com.threerings.presents.client.InvocationReceiver$Registration"/> <generate class="com.threerings.presents.client.InvocationReceiver$Registration"/>
<generate class="com.threerings.presents.data.ClientObject"/> <generate class="com.threerings.presents.data.ClientObject"/>
<generate class="com.threerings.presents.dobj.DEvent"/> <generate class="com.threerings.presents.dobj.DEvent"/>
@@ -266,18 +262,16 @@
<target name="install" depends="dist,aslib" <target name="install" depends="dist,aslib"
description="Installs artifacts to local Maven repository."> description="Installs artifacts to local Maven repository.">
<maveninstall file="${deploy.dir}/${ant.project.name}.jar" pom="pom.xml"/> <maveninstall file="pom.xml" pom="pom.xml"/>
<maveninstall file="${deploy.dir}/${ant.project.name}.jar" pom="etc/tools-pom.xml"/> <maveninstall file="${deploy.dir}/${ant.project.name}.jar" pom="core/pom.xml"/>
<maveninstall file="${deploy.dir}/${ant.project.name}-gwt.jar" pom="etc/gwt-pom.xml"/>
<maveninstall file="${deploy.dir}/${ant.project.name}lib.swc" pom="etc/as-pom.xml"/> <maveninstall file="${deploy.dir}/${ant.project.name}lib.swc" pom="etc/as-pom.xml"/>
</target> </target>
<target name="deploy" depends="dist,aslib,tests,javadoc" <target name="deploy" depends="dist,aslib,tests,javadoc"
description="Deploys our build artifacts to a Maven repository."> description="Deploys our build artifacts to a Maven repository.">
<mavendeploy file="${deploy.dir}/${ant.project.name}.jar" pom="pom.xml" <mavendeploy file="pom.xml" pom="pom.xml"/>
<mavendeploy file="${deploy.dir}/${ant.project.name}.jar" pom="core/pom.xml"
srcdir="${src.dir}" docdir="${deploy.dir}/docs"/> srcdir="${src.dir}" docdir="${deploy.dir}/docs"/>
<mavendeploy file="${deploy.dir}/${ant.project.name}.jar" pom="etc/tools-pom.xml"/>
<mavendeploy file="${deploy.dir}/${ant.project.name}-gwt.jar" pom="etc/gwt-pom.xml"/>
<mavendeploy file="${deploy.dir}/${ant.project.name}lib.swc" pom="etc/as-pom.xml"/> <mavendeploy file="${deploy.dir}/${ant.project.name}lib.swc" pom="etc/as-pom.xml"/>
</target> </target>
</project> </project>
View File
+96
View File
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.threerings</groupId>
<artifactId>narya-parent</artifactId>
<version>1.11-SNAPSHOT</version>
</parent>
<artifactId>narya</artifactId>
<packaging>jar</packaging>
<name>Narya Core</name>
<dependencies>
<!-- exported dependencies -->
<dependency>
<groupId>com.threerings</groupId>
<artifactId>ooo-util</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</dependency>
<!-- optional dependencies -->
<dependency>
<groupId>com.samskivert</groupId>
<artifactId>depot</artifactId>
<version>1.5</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>1.6.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.threerings</groupId>
<artifactId>gwt-utils</artifactId>
<version>1.5</version>
<optional>true</optional>
</dependency>
<!-- test/build dependencies -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.7.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- include the source files in our main jar for use by GWT -->
<resources>
<resource>
<directory>${project.build.sourceDirectory}</directory>
<includes>
<include>**/*.gwt.xml</include>
<include>**/web/server/*Exception.java</include>
<include>**/web/client/*.java</include>
<include>**/web/gwt/*.java</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
</build>
</project>

Some files were not shown because too many files have changed in this diff Show More