build.xml 12 KB

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