| <!-- |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| * |
| * Author: dhanji@google.com (Dhanji R. Prasanna) |
| * anorth@google.com (Alex North) |
| --> |
| <project name="waveinabox" default="dist"> |
| <description>Wave in a Box</description> |
| |
| <property file="build.properties"/> |
| |
| <!-- Import classpath definitions. --> |
| <import file="${build.classpath.path}"/> |
| |
| <!-- Import macros --> |
| <import file="${build.macros.path}"/> |
| |
| <property name="gwt.args" value=""/> |
| |
| <!-- Standard time properties and a timestamp pattern --> |
| <tstamp> |
| <format property="DSTAMP_INT" pattern="-yyyy-MM-dd"/> |
| </tstamp> |
| <tstamp> |
| <format property="LOG_STAMP" pattern="yyyy-MM-dd_HH-mm-ss"/> |
| </tstamp> |
| <property name="release.robot.name" value="wave-robot-client${DSTAMP_INT}.zip"/> |
| <property name="release.robot.python.name" value="wave-robot-python-client${DSTAMP_INT}.zip"/> |
| <property name="build.log.filename" value="build_${LOG_STAMP}.log"/> |
| |
| <!--===== |
| Initialization |
| =====--> |
| |
| <target name="clean" description="Cleans up the build artifacts and temporary directories"> |
| <delete dir="${build.dir}"/> |
| <delete dir="${dist.dir}"/> |
| <delete dir="${doc.dir}"/> |
| <delete dir="${gen.dir}"/> |
| <delete dir="${test.out.dir}"/> |
| <delete dir="war/waveharness"/> |
| <delete dir="war/webclient"/> |
| </target> |
| |
| <target name="init-logging" description="Enable logging to file"> |
| <mkdir dir="${build.log.dir}"/> |
| <record name="${build.log.dir}/${build.log.filename}" |
| loglevel="verbose" append="false"/> |
| <echo message="Logging to ${build.log.dir}/${build.log.filename}"/> |
| </target> |
| |
| <target name="init" depends="init-logging"> |
| <mkdir dir="${build.proto.dir}"/> |
| <mkdir dir="${build.messages.dir}"/> |
| <mkdir dir="${build.src.dir}"/> |
| <mkdir dir="${build.test.dir}"/> |
| <mkdir dir="${coverage.dir}"/> |
| <mkdir dir="${dist.dir}"/> |
| <mkdir dir="${staging.dir}"/> |
| <mkdir dir="${dep}"/> |
| <mkdir dir="${test.out.dir}"/> |
| </target> |
| |
| <!-- === IDE helper targets === --> |
| |
| <!-- TODO(danilatos): Make this work on Windows as well. For now, |
| windows users can just copy the .project_template file manually. --> |
| <target name="eclipse" description="Generates an eclipse .project file"> |
| <exec executable="tools/eclipse.sh"/> |
| </target> |
| |
| <!--===== |
| Builds |
| ======--> |
| |
| <!-- === |
| Protocol buffer targets. |
| Compiles generated proto sources. See build-proto.xml for generating |
| proto sources from .proto files. |
| === --> |
| <target name="compile-proto-dep"> |
| <uptodate targetfile="${dep}/compile-proto" property="skip.compile-proto"> |
| <srcfiles dir="${lib.dir}"/> |
| <srcfiles dir="${src.proto.dir}" includes="**/*.java"/> |
| </uptodate> |
| </target> |
| |
| <target name="compile-proto" depends="init, compile-proto-dep" |
| unless="skip.compile-proto" description="Compiles protocol buffers"> |
| <buildjava destdir="${build.proto.dir}"> |
| <src path="${src.proto.dir}"/> |
| <classpath> |
| <path refid="libpath"/> |
| </classpath> |
| </buildjava> |
| <touch file="${dep}/compile-proto"/> |
| </target> |
| |
| <!-- === GXP targets === --> |
| <target name="gen-gxp-dep"> |
| <uptodate targetfile="${dep}/gen-gxp" property="skip.gen-gxp"> |
| <srcfiles dir="${lib.runtime}/gxp"/> |
| <srcfiles dir="${src.dir}" includes="org/waveprotocol/box/server/gxp/*.gxp"/> |
| </uptodate> |
| </target> |
| |
| <!-- Generates the Java files from templates --> |
| <target name="gen-gxp" description="Generates GXP files" |
| depends="init, gen-gxp-dep" unless="skip.gen-gxp"> |
| <gxpc srcdir="${src.dir}" srcpaths="${src.dir}" destdir="${gen.dir}/gxp" |
| target="org.waveprotocol.box.server.gxp" /> |
| <touch file="${dep}/gen-gxp"/> |
| </target> |
| |
| <target name="compile-gxp-dep"> |
| <uptodate targetfile="${dep}/compile-gxp" property="skip.compile-gxp"> |
| <srcfiles dir="${gen.dir}/gxp"/> |
| </uptodate> |
| </target> |
| |
| <target name="compile-gxp" depends="init, gen-gxp, compile-gxp-dep" |
| unless="skip.compile-gxp" description="Compiles GXP classes"> |
| <buildjava destdir="${build.src.dir}"> |
| <src path="${gen.dir}/gxp" /> |
| <classpath> |
| <path refid="libpath"/> |
| </classpath> |
| </buildjava> |
| <touch file="${dep}/compile-gxp"/> |
| </target> |
| |
| <!-- === PST targets === --> |
| <target name="dist-pst-dep"> |
| <uptodate targetfile="${dep}/dist-pst" property="skip.dist-pst"> |
| <srcfiles dir="${lib.dir}"/> |
| <srcfiles dir="${src.dir}" includes="org/waveprotocol/pst/**/*.java"/> |
| </uptodate> |
| </target> |
| |
| <target name="dist-pst" depends="init, dist-pst-dep, compile-proto" |
| unless="skip.dist-pst" description="Builds the PST tool"> |
| <delete dir="${build.dir}/pst"/> |
| <mkdir dir="${build.dir}/pst"/> |
| <javac srcdir="${src.dir}" destdir="${build.dir}/pst" includes="org/waveprotocol/pst/**/*"> |
| <classpath> |
| <path refid="libpath"/> |
| <path location="${build.proto.dir}/"/> |
| </classpath> |
| </javac> |
| <copy todir="${build.dir}/pst"> |
| <fileset dir="${src.dir}"> |
| <include name="org/waveprotocol/pst/**/*.st"/> |
| <include name="org/waveprotocol/pst/**/properties"/> |
| </fileset> |
| </copy> |
| <jar destfile="${dist.dir}/pst.jar" basedir="${build.dir}/pst"/> |
| <touch file="${dep}/dist-pst"/> |
| </target> |
| |
| <target name="gen-messages-dep"> |
| <uptodate targetfile="${dep}/gen-messages" property="skip.gen-messages"> |
| <srcfiles dir="${src.dir}" includes="org/waveprotocol/pst/**/*.st"/> |
| <srcfiles dir="${lib.dir}"/> |
| <srcfiles dir="${dist.dir}" includes="pst.jar"/> |
| <srcfiles dir="${build.proto.dir}"/> |
| </uptodate> |
| </target> |
| |
| <target name="gen-messages" depends="dist-pst, compile-proto, gen-messages-dep" |
| unless="skip.gen-messages" |
| description="Generates the DTO message source"> |
| <delete dir="${gen.dir}/messages"/> |
| <mkdir dir="${gen.dir}/messages"/> |
| <pstmessage proto="${build.proto.dir}/org/waveprotocol/box/common/comms/WaveClientRpc.class"/> |
| <pstmessage proto="${build.proto.dir}/org/waveprotocol/box/search/SearchProto.class"/> |
| <pstmessage proto="${build.proto.dir}/org/waveprotocol/box/profile/ProfilesProto.class"/> |
| <pstmessage proto="${build.proto.dir}/org/waveprotocol/box/server/rpc/Rpc.class"/> |
| <pstmessage proto="${build.proto.dir}/org/waveprotocol/box/attachment/AttachmentProto.class"/> |
| <pstmessage proto="${build.proto.dir}/org/waveprotocol/wave/federation/Proto.class"/> |
| <pstmessage proto="${build.proto.dir}/org/waveprotocol/wave/concurrencycontrol/ClientServer.class"/> |
| <pstmessage proto="${build.proto.dir}/org/waveprotocol/wave/diff/Diff.class"/> |
| <touch file="${dep}/gen-messages"/> |
| </target> |
| |
| <target name="compile-messages-dep"> |
| <uptodate targetfile="${dep}/compile-messages" property="skip.compile-messages"> |
| <srcfiles dir="${gen.dir}/messages"/> |
| <srcfiles dir="${src.dir}" includes="org/waveprotocol/wave/communication/**"/> |
| </uptodate> |
| </target> |
| |
| <target name="compile-messages" depends="gen-messages, compile-messages-dep" |
| unless="skip.compile-messages" description="Compiles the DTO messages"> |
| <!-- |
| The generated DTOs depend on code in wave/communication. At this stage of |
| the build process, that code is still in source form, so it is exposed to |
| javac via sourcepath not classpath. Since javac is too aggressive, and |
| gobbles up those files and compiles them too, a subsequent step has to |
| go and delete those overzealously compiled files, because they will be |
| compiled again later. |
| --> |
| <javac srcdir="${gen.dir}/messages" |
| destdir="${build.messages.dir}" |
| sourcepath="${src.dir}"> |
| <classpath> |
| <path refid="libpath"/> |
| <pathelement location="${build.proto.dir}"/> |
| </classpath> |
| </javac> |
| <delete dir="${build.messages.dir}/org/waveprotocol/wave/communication"/> |
| <touch file="${dep}/compile-messages"/> |
| </target> |
| |
| <!-- === Java targets === --> |
| <target name="compile-dep"> |
| <uptodate targetfile="${dep}/compile" property="skip.compile"> |
| <srcfiles dir="${lib.dir}"/> |
| <srcfiles dir="${src.dir}" includes="**"/> |
| <srcfiles dir="${gen.dir}" includes="**"/> |
| </uptodate> |
| </target> |
| |
| <target name="compile" depends="compile-proto, compile-gxp, compile-messages, compile-dep" |
| unless="skip.compile" description="Compiles all source"> |
| <subant target="compile" inheritall="true"> |
| <property name="build.common.path" location="build-common.xml"/> |
| <fileset dir="${src.dir}" includes="*/**/build.xml"/> |
| </subant> |
| |
| <!-- copy non binary resources in src tree to output classpath. Why? --> |
| <copy todir="${build.src.dir}"> |
| <fileset dir="${src.dir}"> |
| <include name="**/*.xml"/> |
| <include name="**/*.html"/> |
| <include name="**/*.properties"/> |
| <include name="**/*.proto"/> |
| </fileset> |
| </copy> |
| |
| <touch file="${dep}/compile"/> |
| </target> |
| |
| <target name="check-test-dependencies" description="Checks dependencies for test compilation are |
| available"> |
| <available file="third_party/test/emma/emma_ant.jar" property="test.dependencies.1.present"/> |
| <available file="third_party/test/emma/emma.jar" property="test.dependencies.2.present"/> |
| <available file="third_party/test/junit/junit.jar" property="test.dependencies.3.present"/> |
| <available file="third_party/test/junit/src.jar" property="test.dependencies.4.present"/> |
| <fail message="${missing.dependencies.test} third_party/test/emma/emma_ant.jar" unless="test.dependencies.1.present"/> |
| <fail message="${missing.dependencies.test} third_party/test/emma/emma.jar" unless="test.dependencies.2.present"/> |
| <fail message="${missing.dependencies.test} third_party/test/junit/junit.jar" unless="test.dependencies.3.present"/> |
| <fail message="${missing.dependencies.test} third_party/test/junit/src.jar" unless="test.dependencies.4.present"/> |
| </target> |
| |
| <target name="compile-tests" depends="check-test-dependencies,compile" |
| description="Compiles all unit tests"> |
| <!-- Pull in the Emma tasks --> |
| <taskdef resource="emma_ant.properties" classpathref="test.libpath"/> |
| <buildjava destdir="${build.test.dir}"> |
| <src path="${test.dir}" /> |
| <classpath> |
| <path refid="libpath"/> |
| <path refid="test.libpath"/> |
| <pathelement location="${build.src.dir}"/> |
| <pathelement location="${build.proto.dir}"/> |
| </classpath> |
| </buildjava> |
| |
| <!-- copy non binary resources in src tree to output classpath --> |
| <copy todir="${build.test.dir}"> |
| <fileset dir="${test.dir}"> |
| <include name="**/*.xml"/> |
| <include name="**/*.html"/> |
| <include name="**/*.properties"/> |
| </fileset> |
| </copy> |
| </target> |
| |
| <!--===== |
| Tests |
| ======--> |
| |
| <target name="test" depends="compile-tests" description= |
| "Runs all the unit tests in the project excluding external persistence"> |
| <!-- EMMA disabled due to incompatibility with EventSerializer --> |
| <!-- Tests are run in a single new VM, when forkmode is set to once --> |
| <runtests forkmode="once" coverage="true"> |
| <fileset dir="${test.dir}"> |
| <include name="**/*Test.java"/> |
| <exclude name="**/*GwtTest.java"/> |
| <exclude name="**/*LargeTest.java"/> |
| <!-- Exclude all persistence tests --> |
| <exclude name="**/server/persistence/**"/> |
| </fileset> |
| <!-- Include the persistence tests that aren't run elsewhere --> |
| <fileset dir="${test.dir}"> |
| <include name="**/server/persistence/memory/*Test.java"/> |
| <include name="**/server/persistence/file/*Test.java"/> |
| </fileset> |
| </runtests> |
| </target> |
| |
| <target name="test-large" depends="compile-tests" description="Runs large tests (slow)"> |
| <runtests forkmode="perTest" coverage="true"> |
| <fileset dir="${test.dir}"> |
| <include name="**/*LargeTest.java"/> |
| </fileset> |
| </runtests> |
| </target> |
| |
| <target name="test-gwt" depends="compile-tests" description="Runs GWT tests (slow)"> |
| <!-- Fork per test due to GWT test failure in shared JVM --> |
| <!-- EMMA disabled due to GWT incompatibility --> |
| <runtests forkmode="perTest" coverage="false"> |
| <fileset dir="${test.dir}"> |
| <include name="**/*GwtTest.java"/> |
| </fileset> |
| </runtests> |
| </target> |
| |
| <target name="test-mongodb" depends="compile-tests" description="Runs the MongoDb tests"> |
| <runtests forkmode="once" coverage="true"> |
| <fileset dir="${test.dir}"> |
| <!-- Include the mongoDb tests --> |
| <include name="**/server/persistence/mongodb/**/*Test.java"/> |
| </fileset> |
| </runtests> |
| </target> |
| |
| <target name="test-all" depends="compile-tests, test, test-gwt, test-large, test-mongodb" |
| description="Run all tests, including GWT"/> |
| |
| <!--===== |
| GWT |
| ======--> |
| |
| <target name="compile-gwt-dep"> |
| <uptodate targetfile="${dep}/compile-gwt" property="skip.compile-gwt"> |
| <srcfiles dir="${lib.dir}"/> |
| <srcfiles dir="${src.dir}"/> |
| <srcfiles dir="${gen.dir}/messages"/> |
| </uptodate> |
| </target> |
| |
| <target name="compile-gwt" depends="compile, compile-gwt-dep" |
| description="GWT compile to production JavaScript" unless="skip.compile-gwt"> |
| <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler"> |
| <classpath> |
| <pathelement location="${src.dir}"/> |
| <pathelement location="${gen.dir}/messages"/> |
| <path refid="libpath"/> |
| <path refid="test.libpath"/> |
| </classpath> |
| <jvmarg value="-Xmx512M"/> |
| <!-- Small Javascript size. --> |
| <arg line="-style OBFUSCATED"/> |
| <!-- Do not include class and package names in compiled JS. --> |
| <arg line="-XdisableClassMetadata"/> |
| <arg line="-XdisableCastChecking"/> |
| <arg line="-localWorkers 4"/> |
| <arg line="${gwt.args}"/> |
| <arg value="org.waveprotocol.box.webclient.WebClientProd"/> |
| </java> |
| <!-- Only one GWT compile output is valid at any one time. --> |
| <delete file="${dep}/compile-gwt-dev"/> |
| <touch file="${dep}/compile-gwt"/> |
| </target> |
| |
| <target name="compile-gwt-dev-dep"> |
| <uptodate targetfile="${dep}/compile-gwt-dev" property="skip.compile-gwt-dev"> |
| <srcfiles dir="${lib.dir}"/> |
| <srcfiles dir="${src.dir}"/> |
| <srcfiles dir="${gen.dir}/messages"/> |
| </uptodate> |
| </target> |
| |
| <target name="compile-gwt-demo" depends="compile, compile-gwt-dev-dep" |
| description="GWT compile to a 'demo' production JavaScript with remote logging enabled." |
| unless="skip.compile-gwt-dev"> |
| <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler"> |
| <classpath> |
| <pathelement location="${src.dir}"/> |
| <pathelement location="${gen.dir}/messages"/> |
| <path refid="libpath"/> |
| <path refid="test.libpath"/> |
| </classpath> |
| <jvmarg value="-Xmx1024M"/> |
| <!-- Human-readable JS. --> |
| <arg line="-style PRETTY"/> |
| <!-- Assertions on. --> |
| <arg line="-ea"/> |
| <arg line="${gwt.args}"/> |
| <arg value="org.waveprotocol.box.webclient.WebClientDemo"/> |
| </java> |
| <!-- Only one GWT compile output is valid at any one time. --> |
| <delete file="${dep}/compile-gwt"/> |
| <touch file="${dep}/compile-gwt-dev"/> |
| </target> |
| |
| <target name="compile-gwt-dev" depends="compile, compile-gwt-dev-dep" |
| description="GWT compile of a restricted set of permutations suitable for development." |
| unless="skip.compile-gwt-dev"> |
| <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler"> |
| <classpath> |
| <pathelement location="${src.dir}"/> |
| <pathelement location="${gen.dir}/messages"/> |
| <path refid="libpath"/> |
| <path refid="test.libpath"/> |
| </classpath> |
| <jvmarg value="-Xmx512M"/> |
| <!-- Human-readable JS. --> |
| <arg line="-style PRETTY"/> |
| <!-- Less optimal JS, but faster compile. --> |
| <arg line="-draftCompile"/> |
| <!-- Assertions on. --> |
| <arg line="-ea"/> |
| <arg line="${gwt.args}"/> |
| <arg value="org.waveprotocol.box.webclient.WebClientDev"/> |
| </java> |
| <!-- Only one GWT compile output is valid at any one time. --> |
| <delete file="${dep}/compile-gwt"/> |
| <touch file="${dep}/compile-gwt-dev"/> |
| </target> |
| |
| <!--===== |
| Hosted |
| ======--> |
| |
| <target name="hosted-gwt" depends="compile" |
| description="Runs the hosted mode server, for debugging the GWT client in a JVM."> |
| <java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode"> |
| <classpath> |
| <pathelement location="${src.dir}"/> |
| <pathelement location="${gen.dir}/messages"/> |
| <path refid="libpath"/> |
| </classpath> |
| <jvmarg value="-Xmx512M"/> |
| <jvmarg value="-ea"/> |
| <jvmarg value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8001"/> |
| <arg value="-noserver" /> |
| <arg line="-bindAddress 0.0.0.0" /> |
| <arg line="${gwt.args}"/> |
| <arg value="org.waveprotocol.box.webclient.WebClientProd"/> |
| </java> |
| </target> |
| |
| <target name="editor-hosted" depends="compile" description="Runs the editor harness through the GWT hosted mode server, for debugging in a JVM."> |
| <java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode"> |
| <classpath> |
| <pathelement location="${src.dir}"/> |
| <path refid="libpath"/> |
| </classpath> |
| <jvmarg value="-Xmx512M"/> |
| <jvmarg value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8001"/> |
| <arg line="${gwt.args}"/> |
| <arg line="-war war"/> |
| <arg line="-startupUrl org.waveprotocol.wave.client.editor.harness.EditorTest/EditorTest.html"/> |
| <arg value="org.waveprotocol.wave.client.editor.harness.EditorTest"/> |
| </java> |
| </target> |
| |
| <target name="waveharness-hosted" depends="compile" description="Runs the wave panel harness through the GWT hosted mode server, for debugging in a JVM."> |
| <java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode"> |
| <classpath> |
| <pathelement location="${src.dir}"/> |
| <path refid="libpath"/> |
| </classpath> |
| <jvmarg value="-Xmx512M"/> |
| <jvmarg value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8001"/> |
| <arg line="${gwt.args}"/> |
| <arg line="-war war"/> |
| <arg line="-startupUrl waveharness/UndercurrentHarness.html"/> |
| <arg value="org.waveprotocol.wave.client.testing.UndercurrentHarness"/> |
| </java> |
| </target> |
| |
| <!--===== |
| Server |
| ======--> |
| |
| <target name="check-server-config" description="Checks server configuration is available"> |
| <available file="server.config" property="server.config.present"/> |
| <fail message="You need to copy server.config.example to server.config and edit it." |
| unless="server.config.present"/> |
| </target> |
| |
| <target name="run-server" depends="compile, check-server-config" |
| description="Runs Wave in a Box server"> |
| <java failonerror="true" fork="true" classname="org.waveprotocol.box.server.ServerMain"> |
| <classpath> |
| <path refid="libpath"/> |
| <path location="${build.src.dir}"/> |
| <path location="${build.proto.dir}"/> |
| <path location="${build.messages.dir}"/> |
| </classpath> |
| <jvmarg value="-Dorg.eclipse.jetty.LEVEL=DEBUG"/> |
| <jvmarg value="-Djava.security.auth.login.config=jaas.config"/> |
| <jvmarg value="-Dwave.server.config=server.config"/> |
| </java> |
| </target> |
| |
| <target name="debug-server" depends="compile, check-server-config" |
| description="Runs Wave in a Box server with debugging"> |
| <java failonerror="true" fork="true" classname="org.waveprotocol.box.server.ServerMain"> |
| <classpath> |
| <path refid="libpath"/> |
| <path location="${build.src.dir}"/> |
| <path location="${build.proto.dir}"/> |
| <path location="${build.messages.dir}"/> |
| </classpath> |
| <jvmarg value="-Dorg.eclipse.jetty.LEVEL=DEBUG"/> |
| <jvmarg value="-Djava.security.auth.login.config=jaas.config"/> |
| <jvmarg value="-Dwave.server.config=server.config"/> |
| <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=10898"/> |
| </java> |
| </target> |
| |
| <!--===== |
| Distribution |
| ======--> |
| |
| <target name="stage-dep"> |
| <uptodate targetfile="${dep}/stage" property="skip.stage"> |
| <srcfiles dir="${lib.runtime}" includes="**/*.jar"/> |
| <srcfiles dir="${lib.codegen}" includes="gwt/gwt-user.jar"/> |
| <srcfiles dir="${build.src.dir}"/> |
| </uptodate> |
| </target> |
| |
| <target name="stage" depends="compile, stage-dep" |
| description="Copy classes and runtime dependencies to the staging directory" unless="skip.stage"> |
| <!-- Unzip and copy all the runtime deps into a staging dir --> |
| <unzip dest="${staging.dir}"> |
| <fileset dir="${lib.runtime}"> |
| <include name="*/*.jar"/> |
| </fileset> |
| <fileset dir="${lib.codegen}"> |
| <include name="gwt/gwt-user.jar"/> |
| <include name="gwt/gwt-dev.jar"/> |
| </fileset> |
| </unzip> |
| <copy todir="${staging.dir}" preservelastmodified="true"> |
| <fileset dir="${build.src.dir}"/> |
| <fileset dir="${build.proto.dir}"/> |
| <fileset dir="${build.messages.dir}"/> |
| </copy> |
| <touch file="${dep}/stage"/> |
| </target> |
| |
| <target name="dist" depends="test, compile-gwt, dist-server, dist-export-import" |
| description="Compiles, tests and creates the binary executable."> |
| </target> |
| |
| <target name="dist-proto" depends="compile-proto" description="Builds the proto jar"> |
| <jar destfile="${dist.dir}/proto.jar" basedir="${build.proto.dir}"/> |
| <jar destfile="${dist.dir}/proto-src.jar" basedir="${src.proto.dir}"/> |
| <jar destfile="${dist.dir}/proto-msg.jar" basedir="${gen.dir}/messages"/> |
| </target> |
| |
| <target name="dist-libraries" depends="compile, dist-proto, dist-pst" description="Builds the distribution libraries"> |
| <subant target="dist" inheritall="true"> |
| <fileset dir="${src.dir}" includes="*/**/build.xml"/> |
| </subant> |
| </target> |
| |
| <target name="dist-robot-client-api" depends="compile"> |
| <jar destfile="${robotclient.jar.out}"> |
| <fileset dir="${staging.dir}"> |
| <include name="com/google/wave/api/*" /> |
| <include name="com/google/wave/api/event/**/*" /> |
| <include name="com/google/wave/api/impl/**/*" /> |
| <include name="com/google/wave/api/oauth/**/*" /> |
| <include name="com/google/wave/api/v2/**/*" /> |
| </fileset> |
| <manifest> |
| <attribute name="Specification-Vendor" value="The Apache Software Foundation"/> |
| <attribute name="Specification-Title" value="Apache Wave Robot Client API"/> |
| <attribute name="Specification-Version" value="${waveinabox.version}"/> |
| <attribute name="Implementation-Vendor" value="The Apache Software Foundation"/> |
| <attribute name="Implementation-Title" value="Apache Wave Robot Client API"/> |
| <attribute name="Implementation-Version" value="${waveinabox.version}"/> |
| <attribute name="Built-By" value="${user.name}"/> |
| </manifest> |
| <metainf dir="." includes="LICENSE, NOTICE" /> |
| </jar> |
| </target> |
| |
| <!-- dist-api is broken due to non-runnable dependencies in the waveserver directory. TODO: fix. --> |
| <target name="dist-api" depends="stage" description="Assembles the Wave in a Box API"> |
| <jar destfile="${api.jar.out}"> |
| <fileset dir="${staging.dir}"> |
| <include name="org/waveprotocol/**/*" /> |
| <!-- Only exclude runnable targets --> |
| <exclude name="org/waveprotocol/box/consoleclient/**/*" /> |
| <exclude name="org/waveprotocol/box/server/waveserver/**/*" /> |
| </fileset> |
| <manifest> |
| <attribute name="Specification-Vendor" value="The Apache Software Foundation"/> |
| <attribute name="Specification-Title" value="Apache Wave Reference Impl API"/> |
| <attribute name="Specification-Version" value="${waveinabox.version}"/> |
| <attribute name="Implementation-Vendor" value="The Apache Software Foundation"/> |
| <attribute name="Implementation-Title" value="Apache Wave Reference Impl API"/> |
| <attribute name="Implementation-Version" value="${waveinabox.version}"/> |
| <attribute name="Built-By" value="${user.name}"/> |
| </manifest> |
| <metainf dir="." includes="LICENSE, NOTICE" /> |
| </jar> |
| </target> |
| |
| <!-- A healthy mix of hyphens and underscores never hurt anyone. Sigh. --> |
| <target name="dist-server-dep"> |
| <!-- Note: this check is still very slow (~30secs) --> |
| <uptodate targetfile="${dep}/dist-server" property="skip.dist-server"> |
| <srcfiles dir="${staging.dir}"/> |
| </uptodate> |
| </target> |
| |
| <target name="dist-server" depends="stage, dist-server-dep" description="Assembles the Wave in a Box server" unless="skip.dist-server"> |
| <jar destfile="${server.jar.out}"> |
| <fileset dir="${staging.dir}"> |
| <include name="META-INF/services/*" /> |
| <include name="com/mongodb/**/*" /> |
| <include name="com/glines/socketio/**/*" /> |
| <include name="com/google/common/**/*" /> |
| <include name="com/google/gson/**/*" /> |
| <include name="com/google/gxp/**/*" /> |
| <include name="com/google/gwt/core/client/**/*" /> |
| <include name="com/google/gwt/logging/**/*" /> |
| <include name="com/google/gwt/user/server/**/*" /> |
| <include name="com/google/gwt/user/client/rpc/**/*" /> |
| <include name="com/google/inject/**/*" /> |
| <include name="com/google/protobuf/**/*" /> |
| <include name="com/google/wave/**/*" /> |
| <include name="gnu/inet/**/*" /> |
| <include name="javax/inject/**/*" /> |
| <include name="javax/servlet/**/*" /> |
| <include name="javax/xml/**/*" /> |
| <include name="net/oauth/**/*" /> |
| <include name="org/aopalliance/**/*" /> |
| <include name="org/apache/commons/cli/**/*" /> |
| <include name="org/apache/commons/codec/**/*" /> |
| <include name="org/apache/commons/collections/**/*" /> |
| <include name="org/apache/commons/configuration/**/*" /> |
| <include name="org/apache/commons/fileupload/**/*" /> |
| <include name="org/apache/commons/httpclient/**/*" /> |
| <include name="org/apache/commons/lang/**/*" /> |
| <include name="org/apache/commons/logging/**/*" /> |
| <include name="org/apache/lucene/**/*" /> |
| <include name="org/apache/commons/io/**/*" /> |
| <include name="org/bson/**/*" /> |
| <include name="org/codehaus/jackson/**/*" /> |
| <include name="org/dom4j/**/*" /> |
| <include name="org/eclipse/**/*" /> |
| <include name="org/jdom/**/*" /> |
| <include name="org/jivesoftware/**/*" /> |
| <include name="org/joda/time/**/*" /> |
| <include name="org/json/**/*" /> |
| <include name="org/waveprotocol/**/*" /> |
| <include name="org/xmlpull/**/*" /> |
| <include name="org/xmpp/**/*" /> |
| <exclude name="org/waveprotocol/box/webclient/**/*"/> |
| <exclude name="org/waveprotocol/box/consoleclient/**/*"/> |
| <exclude name="org/waveprotocol/box/expimp/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/*"/> |
| <exclude name="org/waveprotocol/wave/client/account/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/autohide/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/clipboard/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/common/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/concurrencycontrol/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/debug/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/doodad/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/paging/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/render/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/scheduler/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/scroll/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/state/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/testing/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/uibuilder/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/uibuilder/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/util/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/wave/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/wavepanel/**/*"/> |
| <exclude name="org/waveprotocol/wave/client/widget/**/*"/> |
| <exclude name="com/google/api/client/**/*"/> |
| </fileset> |
| <manifest> |
| <!-- Application entry point --> |
| <attribute name="Main-Class" |
| value="org.waveprotocol.box.server.ServerMain"/> |
| <attribute name="Specification-Vendor" value="The Apache Software Foundation"/> |
| <attribute name="Specification-Title" value="Apache Wave Server"/> |
| <attribute name="Specification-Version" value="${waveinabox.version}"/> |
| <attribute name="Implementation-Vendor" value="The Apache Software Foundation"/> |
| <attribute name="Implementation-Title" value="Apache Wave Server"/> |
| <attribute name="Implementation-Version" value="${waveinabox.version}"/> |
| <attribute name="Built-By" value="${user.name}"/> |
| </manifest> |
| <metainf dir="." includes="LICENSE, NOTICE" /> |
| </jar> |
| <touch file="${dep}/dist-server"/> |
| </target> |
| |
| <target name="dist-export-import-dep"> |
| <uptodate targetfile="${dep}/dist-export-import" property="skip.dist-export-import"> |
| <srcfiles dir="${staging.dir}"/> |
| </uptodate> |
| </target> |
| |
| <target name="dist-export-import" depends="stage, dist-export-import-dep" description="Assembles the Wave Export/Import utilities" unless="skip.dist-export-import"> |
| <jar destfile="${export-import.jar.out}"> |
| <fileset dir="${staging.dir}"> |
| <include name="org/waveprotocol/box/server/common/**/*"/> |
| <include name="org/waveprotocol/box/expimp/**/*"/> |
| <include name="org/waveprotocol/box/server/persistence/**/*"/> |
| <include name="org/waveprotocol/box/server/rpc/**/*"/> |
| <include name="org/waveprotocol/wave/**/*"/> |
| <include name="org/waveprotocol/protobuf/**/*"/> |
| <include name="org/waveprotocol/box/attachment/**/*"/> |
| <include name="org/waveprotocol/box/common/comms/**/*"/> |
| <include name="org/apache/http/**/*"/> |
| <include name="org/apache/commons/**/*"/> |
| <include name="com/google/wave/api/**/*"/> |
| <include name="com/google/common/**/*"/> |
| <include name="com/google/gson/**/*"/> |
| <include name="com/google/protobuf/**/*"/> |
| <include name="org/codehaus/jackson/**/*"/> |
| <include name="org/json/**/*"/> |
| <include name="net/oauth/**/*"/> |
| </fileset> |
| <manifest> |
| <attribute name="Specification-Vendor" value="The Apache Software Foundation"/> |
| <attribute name="Specification-Title" value="Apache Wave Export/Import Utilities"/> |
| <attribute name="Specification-Version" value="${waveinabox.version}"/> |
| <attribute name="Implementation-Vendor" value="The Apache Software Foundation"/> |
| <attribute name="Implementation-Title" value="Apache Wave Export/Import Utilities"/> |
| <attribute name="Implementation-Version" value="${waveinabox.version}"/> |
| <attribute name="Built-By" value="${user.name}"/> |
| </manifest> |
| <metainf dir="." includes="LICENSE, NOTICE" /> |
| </jar> |
| <touch file="${dep}/dist-export-import"/> |
| </target> |
| |
| <!-- This rule should be run whenever the build configuration (i.e. build files, libraries) is changed --> |
| <target name="dist-test" depends="dist, test" description="Runs all the unit tests in the project against the jar files"> |
| <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"> |
| <classpath refid="test.libpath"/> |
| </taskdef> |
| |
| <junit fork="yes" showoutput="no" haltonerror="yes"> |
| <classpath> |
| <path refid="libpath"/> |
| <path refid="test.libpath"/> |
| <pathelement location="${server.jar.out}"/> |
| <pathelement location="${build.test.dir}"/> |
| </classpath> |
| <batchtest> |
| <fileset dir="${test.dir}"> |
| <include name="**/*Test.java"/> |
| </fileset> |
| </batchtest> |
| <formatter type="xml"/> |
| </junit> |
| </target> |
| |
| <!--===== |
| Release creation |
| ======--> |
| |
| <target name="release" depends="release-bin,release-src" description="Creates unsigned release"> |
| </target> |
| |
| <target name="release-src" description="Creates unsigned tar+zip for server source release"> |
| <delete file="${dist.dir}/${release.src.path}.tar.bz2" /> |
| <delete file="${dist.dir}/${release.src.path}.zip" /> |
| <tar destfile="${dist.dir}/${release.src.path}.tar" longfile="gnu"> |
| <!-- Include everything except built stuff in tree --> |
| <tarfileset dir="." prefix="${release.src.path}"> |
| <exclude name="build/" /> |
| <exclude name="dist/" /> |
| <exclude name="gen/" /> |
| <exclude name="test_out/" /> |
| <exclude name="third_party/test/emma/*.jar" /> |
| <exclude name="third_party/test/junit/*.jar" /> |
| <exclude name="war/webclient/" /> |
| </tarfileset> |
| <!-- Setup permissions --> |
| <tarfileset dir="." prefix="${release.src.path}" filemode="755"> |
| <include name="check-certificates.sh" /> |
| <include name="make_cert.sh" /> |
| <include name="run-server.sh" /> |
| <include name="run-export.sh" /> |
| <include name="run-import.sh" /> |
| </tarfileset> |
| </tar> |
| <bzip2 destfile="${dist.dir}/${release.src.path}.tar.bz2" src="${dist.dir}/${release.src.path}.tar" /> |
| <zip destfile="${dist.dir}/${release.src.path}.zip"> |
| <tarfileset src="${dist.dir}/${release.src.path}.tar" /> |
| </zip> |
| <delete file="${dist.dir}/${release.src.path}.tar" /> |
| </target> |
| |
| <target name="release-bin" depends="dist" description="Creates unsigned tar+zip for server binary release"> |
| <delete file="${dist.dir}/${release.bin.path}.tar.bz2"/> |
| <delete file="${dist.dir}/${release.bin.path}.zip"/> |
| <tar destfile="${dist.dir}/${release.bin.path}.tar" longfile="gnu"> |
| <!-- Actual jars --> |
| <tarfileset dir="${dist.dir}" includes="*.jar" prefix="${release.bin.path}/dist" /> |
| <tarfileset dir="${basedir}" prefix="${release.bin.path}"> |
| <!-- Documentation + Licensing --> |
| <include name="CHANGES" /> |
| <include name="DISCLAIMER" /> |
| <include name="KEYS" /> |
| <include name="LICENSE" /> |
| <include name="NOTICE" /> |
| <include name="README" /> |
| <include name="README.export-import" /> |
| <include name="RELEASE-NOTES" /> |
| <!-- Helper scripts --> |
| <include name="process-script-args.sh" /> |
| <!-- Configuration --> |
| <include name="build.properties" /> |
| <include name="jaas.config" /> |
| <include name="jsongadgets.json" /> |
| <include name="server.config.example" /> |
| <include name="server.federation.config.example" /> |
| </tarfileset> |
| <!-- Helper scripts --> |
| <tarfileset dir="${basedir}" prefix="${release.bin.path}" filemode="755"> |
| <include name="check-certificates.sh" /> |
| <include name="make_cert.sh" /> |
| <include name="run-server.sh" /> |
| <include name="run-export.sh" /> |
| <include name="run-import.sh" /> |
| </tarfileset> |
| <!-- WAR static content --> |
| <tarfileset dir="." includes="war/" prefix="${release.bin.path}" /> |
| </tar> |
| <bzip2 destfile="${dist.dir}/${release.bin.path}.tar.bz2" src="${dist.dir}/${release.bin.path}.tar" /> |
| <zip destfile="${dist.dir}/${release.bin.path}.zip"> |
| <tarfileset src="${dist.dir}/${release.bin.path}.tar" /> |
| </zip> |
| <delete file="${dist.dir}/${release.bin.path}.tar"/> |
| </target> |
| |
| <!-- TODO: re-use these when the api code is useful again --> |
| <target name="release-robot-client-api" depends="dist-libraries" description="Creates a zip for the java robot client release"> |
| <delete file="${dist.dir}/${release.robot.name}"/> |
| <zip destfile="${dist.dir}/${release.robot.name}"> |
| <zipfileset dir="${dist.dir}" includes="model.jar"/> |
| <zipfileset dir="${dist.dir}" includes="wave-api-${waveinabox.version}.jar"/> |
| <zipfileset dir="${lib.dir}/runtime/commons_codec" includes="*.jar"/> |
| <zipfileset dir="${lib.dir}/runtime/gson" includes="*.jar"/> |
| <zipfileset dir="${lib.dir}/runtime/jdo" includes="*.jar"/> |
| <zipfileset dir="${lib.dir}/runtime/oauth" includes="*.jar"/> |
| <zipfileset dir="${basedir}" includes="COPYING"/> |
| </zip> |
| </target> |
| |
| <target name="release-robot-client-python-api" description="Creates a zip for the python robot client release"> |
| <delete file="${dist.dir}/${release.robot.python.name}"/> |
| <zip destfile="${dist.dir}/${release.robot.python.name}"> |
| <zipfileset dir="${src.dir}/python/api" includes="**/*.py"/> |
| <zipfileset dir="${basedir}" includes="COPYING"/> |
| </zip> |
| </target> |
| |
| <!--===== |
| Other |
| ======--> |
| |
| <target name="get-third-party" description="Download third party dependencies"> |
| <get src="http://repo1.maven.org/maven2/emma/emma/2.0.5312/emma-2.0.5312.jar" |
| dest="third_party/test/emma/emma.jar"/> |
| <get src="http://repo1.maven.org/maven2/emma/emma_ant/2.1.5320/emma_ant-2.1.5320.jar" |
| dest="third_party/test/emma/emma_ant.jar"/> |
| <get src="http://search.maven.org/remotecontent?filepath=junit/junit/4.10/junit-4.10.jar" |
| dest="third_party/test/junit/junit.jar"/> |
| <get src="http://search.maven.org/remotecontent?filepath=junit/junit/4.10/junit-4.10-sources.jar" |
| dest="third_party/test/junit/src.jar"/> |
| </target> |
| |
| <target name="doc" depends="stage" description="Builds the Java documentation for the mode, protocol, and Wave in a Box"> |
| <javadoc sourcepath="${src.dir}" destdir="${docs.dir}" linksource="yes" author="yes" protected="yes" |
| windowtitle="${ant.project.name} Documentation"> |
| <classpath> |
| <pathelement location="${staging.dir}" /> |
| <path refid="libpath"/> |
| <path location="${build.proto.dir}"/> |
| </classpath> |
| <doctitle>${ant.project.name}</doctitle> |
| <footer><a href="http://www.waveprotocol.org/">Wave Project<a/></footer> |
| </javadoc> |
| </target> |
| </project> |