build.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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. <!-- Project Libraries -->
  54. <path id="library.hamcrest-core-1.3.classpath">
  55. <pathelement location="${basedir}/libs/hamcrest-core-1.3.jar"/>
  56. </path>
  57. <path id="library.hamcrest-library-1.3.classpath">
  58. <pathelement location="${basedir}/libs/hamcrest-library-1.3.jar"/>
  59. </path>
  60. <path id="library.javax.servlet-api-3.1.0.classpath">
  61. <pathelement location="${basedir}/libs/javax.servlet-api-3.1.0.jar"/>
  62. </path>
  63. <path id="library.jetty-all-9.2.3.v20140905.classpath">
  64. <pathelement location="${basedir}/libs/jetty-all-9.2.3.v20140905.jar"/>
  65. </path>
  66. <path id="library.junit-4.11.classpath">
  67. <pathelement location="${basedir}/libs/junit-4.11.jar"/>
  68. </path>
  69. <path id="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath">
  70. <pathelement location="${basedir}/libs/org.eclipse.jgit-3.5.1.201410131835-r.jar"/>
  71. </path>
  72. <path id="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath">
  73. <pathelement location="${basedir}/libs/org.eclipse.jgit.http.server-3.5.1.201410131835-r.jar"/>
  74. </path>
  75. <!-- Modules -->
  76. <!-- Module writelatex-git-bridge -->
  77. <dirname property="module.writelatex-git-bridge.basedir" file="${ant.file}"/>
  78. <property name="compiler.args.writelatex-git-bridge" value="-encoding UTF-8 -source 1.6 ${compiler.args}"/>
  79. <property name="writelatex-git-bridge.output.dir" value="${module.writelatex-git-bridge.basedir}/out/production/writelatex-git-bridge"/>
  80. <property name="writelatex-git-bridge.testoutput.dir" value="${module.writelatex-git-bridge.basedir}/out/test/writelatex-git-bridge"/>
  81. <path id="writelatex-git-bridge.module.bootclasspath">
  82. <!-- Paths to be included in compilation bootclasspath -->
  83. </path>
  84. <path id="writelatex-git-bridge.module.production.classpath">
  85. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  86. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  87. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  88. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  89. <path refid="library.hamcrest-core-1.3.classpath"/>
  90. <path refid="library.hamcrest-library-1.3.classpath"/>
  91. <path refid="library.junit-4.11.classpath"/>
  92. </path>
  93. <path id="writelatex-git-bridge.runtime.production.module.classpath">
  94. <pathelement location="${writelatex-git-bridge.output.dir}"/>
  95. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  96. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  97. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  98. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  99. <path refid="library.hamcrest-core-1.3.classpath"/>
  100. <path refid="library.hamcrest-library-1.3.classpath"/>
  101. <path refid="library.junit-4.11.classpath"/>
  102. </path>
  103. <path id="writelatex-git-bridge.module.classpath">
  104. <pathelement location="${writelatex-git-bridge.output.dir}"/>
  105. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  106. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  107. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  108. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  109. <path refid="library.hamcrest-core-1.3.classpath"/>
  110. <path refid="library.hamcrest-library-1.3.classpath"/>
  111. <path refid="library.junit-4.11.classpath"/>
  112. </path>
  113. <path id="writelatex-git-bridge.runtime.module.classpath">
  114. <pathelement location="${writelatex-git-bridge.testoutput.dir}"/>
  115. <pathelement location="${writelatex-git-bridge.output.dir}"/>
  116. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  117. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  118. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  119. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  120. <path refid="library.hamcrest-core-1.3.classpath"/>
  121. <path refid="library.hamcrest-library-1.3.classpath"/>
  122. <path refid="library.junit-4.11.classpath"/>
  123. </path>
  124. <patternset id="excluded.from.module.writelatex-git-bridge">
  125. <patternset refid="ignored.files"/>
  126. </patternset>
  127. <patternset id="excluded.from.compilation.writelatex-git-bridge">
  128. <patternset refid="excluded.from.module.writelatex-git-bridge"/>
  129. </patternset>
  130. <path id="writelatex-git-bridge.module.sourcepath">
  131. <dirset dir="${module.writelatex-git-bridge.basedir}">
  132. <include name="src"/>
  133. </dirset>
  134. </path>
  135. <path id="writelatex-git-bridge.module.test.sourcepath">
  136. <dirset dir="${module.writelatex-git-bridge.basedir}">
  137. <include name="test"/>
  138. </dirset>
  139. </path>
  140. <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"/>
  141. <target name="compile.module.writelatex-git-bridge.production" description="Compile module writelatex-git-bridge; production classes">
  142. <mkdir dir="${writelatex-git-bridge.output.dir}"/>
  143. <javac destdir="${writelatex-git-bridge.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
  144. <compilerarg line="${compiler.args.writelatex-git-bridge}"/>
  145. <bootclasspath refid="writelatex-git-bridge.module.bootclasspath"/>
  146. <classpath refid="writelatex-git-bridge.module.production.classpath"/>
  147. <src refid="writelatex-git-bridge.module.sourcepath"/>
  148. <patternset refid="excluded.from.compilation.writelatex-git-bridge"/>
  149. </javac>
  150. <copy todir="${writelatex-git-bridge.output.dir}">
  151. <fileset dir="${module.writelatex-git-bridge.basedir}/src">
  152. <patternset refid="compiler.resources"/>
  153. <type type="file"/>
  154. </fileset>
  155. </copy>
  156. </target>
  157. <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">
  158. <mkdir dir="${writelatex-git-bridge.testoutput.dir}"/>
  159. <javac destdir="${writelatex-git-bridge.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
  160. <compilerarg line="${compiler.args.writelatex-git-bridge}"/>
  161. <bootclasspath refid="writelatex-git-bridge.module.bootclasspath"/>
  162. <classpath refid="writelatex-git-bridge.module.classpath"/>
  163. <src refid="writelatex-git-bridge.module.test.sourcepath"/>
  164. <patternset refid="excluded.from.compilation.writelatex-git-bridge"/>
  165. </javac>
  166. <copy todir="${writelatex-git-bridge.testoutput.dir}">
  167. <fileset dir="${module.writelatex-git-bridge.basedir}/test">
  168. <patternset refid="compiler.resources"/>
  169. <type type="file"/>
  170. </fileset>
  171. </copy>
  172. </target>
  173. <target name="clean.module.writelatex-git-bridge" description="cleanup module">
  174. <delete dir="${writelatex-git-bridge.output.dir}"/>
  175. <delete dir="${writelatex-git-bridge.testoutput.dir}"/>
  176. </target>
  177. <target name="clean.modules" depends="clean.module.writelatex-git-bridge">
  178. <delete dir="${module.writelatex-git-bridge.basedir}/out" />
  179. </target>
  180. <target name="init" description="Build initialization">
  181. <!-- Perform any build initialization in this target -->
  182. </target>
  183. <target name="clean" depends="clean.modules" description="cleanup all">
  184. <delete dir="${module.writelatex-git-bridge.basedir}/bin" />
  185. </target>
  186. <target name="build.modules" depends="init, clean, compile.module.writelatex-git-bridge" description="build all modules"/>
  187. <target name="init.artifacts">
  188. <property name="artifacts.temp.dir" value="${basedir}/__artifacts_temp"/>
  189. <property name="artifact.output.writelatex-git-bridge:jar" value="${basedir}/out/artifacts/writelatex_git_bridge_jar"/>
  190. <mkdir dir="${artifacts.temp.dir}"/>
  191. <property name="temp.jar.path.writelatex-git-bridge.jar" value="${artifacts.temp.dir}/writelatex-git-bridge.jar"/>
  192. </target>
  193. <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">
  194. <property name="artifact.temp.output.writelatex-git-bridge:jar" value="${artifacts.temp.dir}/writelatex_git_bridge_jar"/>
  195. <mkdir dir="${artifact.temp.output.writelatex-git-bridge:jar}"/>
  196. <jar destfile="${temp.jar.path.writelatex-git-bridge.jar}" duplicate="preserve" filesetmanifest="mergewithoutmain">
  197. <zipfileset dir="${writelatex-git-bridge.output.dir}"/>
  198. <zipfileset dir="${writelatex-git-bridge.testoutput.dir}"/>
  199. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/org.eclipse.jgit.http.server-3.5.1.201410131835-r.jar"/>
  200. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/junit-4.11.jar"/>
  201. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/javax.servlet-api-3.1.0.jar"/>
  202. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/hamcrest-core-1.3.jar"/>
  203. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/org.eclipse.jgit-3.5.1.201410131835-r.jar"/>
  204. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/jetty-all-9.2.3.v20140905.jar"/>
  205. <zipfileset excludes="META-INF/**/*" src="${basedir}/libs/hamcrest-library-1.3.jar"/>
  206. </jar>
  207. <copy file="${temp.jar.path.writelatex-git-bridge.jar}" tofile="${artifact.temp.output.writelatex-git-bridge:jar}/writelatex-git-bridge.jar"/>
  208. </target>
  209. <target name="build.all.artifacts" depends="artifact.writelatex-git-bridge:jar" description="Build all artifacts">
  210. <mkdir dir="${artifact.output.writelatex-git-bridge:jar}"/>
  211. <copy todir="${artifact.output.writelatex-git-bridge:jar}">
  212. <fileset dir="${artifact.temp.output.writelatex-git-bridge:jar}"/>
  213. </copy>
  214. <!-- Delete temporary files -->
  215. <delete dir="${artifacts.temp.dir}"/>
  216. </target>
  217. <target name="test.unit" depends="compile.module.writelatex-git-bridge.tests">
  218. <junit>
  219. <classpath>
  220. <path refid="writelatex-git-bridge.module.classpath"/>
  221. <pathelement location="${writelatex-git-bridge.testoutput.dir}"/>
  222. </classpath>
  223. <batchtest>
  224. <fileset dir="${writelatex-git-bridge.testoutput.dir}">
  225. </fileset>
  226. </batchtest>
  227. <formatter type="brief" usefile="false"/>
  228. </junit>
  229. </target>
  230. <target name="test.system" depends="package">
  231. <property name="executable-full-path"
  232. location="${module.writelatex-git-bridge.basedir}/test/system"/>
  233. <exec executable="${executable-full-path}/main.sh" />
  234. </target>
  235. <target name="test" depends="test.unit, test.system, clean" />
  236. <target name="package" depends="build.all.artifacts">
  237. <mkdir dir="${module.writelatex-git-bridge.basedir}/bin" />
  238. <copy file="${artifact.output.writelatex-git-bridge:jar}/writelatex-git-bridge.jar" tofile="${module.writelatex-git-bridge.basedir}/bin/writelatex-git-bridge.jar" />
  239. </target>
  240. <target name="all" depends="build.modules, test.unit, package, clean.modules, test.system" description="build all"/>
  241. </project>