build.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  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. <path id="library.sqlite-jdbc-3.7.2.classpath">
  84. <pathelement location="${basedir}/libs/sqlite-jdbc-3.7.2.jar"/>
  85. </path>
  86. <!-- Modules -->
  87. <!-- Module writelatex-git-bridge -->
  88. <dirname property="module.writelatex-git-bridge.basedir" file="${ant.file}"/>
  89. <property name="compiler.args.writelatex-git-bridge" value="-encoding UTF-8 -source 1.6 ${compiler.args}"/>
  90. <property name="writelatex-git-bridge.output.dir" value="${module.writelatex-git-bridge.basedir}/out/production/writelatex-git-bridge"/>
  91. <property name="writelatex-git-bridge.testoutput.dir" value="${module.writelatex-git-bridge.basedir}/out/test/writelatex-git-bridge"/>
  92. <property name="writelatex-git-bridge.testoutput.unit.dir" value="${module.writelatex-git-bridge.basedir}/out/test/writelatex-git-bridge/unit"/>
  93. <property name="writelatex-git-bridge.testoutput.system.dir" value="${module.writelatex-git-bridge.basedir}/out/test/writelatex-git-bridge/system"/>
  94. <path id="writelatex-git-bridge.module.bootclasspath">
  95. <!-- Paths to be included in compilation bootclasspath -->
  96. </path>
  97. <path id="writelatex-git-bridge.module.production.classpath">
  98. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  99. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  100. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  101. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  102. <path refid="library.hamcrest-core-1.3.classpath"/>
  103. <path refid="library.hamcrest-library-1.3.classpath"/>
  104. <path refid="library.junit-4.11.classpath"/>
  105. <path refid="library.gson-2.3.classpath"/>
  106. <path refid="library.async-http-client-1.8.14.classpath"/>
  107. <path refid="library.slf4j-api-1.7.7.classpath"/>
  108. <path refid="library.slf4j-nop-1.7.7.classpath"/>
  109. <path refid="library.sqlite-jdbc-3.7.2.classpath"/>
  110. </path>
  111. <path id="writelatex-git-bridge.runtime.production.module.classpath">
  112. <pathelement location="${writelatex-git-bridge.output.dir}"/>
  113. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  114. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  115. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  116. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  117. <path refid="library.hamcrest-core-1.3.classpath"/>
  118. <path refid="library.hamcrest-library-1.3.classpath"/>
  119. <path refid="library.junit-4.11.classpath"/>
  120. <path refid="library.gson-2.3.classpath"/>
  121. <path refid="library.async-http-client-1.8.14.classpath"/>
  122. <path refid="library.slf4j-api-1.7.7.classpath"/>
  123. <path refid="library.slf4j-nop-1.7.7.classpath"/>
  124. <path refid="library.sqlite-jdbc-3.7.2.classpath"/>
  125. </path>
  126. <path id="writelatex-git-bridge.module.classpath">
  127. <pathelement location="${writelatex-git-bridge.output.dir}"/>
  128. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  129. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  130. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  131. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  132. <path refid="library.hamcrest-core-1.3.classpath"/>
  133. <path refid="library.hamcrest-library-1.3.classpath"/>
  134. <path refid="library.junit-4.11.classpath"/>
  135. <path refid="library.gson-2.3.classpath"/>
  136. <path refid="library.async-http-client-1.8.14.classpath"/>
  137. <path refid="library.slf4j-api-1.7.7.classpath"/>
  138. <path refid="library.slf4j-nop-1.7.7.classpath"/>
  139. <path refid="library.sqlite-jdbc-3.7.2.classpath"/>
  140. </path>
  141. <path id="writelatex-git-bridge.runtime.module.classpath">
  142. <pathelement location="${writelatex-git-bridge.testoutput.dir}"/>
  143. <pathelement location="${writelatex-git-bridge.output.dir}"/>
  144. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  145. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  146. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  147. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  148. <path refid="library.hamcrest-core-1.3.classpath"/>
  149. <path refid="library.hamcrest-library-1.3.classpath"/>
  150. <path refid="library.junit-4.11.classpath"/>
  151. <path refid="library.gson-2.3.classpath"/>
  152. <path refid="library.async-http-client-1.8.14.classpath"/>
  153. <path refid="library.slf4j-api-1.7.7.classpath"/>
  154. <path refid="library.slf4j-nop-1.7.7.classpath"/>
  155. <path refid="library.sqlite-jdbc-3.7.2.classpath"/>
  156. </path>
  157. <patternset id="excluded.from.module.writelatex-git-bridge">
  158. <patternset refid="ignored.files"/>
  159. </patternset>
  160. <patternset id="excluded.from.compilation.writelatex-git-bridge">
  161. <patternset refid="excluded.from.module.writelatex-git-bridge"/>
  162. </patternset>
  163. <path id="writelatex-git-bridge.module.sourcepath">
  164. <dirset dir="${module.writelatex-git-bridge.basedir}">
  165. <include name="src"/>
  166. </dirset>
  167. </path>
  168. <path id="writelatex-git-bridge.module.test.unit.sourcepath">
  169. <dirset dir="${module.writelatex-git-bridge.basedir}/test">
  170. <include name="unit"/>
  171. </dirset>
  172. </path>
  173. <path id="writelatex-git-bridge.module.test.system.sourcepath">
  174. <dirset dir="${module.writelatex-git-bridge.basedir}/test">
  175. <include name="system"/>
  176. </dirset>
  177. </path>
  178. <target name="compile.module.writelatex-git-bridge" depends="compile.module.writelatex-git-bridge.production,compile.module.writelatex-git-bridge.tests.unit" description="Compile module writelatex-git-bridge"/>
  179. <target name="compile.module.writelatex-git-bridge.production" description="Compile module writelatex-git-bridge; production classes">
  180. <mkdir dir="${writelatex-git-bridge.output.dir}"/>
  181. <javac destdir="${writelatex-git-bridge.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
  182. <compilerarg line="${compiler.args.writelatex-git-bridge}"/>
  183. <bootclasspath refid="writelatex-git-bridge.module.bootclasspath"/>
  184. <classpath refid="writelatex-git-bridge.module.production.classpath"/>
  185. <src refid="writelatex-git-bridge.module.sourcepath"/>
  186. <patternset refid="excluded.from.compilation.writelatex-git-bridge"/>
  187. </javac>
  188. <copy todir="${writelatex-git-bridge.output.dir}">
  189. <fileset dir="${module.writelatex-git-bridge.basedir}/src">
  190. <patternset refid="compiler.resources"/>
  191. <type type="file"/>
  192. </fileset>
  193. </copy>
  194. </target>
  195. <target name="compile.module.writelatex-git-bridge.tests.unit" depends="compile.module.writelatex-git-bridge.production" description="compile module writelatex-git-bridge; test classes" unless="skip.tests">
  196. <mkdir dir="${writelatex-git-bridge.testoutput.unit.dir}"/>
  197. <javac destdir="${writelatex-git-bridge.testoutput.unit.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
  198. <compilerarg line="${compiler.args.writelatex-git-bridge}"/>
  199. <bootclasspath refid="writelatex-git-bridge.module.bootclasspath"/>
  200. <classpath refid="writelatex-git-bridge.module.classpath"/>
  201. <src refid="writelatex-git-bridge.module.test.unit.sourcepath"/>
  202. <patternset refid="excluded.from.compilation.writelatex-git-bridge"/>
  203. </javac>
  204. <copy todir="${writelatex-git-bridge.testoutput.unit.dir}">
  205. <fileset dir="${module.writelatex-git-bridge.basedir}/test">
  206. <patternset refid="compiler.resources"/>
  207. <type type="file"/>
  208. </fileset>
  209. </copy>
  210. </target>
  211. <target name="compile.module.writelatex-git-bridge.tests.system" depends="compile.module.writelatex-git-bridge.production" description="compile module writelatex-git-bridge; test classes" unless="skip.tests">
  212. <mkdir dir="${writelatex-git-bridge.testoutput.system.dir}"/>
  213. <javac destdir="${writelatex-git-bridge.testoutput.system.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
  214. <compilerarg line="${compiler.args.writelatex-git-bridge}"/>
  215. <bootclasspath refid="writelatex-git-bridge.module.bootclasspath"/>
  216. <classpath refid="writelatex-git-bridge.module.classpath"/>
  217. <src refid="writelatex-git-bridge.module.test.system.sourcepath"/>
  218. <patternset refid="excluded.from.compilation.writelatex-git-bridge"/>
  219. </javac>
  220. <copy todir="${writelatex-git-bridge.testoutput.system.dir}">
  221. <fileset dir="${module.writelatex-git-bridge.basedir}/test">
  222. <patternset refid="compiler.resources"/>
  223. <type type="file"/>
  224. </fileset>
  225. </copy>
  226. </target>
  227. <target name="clean.module.writelatex-git-bridge" description="cleanup module">
  228. <delete dir="${writelatex-git-bridge.output.dir}"/>
  229. <delete dir="${writelatex-git-bridge.testoutput.dir}"/>
  230. </target>
  231. <target name="clean.modules" depends="clean.module.writelatex-git-bridge">
  232. <delete dir="${module.writelatex-git-bridge.basedir}/out" />
  233. </target>
  234. <target name="init" description="Build initialization">
  235. <!-- Perform any build initialization in this target -->
  236. </target>
  237. <target name="clean" depends="clean.modules" description="cleanup all">
  238. <delete file="${module.writelatex-git-bridge.basedir}/bin/writelatex-git-bridge.jar" />
  239. </target>
  240. <target name="build.modules" depends="init, clean, compile.module.writelatex-git-bridge" description="build all modules"/>
  241. <target name="init.artifacts">
  242. <property name="artifacts.temp.dir" value="${basedir}/__artifacts_temp"/>
  243. <property name="artifact.output.writelatex-git-bridge:jar" value="${basedir}/out/artifacts/writelatex_git_bridge_jar"/>
  244. <mkdir dir="${artifacts.temp.dir}"/>
  245. <property name="temp.jar.path.writelatex-git-bridge.jar" value="${artifacts.temp.dir}/writelatex-git-bridge.jar"/>
  246. </target>
  247. <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">
  248. <property name="artifact.temp.output.writelatex-git-bridge:jar" value="${artifacts.temp.dir}/writelatex_git_bridge_jar"/>
  249. <mkdir dir="${artifact.temp.output.writelatex-git-bridge:jar}"/>
  250. <jar destfile="${temp.jar.path.writelatex-git-bridge.jar}" duplicate="preserve" filesetmanifest="mergewithoutmain">
  251. <zipfileset dir="${writelatex-git-bridge.output.dir}"/>
  252. <zipfileset dir="${writelatex-git-bridge.testoutput.dir}"/>
  253. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/org.eclipse.jgit.http.server-3.5.1.201410131835-r.jar"/>
  254. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/junit-4.11.jar"/>
  255. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/javax.servlet-api-3.1.0.jar"/>
  256. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/hamcrest-core-1.3.jar"/>
  257. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/org.eclipse.jgit-3.5.1.201410131835-r.jar"/>
  258. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/jetty-all-9.2.3.v20140905.jar"/>
  259. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/hamcrest-library-1.3.jar"/>
  260. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/gson-2.3.jar"/>
  261. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/async-http-client-1.8.14.jar"/>
  262. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/slf4j-api-1.7.7.jar"/>
  263. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/slf4j-nop-1.7.7.jar"/>
  264. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/sqlite-jdbc-3.7.2.jar"/>
  265. </jar>
  266. <copy file="${temp.jar.path.writelatex-git-bridge.jar}" tofile="${artifact.temp.output.writelatex-git-bridge:jar}/writelatex-git-bridge.jar"/>
  267. </target>
  268. <target name="build.all.artifacts" depends="artifact.writelatex-git-bridge:jar" description="Build all artifacts">
  269. <mkdir dir="${artifact.output.writelatex-git-bridge:jar}"/>
  270. <copy todir="${artifact.output.writelatex-git-bridge:jar}">
  271. <fileset dir="${artifact.temp.output.writelatex-git-bridge:jar}"/>
  272. </copy>
  273. <!-- Delete temporary files -->
  274. <delete dir="${artifacts.temp.dir}"/>
  275. </target>
  276. <target name="test.unit" depends="compile.module.writelatex-git-bridge.tests.unit">
  277. <junit>
  278. <classpath>
  279. <path refid="writelatex-git-bridge.module.classpath"/>
  280. <pathelement location="${writelatex-git-bridge.testoutput.unit.dir}"/>
  281. </classpath>
  282. <batchtest>
  283. <fileset dir="${writelatex-git-bridge.testoutput.unit.dir}">
  284. </fileset>
  285. </batchtest>
  286. <formatter type="brief" usefile="false"/>
  287. </junit>
  288. </target>
  289. <target name="test.system" depends="compile.module.writelatex-git-bridge.tests.system">
  290. <junit>
  291. <classpath>
  292. <path refid="writelatex-git-bridge.module.classpath"/>
  293. <pathelement location="${writelatex-git-bridge.testoutput.system.dir}"/>
  294. </classpath>
  295. <batchtest>
  296. <fileset dir="${writelatex-git-bridge.testoutput.system.dir}">
  297. </fileset>
  298. </batchtest>
  299. <formatter type="brief" usefile="false"/>
  300. </junit>
  301. </target>
  302. <target name="test" depends="test.unit, test.system, clean" />
  303. <target name="package" depends="build.all.artifacts">
  304. <mkdir dir="${module.writelatex-git-bridge.basedir}/bin" />
  305. <copy file="${artifact.output.writelatex-git-bridge:jar}/writelatex-git-bridge.jar" tofile="${module.writelatex-git-bridge.basedir}/bin/writelatex-git-bridge.jar" />
  306. </target>
  307. <target name="all" depends="build.modules, test.unit, test.system, package, clean.modules" description="build all"/>
  308. </project>