build.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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.javax.servlet-api-3.1.0.classpath">
  90. <pathelement location="${basedir}/libs/javax.servlet-api-3.1.0.jar"/>
  91. </path>
  92. <path id="library.jetty-all-9.2.3.v20140905.classpath">
  93. <pathelement location="${basedir}/libs/jetty-all-9.2.3.v20140905.jar"/>
  94. </path>
  95. <path id="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath">
  96. <pathelement location="${basedir}/libs/org.eclipse.jgit-3.5.1.201410131835-r.jar"/>
  97. </path>
  98. <path id="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath">
  99. <pathelement location="${basedir}/libs/org.eclipse.jgit.http.server-3.5.1.201410131835-r.jar"/>
  100. </path>
  101. <!-- Register Custom Compiler Taskdefs -->
  102. <property name="javac2.home" value="${idea.home}/lib"/>
  103. <path id="javac2.classpath">
  104. <pathelement location="${javac2.home}/javac2.jar"/>
  105. <pathelement location="${javac2.home}/jdom.jar"/>
  106. <pathelement location="${javac2.home}/asm4-all.jar"/>
  107. <pathelement location="${javac2.home}/jgoodies-forms.jar"/>
  108. </path>
  109. <target name="register.custom.compilers">
  110. <taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="javac2.classpath"/>
  111. <taskdef name="instrumentIdeaExtensions" classname="com.intellij.ant.InstrumentIdeaExtensions" classpathref="javac2.classpath"/>
  112. </target>
  113. <!-- Modules -->
  114. <!-- Module writelatex-git-bridge -->
  115. <dirname property="module.writelatex-git-bridge.basedir" file="${ant.file}"/>
  116. <property name="module.jdk.home.writelatex-git-bridge" value="${project.jdk.home}"/>
  117. <property name="module.jdk.bin.writelatex-git-bridge" value="${project.jdk.bin}"/>
  118. <property name="module.jdk.classpath.writelatex-git-bridge" value="${project.jdk.classpath}"/>
  119. <property name="compiler.args.writelatex-git-bridge" value="-encoding UTF-8 -source 1.6 ${compiler.args}"/>
  120. <property name="writelatex-git-bridge.output.dir" value="${module.writelatex-git-bridge.basedir}/out/production/writelatex-git-bridge"/>
  121. <property name="writelatex-git-bridge.testoutput.dir" value="${module.writelatex-git-bridge.basedir}/out/test/writelatex-git-bridge"/>
  122. <path id="writelatex-git-bridge.module.bootclasspath">
  123. <!-- Paths to be included in compilation bootclasspath -->
  124. </path>
  125. <path id="writelatex-git-bridge.module.production.classpath">
  126. <path refid="${module.jdk.classpath.writelatex-git-bridge}"/>
  127. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  128. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  129. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  130. <path refid="library.jetty-all-9.2.3.v20140905.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>
  139. <path id="writelatex-git-bridge.module.classpath">
  140. <path refid="${module.jdk.classpath.writelatex-git-bridge}"/>
  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. <pathelement location="${idea.home}/lib/hamcrest-core-1.3.jar"/>
  147. <pathelement location="${idea.home}/lib/hamcrest-library-1.3.jar"/>
  148. <pathelement location="${idea.home}/lib/junit-4.11.jar"/>
  149. </path>
  150. <path id="writelatex-git-bridge.runtime.module.classpath">
  151. <pathelement location="${writelatex-git-bridge.testoutput.dir}"/>
  152. <pathelement location="${writelatex-git-bridge.output.dir}"/>
  153. <path refid="library.org.eclipse.jgit-3.5.1.201410131835-r.classpath"/>
  154. <path refid="library.org.eclipse.jgit.http.server-3.5.1.201410131835-r.classpath"/>
  155. <path refid="library.javax.servlet-api-3.1.0.classpath"/>
  156. <path refid="library.jetty-all-9.2.3.v20140905.classpath"/>
  157. <pathelement location="${idea.home}/lib/hamcrest-core-1.3.jar"/>
  158. <pathelement location="${idea.home}/lib/hamcrest-library-1.3.jar"/>
  159. <pathelement location="${idea.home}/lib/junit-4.11.jar"/>
  160. </path>
  161. <patternset id="excluded.from.module.writelatex-git-bridge">
  162. <patternset refid="ignored.files"/>
  163. </patternset>
  164. <patternset id="excluded.from.compilation.writelatex-git-bridge">
  165. <patternset refid="excluded.from.module.writelatex-git-bridge"/>
  166. </patternset>
  167. <path id="writelatex-git-bridge.module.sourcepath">
  168. <dirset dir="${module.writelatex-git-bridge.basedir}">
  169. <include name="src"/>
  170. </dirset>
  171. </path>
  172. <path id="writelatex-git-bridge.module.test.sourcepath">
  173. <dirset dir="${module.writelatex-git-bridge.basedir}">
  174. <include name="test"/>
  175. </dirset>
  176. </path>
  177. <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"/>
  178. <target name="compile.module.writelatex-git-bridge.production" depends="register.custom.compilers" description="Compile module writelatex-git-bridge; production classes">
  179. <mkdir dir="${writelatex-git-bridge.output.dir}"/>
  180. <javac2 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">
  181. <compilerarg line="${compiler.args.writelatex-git-bridge}"/>
  182. <bootclasspath refid="writelatex-git-bridge.module.bootclasspath"/>
  183. <classpath refid="writelatex-git-bridge.module.production.classpath"/>
  184. <src refid="writelatex-git-bridge.module.sourcepath"/>
  185. <patternset refid="excluded.from.compilation.writelatex-git-bridge"/>
  186. </javac2>
  187. <copy todir="${writelatex-git-bridge.output.dir}">
  188. <fileset dir="${module.writelatex-git-bridge.basedir}/src">
  189. <patternset refid="compiler.resources"/>
  190. <type type="file"/>
  191. </fileset>
  192. </copy>
  193. </target>
  194. <target name="compile.module.writelatex-git-bridge.tests" depends="register.custom.compilers,compile.module.writelatex-git-bridge.production" description="compile module writelatex-git-bridge; test classes" unless="skip.tests">
  195. <mkdir dir="${writelatex-git-bridge.testoutput.dir}"/>
  196. <javac2 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">
  197. <compilerarg line="${compiler.args.writelatex-git-bridge}"/>
  198. <bootclasspath refid="writelatex-git-bridge.module.bootclasspath"/>
  199. <classpath refid="writelatex-git-bridge.module.classpath"/>
  200. <src refid="writelatex-git-bridge.module.test.sourcepath"/>
  201. <patternset refid="excluded.from.compilation.writelatex-git-bridge"/>
  202. </javac2>
  203. <copy todir="${writelatex-git-bridge.testoutput.dir}">
  204. <fileset dir="${module.writelatex-git-bridge.basedir}/test">
  205. <patternset refid="compiler.resources"/>
  206. <type type="file"/>
  207. </fileset>
  208. </copy>
  209. </target>
  210. <target name="clean.module.writelatex-git-bridge" description="cleanup module">
  211. <delete dir="${writelatex-git-bridge.output.dir}"/>
  212. <delete dir="${writelatex-git-bridge.testoutput.dir}"/>
  213. </target>
  214. <target name="init" description="Build initialization">
  215. <!-- Perform any build initialization in this target -->
  216. </target>
  217. <target name="clean" depends="clean.module.writelatex-git-bridge" description="cleanup all"/>
  218. <target name="build.modules" depends="init, clean, compile.module.writelatex-git-bridge" description="build all modules"/>
  219. <target name="all" depends="build.modules" description="build all"/>
  220. </project>