build.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="writelatex-git-bridge" default="all">
  3. <!-- Uncomment the following property if no tests compilation is needed -->
  4. <!--
  5. <property name="skip.tests" value="true"/>
  6. -->
  7. <!-- Compiler options -->
  8. <property name="compiler.debug" value="on"/>
  9. <property name="compiler.generate.no.warnings" value="off"/>
  10. <property name="compiler.args" value=""/>
  11. <property name="compiler.max.memory" value="700m"/>
  12. <patternset id="ignored.files">
  13. <exclude name="**/CVS/**"/>
  14. <exclude name="**/SCCS/**"/>
  15. <exclude name="**/RCS/**"/>
  16. <exclude name="**/rcs/**"/>
  17. <exclude name="**/.DS_Store/**"/>
  18. <exclude name="**/.svn/**"/>
  19. <exclude name="**/.pyc/**"/>
  20. <exclude name="**/.pyo/**"/>
  21. <exclude name="**/*.pyc/**"/>
  22. <exclude name="**/*.pyo/**"/>
  23. <exclude name="**/.git/**"/>
  24. <exclude name="**/*.hprof/**"/>
  25. <exclude name="**/_svn/**"/>
  26. <exclude name="**/.hg/**"/>
  27. <exclude name="**/*.lib/**"/>
  28. <exclude name="**/*~/**"/>
  29. <exclude name="**/__pycache__/**"/>
  30. <exclude name="**/.bundle/**"/>
  31. <exclude name="**/*.rbc/**"/>
  32. </patternset>
  33. <patternset id="library.patterns">
  34. <include name="*.zip"/>
  35. <include name="*.apk"/>
  36. <include name="*.war"/>
  37. <include name="*.egg"/>
  38. <include name="*.ear"/>
  39. <include name="*.ane"/>
  40. <include name="*.swc"/>
  41. <include name="*.jar"/>
  42. </patternset>
  43. <patternset id="compiler.resources">
  44. <exclude name="**/?*.java"/>
  45. <exclude name="**/?*.form"/>
  46. <exclude name="**/?*.class"/>
  47. <exclude name="**/?*.groovy"/>
  48. <exclude name="**/?*.scala"/>
  49. <exclude name="**/?*.flex"/>
  50. <exclude name="**/?*.kt"/>
  51. <exclude name="**/?*.clj"/>
  52. </patternset>
  53. <property name="project.jdk.classpath" value="jdk.classpath.1.7"/>
  54. <!-- Project Libraries -->
  55. <path id="library.hamcrest-core-1.3.classpath">
  56. <pathelement location="${basedir}/libs/hamcrest-core-1.3.jar"/>
  57. </path>
  58. <path id="library.hamcrest-library-1.3.classpath">
  59. <pathelement location="${basedir}/libs/hamcrest-library-1.3.jar"/>
  60. </path>
  61. <path id="library.javax.servlet-api-3.1.0.classpath">
  62. <pathelement location="${basedir}/libs/javax.servlet-api-3.1.0.jar"/>
  63. </path>
  64. <path id="library.jetty-all-9.2.3.v20140905.classpath">
  65. <pathelement location="${basedir}/libs/jetty-all-9.2.3.v20140905.jar"/>
  66. </path>
  67. <path id="library.junit-4.11.classpath">
  68. <pathelement location="${basedir}/libs/junit-4.11.jar"/>
  69. </path>
  70. <path id="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath">
  71. <pathelement location="${basedir}/libs/org.eclipse.jgit-3.5.1.201410131835-r.jar"/>
  72. </path>
  73. <path id="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath">
  74. <pathelement location="${basedir}/libs/org.eclipse.jgit.http.server-3.5.1.201410131835-r.jar"/>
  75. </path>
  76. <!-- Modules -->
  77. <!-- Module writelatex-git-bridge -->
  78. <dirname property="module.writelatex-git-bridge.basedir" file="${ant.file}"/>
  79. <property name="module.jdk.classpath.writelatex-git-bridge" value="${project.jdk.classpath}"/>
  80. <property name="compiler.args.writelatex-git-bridge" value="-encoding UTF-8 -source 1.6 ${compiler.args}"/>
  81. <property name="writelatex-git-bridge.output.dir" value="${module.writelatex-git-bridge.basedir}/out/production/writelatex-git-bridge"/>
  82. <property name="writelatex-git-bridge.testoutput.dir" value="${module.writelatex-git-bridge.basedir}/out/test/writelatex-git-bridge"/>
  83. <path id="writelatex-git-bridge.module.bootclasspath">
  84. <!-- Paths to be included in compilation bootclasspath -->
  85. </path>
  86. <path id="writelatex-git-bridge.module.production.classpath">
  87. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  88. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  89. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  90. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  91. <path refid="library.hamcrest-core-1.3.classpath"/>
  92. <path refid="library.hamcrest-library-1.3.classpath"/>
  93. <path refid="library.junit-4.11.classpath"/>
  94. </path>
  95. <path id="writelatex-git-bridge.runtime.production.module.classpath">
  96. <pathelement location="${writelatex-git-bridge.output.dir}"/>
  97. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  98. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  99. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  100. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  101. <path refid="library.hamcrest-core-1.3.classpath"/>
  102. <path refid="library.hamcrest-library-1.3.classpath"/>
  103. <path refid="library.junit-4.11.classpath"/>
  104. </path>
  105. <path id="writelatex-git-bridge.module.classpath">
  106. <pathelement location="${writelatex-git-bridge.output.dir}"/>
  107. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  108. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  109. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  110. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  111. <path refid="library.hamcrest-core-1.3.classpath"/>
  112. <path refid="library.hamcrest-library-1.3.classpath"/>
  113. <path refid="library.junit-4.11.classpath"/>
  114. </path>
  115. <path id="writelatex-git-bridge.runtime.module.classpath">
  116. <pathelement location="${writelatex-git-bridge.testoutput.dir}"/>
  117. <pathelement location="${writelatex-git-bridge.output.dir}"/>
  118. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  119. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  120. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  121. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  122. <path refid="library.hamcrest-core-1.3.classpath"/>
  123. <path refid="library.hamcrest-library-1.3.classpath"/>
  124. <path refid="library.junit-4.11.classpath"/>
  125. </path>
  126. <patternset id="excluded.from.module.writelatex-git-bridge">
  127. <patternset refid="ignored.files"/>
  128. </patternset>
  129. <patternset id="excluded.from.compilation.writelatex-git-bridge">
  130. <patternset refid="excluded.from.module.writelatex-git-bridge"/>
  131. </patternset>
  132. <path id="writelatex-git-bridge.module.sourcepath">
  133. <dirset dir="${module.writelatex-git-bridge.basedir}">
  134. <include name="src"/>
  135. </dirset>
  136. </path>
  137. <path id="writelatex-git-bridge.module.test.sourcepath">
  138. <dirset dir="${module.writelatex-git-bridge.basedir}">
  139. <include name="test"/>
  140. </dirset>
  141. </path>
  142. <target name="compile.module.writelatex-git-bridge" depends="compile.module.writelatex-git-bridge.production,compile.module.writelatex-git-bridge.tests" description="Compile module writelatex-git-bridge"/>
  143. <target name="compile.module.writelatex-git-bridge.production" description="Compile module writelatex-git-bridge; production classes">
  144. <mkdir dir="${writelatex-git-bridge.output.dir}"/>
  145. <javac destdir="${writelatex-git-bridge.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
  146. <compilerarg line="${compiler.args.writelatex-git-bridge}"/>
  147. <bootclasspath refid="writelatex-git-bridge.module.bootclasspath"/>
  148. <classpath refid="writelatex-git-bridge.module.production.classpath"/>
  149. <src refid="writelatex-git-bridge.module.sourcepath"/>
  150. <patternset refid="excluded.from.compilation.writelatex-git-bridge"/>
  151. </javac>
  152. <copy todir="${writelatex-git-bridge.output.dir}">
  153. <fileset dir="${module.writelatex-git-bridge.basedir}/src">
  154. <patternset refid="compiler.resources"/>
  155. <type type="file"/>
  156. </fileset>
  157. </copy>
  158. </target>
  159. <target name="compile.module.writelatex-git-bridge.tests" depends="compile.module.writelatex-git-bridge.production" description="compile module writelatex-git-bridge; test classes" unless="skip.tests">
  160. <mkdir dir="${writelatex-git-bridge.testoutput.dir}"/>
  161. <javac destdir="${writelatex-git-bridge.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
  162. <compilerarg line="${compiler.args.writelatex-git-bridge}"/>
  163. <bootclasspath refid="writelatex-git-bridge.module.bootclasspath"/>
  164. <classpath refid="writelatex-git-bridge.module.classpath"/>
  165. <src refid="writelatex-git-bridge.module.test.sourcepath"/>
  166. <patternset refid="excluded.from.compilation.writelatex-git-bridge"/>
  167. </javac>
  168. <copy todir="${writelatex-git-bridge.testoutput.dir}">
  169. <fileset dir="${module.writelatex-git-bridge.basedir}/test">
  170. <patternset refid="compiler.resources"/>
  171. <type type="file"/>
  172. </fileset>
  173. </copy>
  174. </target>
  175. <target name="clean.module.writelatex-git-bridge" description="cleanup module">
  176. <delete dir="${writelatex-git-bridge.output.dir}"/>
  177. <delete dir="${writelatex-git-bridge.testoutput.dir}"/>
  178. </target>
  179. <target name="init" description="Build initialization">
  180. <!-- Perform any build initialization in this target -->
  181. </target>
  182. <target name="test" depends="compile.module.writelatex-git-bridge.tests">
  183. <junit>
  184. <classpath>
  185. <path refid="writelatex-git-bridge.module.classpath"/>
  186. <pathelement location="${writelatex-git-bridge.testoutput.dir}"/>
  187. </classpath>
  188. <batchtest>
  189. <fileset dir="${writelatex-git-bridge.testoutput.dir}">
  190. </fileset>
  191. </batchtest>
  192. <formatter type="brief" usefile="false"/>
  193. </junit>
  194. </target>
  195. <target name="clean" depends="clean.module.writelatex-git-bridge" description="cleanup all"/>
  196. <target name="build.modules" depends="init, clean, compile.module.writelatex-git-bridge" description="build all modules"/>
  197. <target name="all" depends="build.modules" description="build all"/>
  198. </project>