build.xml 15 KB

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