build.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="writelatex-git-bridge" default="all">
  3. <!-- Compiler options -->
  4. <property name="compiler.debug" value="on"/>
  5. <property name="compiler.generate.no.warnings" value="off"/>
  6. <property name="compiler.args" value=""/>
  7. <property name="compiler.max.memory" value="700m"/>
  8. <patternset id="ignored.files">
  9. <exclude name="**/CVS/**"/>
  10. <exclude name="**/SCCS/**"/>
  11. <exclude name="**/RCS/**"/>
  12. <exclude name="**/rcs/**"/>
  13. <exclude name="**/.DS_Store/**"/>
  14. <exclude name="**/.svn/**"/>
  15. <exclude name="**/.pyc/**"/>
  16. <exclude name="**/.pyo/**"/>
  17. <exclude name="**/*.pyc/**"/>
  18. <exclude name="**/*.pyo/**"/>
  19. <exclude name="**/.git/**"/>
  20. <exclude name="**/*.hprof/**"/>
  21. <exclude name="**/_svn/**"/>
  22. <exclude name="**/.hg/**"/>
  23. <exclude name="**/*.lib/**"/>
  24. <exclude name="**/*~/**"/>
  25. <exclude name="**/__pycache__/**"/>
  26. <exclude name="**/.bundle/**"/>
  27. <exclude name="**/*.rbc/**"/>
  28. </patternset>
  29. <patternset id="library.patterns">
  30. <include name="*.zip"/>
  31. <include name="*.apk"/>
  32. <include name="*.war"/>
  33. <include name="*.egg"/>
  34. <include name="*.ear"/>
  35. <include name="*.ane"/>
  36. <include name="*.swc"/>
  37. <include name="*.jar"/>
  38. </patternset>
  39. <patternset id="compiler.resources">
  40. <exclude name="**/?*.java"/>
  41. <exclude name="**/?*.form"/>
  42. <exclude name="**/?*.class"/>
  43. <exclude name="**/?*.groovy"/>
  44. <exclude name="**/?*.scala"/>
  45. <exclude name="**/?*.flex"/>
  46. <exclude name="**/?*.kt"/>
  47. <exclude name="**/?*.clj"/>
  48. </patternset>
  49. <!-- Project Libraries -->
  50. <path id="library.hamcrest-core-1.3.classpath">
  51. <pathelement location="${basedir}/libs/hamcrest-core-1.3.jar"/>
  52. </path>
  53. <path id="library.hamcrest-library-1.3.classpath">
  54. <pathelement location="${basedir}/libs/hamcrest-library-1.3.jar"/>
  55. </path>
  56. <path id="library.javax.servlet-api-3.1.0.classpath">
  57. <pathelement location="${basedir}/libs/javax.servlet-api-3.1.0.jar"/>
  58. </path>
  59. <path id="library.jetty-all-9.2.3.v20140905.classpath">
  60. <pathelement location="${basedir}/libs/jetty-all-9.2.3.v20140905.jar"/>
  61. </path>
  62. <path id="library.junit-4.11.classpath">
  63. <pathelement location="${basedir}/libs/junit-4.11.jar"/>
  64. </path>
  65. <path id="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath">
  66. <pathelement location="${basedir}/libs/org.eclipse.jgit-3.5.1.201410131835-r.jar"/>
  67. </path>
  68. <path id="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath">
  69. <pathelement location="${basedir}/libs/org.eclipse.jgit.http.server-3.5.1.201410131835-r.jar"/>
  70. </path>
  71. <path id="library.gson-2.3.classpath">
  72. <pathelement location="${basedir}/libs/gson-2.3.jar"/>
  73. </path>
  74. <path id="library.async-http-client-1.8.14.classpath">
  75. <pathelement location="${basedir}/libs/async-http-client-1.8.14.jar"/>
  76. </path>
  77. <path id="library.slf4j-api-1.7.7.classpath">
  78. <pathelement location="${basedir}/libs/slf4j-api-1.7.7.jar"/>
  79. </path>
  80. <path id="library.slf4j-nop-1.7.7.classpath">
  81. <pathelement location="${basedir}/libs/slf4j-nop-1.7.7.jar"/>
  82. </path>
  83. <!-- Modules -->
  84. <!-- Module writelatex-git-bridge -->
  85. <dirname property="module.writelatex-git-bridge.basedir" file="${ant.file}"/>
  86. <property name="compiler.args.writelatex-git-bridge" value="-encoding UTF-8 -source 1.6 ${compiler.args}"/>
  87. <property name="writelatex-git-bridge.output.dir" value="${module.writelatex-git-bridge.basedir}/out/production/writelatex-git-bridge"/>
  88. <property name="writelatex-git-bridge.testoutput.dir" value="${module.writelatex-git-bridge.basedir}/out/test/writelatex-git-bridge"/>
  89. <path id="writelatex-git-bridge.module.bootclasspath">
  90. <!-- Paths to be included in compilation bootclasspath -->
  91. </path>
  92. <path id="writelatex-git-bridge.module.production.classpath">
  93. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  94. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  95. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  96. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  97. <path refid="library.hamcrest-core-1.3.classpath"/>
  98. <path refid="library.hamcrest-library-1.3.classpath"/>
  99. <path refid="library.junit-4.11.classpath"/>
  100. <path refid="library.gson-2.3.classpath"/>
  101. <path refid="library.async-http-client-1.8.14.classpath"/>
  102. <path refid="library.slf4j-api-1.7.7.classpath"/>
  103. <path refid="library.slf4j-nop-1.7.7.classpath"/>
  104. </path>
  105. <path id="writelatex-git-bridge.runtime.production.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 refid="library.gson-2.3.classpath"/>
  115. <path refid="library.async-http-client-1.8.14.classpath"/>
  116. <path refid="library.slf4j-api-1.7.7.classpath"/>
  117. <path refid="library.slf4j-nop-1.7.7.classpath"/>
  118. </path>
  119. <path id="writelatex-git-bridge.module.classpath">
  120. <pathelement location="${writelatex-git-bridge.output.dir}"/>
  121. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  122. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  123. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  124. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  125. <path refid="library.hamcrest-core-1.3.classpath"/>
  126. <path refid="library.hamcrest-library-1.3.classpath"/>
  127. <path refid="library.junit-4.11.classpath"/>
  128. <path refid="library.gson-2.3.classpath"/>
  129. <path refid="library.async-http-client-1.8.14.classpath"/>
  130. <path refid="library.slf4j-api-1.7.7.classpath"/>
  131. <path refid="library.slf4j-nop-1.7.7.classpath"/>
  132. </path>
  133. <path id="writelatex-git-bridge.runtime.module.classpath">
  134. <pathelement location="${writelatex-git-bridge.testoutput.dir}"/>
  135. <pathelement location="${writelatex-git-bridge.output.dir}"/>
  136. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  137. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  138. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  139. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  140. <path refid="library.hamcrest-core-1.3.classpath"/>
  141. <path refid="library.hamcrest-library-1.3.classpath"/>
  142. <path refid="library.junit-4.11.classpath"/>
  143. <path refid="library.gson-2.3.classpath"/>
  144. <path refid="library.async-http-client-1.8.14.classpath"/>
  145. <path refid="library.slf4j-api-1.7.7.classpath"/>
  146. <path refid="library.slf4j-nop-1.7.7.classpath"/>
  147. </path>
  148. <patternset id="excluded.from.module.writelatex-git-bridge">
  149. <patternset refid="ignored.files"/>
  150. </patternset>
  151. <patternset id="excluded.from.compilation.writelatex-git-bridge">
  152. <patternset refid="excluded.from.module.writelatex-git-bridge"/>
  153. </patternset>
  154. <path id="writelatex-git-bridge.module.sourcepath">
  155. <dirset dir="${module.writelatex-git-bridge.basedir}">
  156. <include name="src"/>
  157. </dirset>
  158. </path>
  159. <path id="writelatex-git-bridge.module.test.sourcepath">
  160. <dirset dir="${module.writelatex-git-bridge.basedir}">
  161. <include name="test"/>
  162. </dirset>
  163. </path>
  164. <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"/>
  165. <target name="compile.module.writelatex-git-bridge.production" description="Compile module writelatex-git-bridge; production classes">
  166. <mkdir dir="${writelatex-git-bridge.output.dir}"/>
  167. <javac destdir="${writelatex-git-bridge.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
  168. <compilerarg line="${compiler.args.writelatex-git-bridge}"/>
  169. <bootclasspath refid="writelatex-git-bridge.module.bootclasspath"/>
  170. <classpath refid="writelatex-git-bridge.module.production.classpath"/>
  171. <src refid="writelatex-git-bridge.module.sourcepath"/>
  172. <patternset refid="excluded.from.compilation.writelatex-git-bridge"/>
  173. </javac>
  174. <copy todir="${writelatex-git-bridge.output.dir}">
  175. <fileset dir="${module.writelatex-git-bridge.basedir}/src">
  176. <patternset refid="compiler.resources"/>
  177. <type type="file"/>
  178. </fileset>
  179. </copy>
  180. </target>
  181. <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">
  182. <mkdir dir="${writelatex-git-bridge.testoutput.dir}"/>
  183. <javac destdir="${writelatex-git-bridge.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
  184. <compilerarg line="${compiler.args.writelatex-git-bridge}"/>
  185. <bootclasspath refid="writelatex-git-bridge.module.bootclasspath"/>
  186. <classpath refid="writelatex-git-bridge.module.classpath"/>
  187. <src refid="writelatex-git-bridge.module.test.sourcepath"/>
  188. <patternset refid="excluded.from.compilation.writelatex-git-bridge"/>
  189. </javac>
  190. <copy todir="${writelatex-git-bridge.testoutput.dir}">
  191. <fileset dir="${module.writelatex-git-bridge.basedir}/test">
  192. <patternset refid="compiler.resources"/>
  193. <type type="file"/>
  194. </fileset>
  195. </copy>
  196. </target>
  197. <target name="clean.module.writelatex-git-bridge" description="cleanup module">
  198. <delete dir="${writelatex-git-bridge.output.dir}"/>
  199. <delete dir="${writelatex-git-bridge.testoutput.dir}"/>
  200. </target>
  201. <target name="clean.modules" depends="clean.module.writelatex-git-bridge">
  202. <delete dir="${module.writelatex-git-bridge.basedir}/out" />
  203. </target>
  204. <target name="init" description="Build initialization">
  205. <!-- Perform any build initialization in this target -->
  206. </target>
  207. <target name="clean" depends="clean.modules" description="cleanup all">
  208. <delete dir="${module.writelatex-git-bridge.basedir}/bin" />
  209. </target>
  210. <target name="build.modules" depends="init, clean, compile.module.writelatex-git-bridge" description="build all modules"/>
  211. <target name="init.artifacts">
  212. <property name="artifacts.temp.dir" value="${basedir}/__artifacts_temp"/>
  213. <property name="artifact.output.writelatex-git-bridge:jar" value="${basedir}/out/artifacts/writelatex_git_bridge_jar"/>
  214. <mkdir dir="${artifacts.temp.dir}"/>
  215. <property name="temp.jar.path.writelatex-git-bridge.jar" value="${artifacts.temp.dir}/writelatex-git-bridge.jar"/>
  216. </target>
  217. <target name="artifact.writelatex-git-bridge:jar" depends="init.artifacts, compile.module.writelatex-git-bridge, compile.module.writelatex-git-bridge" description="Build &#39;writelatex-git-bridge:jar&#39; artifact">
  218. <property name="artifact.temp.output.writelatex-git-bridge:jar" value="${artifacts.temp.dir}/writelatex_git_bridge_jar"/>
  219. <mkdir dir="${artifact.temp.output.writelatex-git-bridge:jar}"/>
  220. <jar destfile="${temp.jar.path.writelatex-git-bridge.jar}" duplicate="preserve" filesetmanifest="mergewithoutmain">
  221. <zipfileset dir="${writelatex-git-bridge.output.dir}"/>
  222. <zipfileset dir="${writelatex-git-bridge.testoutput.dir}"/>
  223. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/org.eclipse.jgit.http.server-3.5.1.201410131835-r.jar"/>
  224. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/junit-4.11.jar"/>
  225. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/javax.servlet-api-3.1.0.jar"/>
  226. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/hamcrest-core-1.3.jar"/>
  227. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/org.eclipse.jgit-3.5.1.201410131835-r.jar"/>
  228. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/jetty-all-9.2.3.v20140905.jar"/>
  229. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/hamcrest-library-1.3.jar"/>
  230. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/gson-2.3.jar"/>
  231. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/async-http-client-1.8.14.jar"/>
  232. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/slf4j-api-1.7.7.jar"/>
  233. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/slf4j-nop-1.7.7.jar"/>
  234. </jar>
  235. <copy file="${temp.jar.path.writelatex-git-bridge.jar}" tofile="${artifact.temp.output.writelatex-git-bridge:jar}/writelatex-git-bridge.jar"/>
  236. </target>
  237. <target name="build.all.artifacts" depends="artifact.writelatex-git-bridge:jar" description="Build all artifacts">
  238. <mkdir dir="${artifact.output.writelatex-git-bridge:jar}"/>
  239. <copy todir="${artifact.output.writelatex-git-bridge:jar}">
  240. <fileset dir="${artifact.temp.output.writelatex-git-bridge:jar}"/>
  241. </copy>
  242. <!-- Delete temporary files -->
  243. <delete dir="${artifacts.temp.dir}"/>
  244. </target>
  245. <target name="test.unit" depends="compile.module.writelatex-git-bridge.tests">
  246. <junit>
  247. <classpath>
  248. <path refid="writelatex-git-bridge.module.classpath"/>
  249. <pathelement location="${writelatex-git-bridge.testoutput.dir}"/>
  250. </classpath>
  251. <batchtest>
  252. <fileset dir="${writelatex-git-bridge.testoutput.dir}">
  253. </fileset>
  254. </batchtest>
  255. <formatter type="brief" usefile="false"/>
  256. </junit>
  257. </target>
  258. <target name="test.system" depends="package">
  259. <property name="executable-full-path"
  260. location="${module.writelatex-git-bridge.basedir}/test/system"/>
  261. <exec executable="${executable-full-path}/main.sh" />
  262. </target>
  263. <target name="test" depends="test.unit, test.system, clean" />
  264. <target name="package" depends="build.all.artifacts">
  265. <mkdir dir="${module.writelatex-git-bridge.basedir}/bin" />
  266. <copy file="${artifact.output.writelatex-git-bridge:jar}/writelatex-git-bridge.jar" tofile="${module.writelatex-git-bridge.basedir}/bin/writelatex-git-bridge.jar" />
  267. </target>
  268. <target name="all" depends="build.modules, test.unit, package, clean.modules, test.system" description="build all"/>
  269. </project>