customTargets.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <project name="customTargets.template" default="noDefault">
  2. <!-- ===================================================================== -->
  3. <!-- Run a given ${target} on all elements being built -->
  4. <!-- Add on <ant> task for each top level element being built. -->
  5. <!-- ===================================================================== -->
  6. <available property="allElementsFile" file="${builder}/allElements.xml" value="${builder}/allElements.xml"/>
  7. <property name="allElementsFile" location="${eclipse.pdebuild.templates}/headless-build/allElements.xml"/>
  8. <property name="eclipse.running" value="false"/>
  9. <import file="${allElementsFile}" />
  10. <target name="allElements">
  11. <antcall target="allElementsDelegator" />
  12. </target>
  13. <!-- ===================================================================== -->
  14. <!-- ===================================================================== -->
  15. <target name="getBaseComponents" depends="checkLocalBase" unless="skipBase">
  16. <get src="${eclipseBaseURL}" dest="${buildDirectory}/../temp-base.zip" />
  17. <unzip dest="${base}" overwrite="true" src="${buildDirectory}/../temp-base.zip" />
  18. </target>
  19. <target name="checkLocalBase">
  20. <available file="${base}" property="skipBase" />
  21. </target>
  22. <!-- ===================================================================== -->
  23. <!-- Check out map files from correct repository -->
  24. <!-- Replace values for mapsCheckoutTag as desired. -->
  25. <!-- ===================================================================== -->
  26. <target name="getMapFiles" depends="checkLocalMaps" unless="skipMaps">
  27. <property name="mapsCheckoutTag" value="HEAD" />
  28. <cvs cvsRoot="${mapsRepo}" package="${mapsRoot}" dest="${buildDirectory}/maps" tag="${mapsCheckoutTag}" />
  29. </target>
  30. <target name="checkLocalMaps">
  31. <available property="skipMaps" file="${buildDirectory}/maps" />
  32. </target>
  33. <target name="tagMapFiles" if="tagMaps">
  34. <cvs dest="${buildDirectory}/maps/${mapsRoot}" command="tag ${mapsTagTag}" />
  35. </target>
  36. <!-- ===================================================================== -->
  37. <target name="clean" unless="noclean">
  38. <antcall target="allElements">
  39. <param name="target" value="cleanElement" />
  40. </antcall>
  41. </target>
  42. <target name="gatherLogs">
  43. <mkdir dir="${buildDirectory}/${buildLabel}/compilelogs" />
  44. <antcall target="allElements">
  45. <param name="target" value="gatherLogs" />
  46. </antcall>
  47. <unzip dest="${buildDirectory}/${buildLabel}/compilelogs" overwrite="true">
  48. <fileset dir="${buildDirectory}/features">
  49. <include name="**/*.log.zip" />
  50. </fileset>
  51. </unzip>
  52. </target>
  53. <!-- ===================================================================== -->
  54. <!-- Steps to do before setup -->
  55. <!-- ===================================================================== -->
  56. <target name="preSetup">
  57. <eclipse.generateFeature
  58. featureId="com.intel.sgx.build.driver"
  59. buildDirectory="${buildDirectory}"
  60. baseLocation="${baseLocation}"
  61. productFile="${product}"
  62. verify="false"
  63. pluginPath="${pluginPath}"
  64. configInfo="${configs}"
  65. pluginList="com.intel.sgx,com.intel.sgx.userguide"
  66. featureList="com.intel.sgx.feature"
  67. includeLaunchers="false"
  68. />
  69. </target>
  70. <!-- ===================================================================== -->
  71. <!-- Steps to do after setup but before starting the build proper -->
  72. <!-- ===================================================================== -->
  73. <target name="postSetup">
  74. <antcall target="getBaseComponents" />
  75. </target>
  76. <!-- ===================================================================== -->
  77. <!-- Steps to do before fetching the build elements -->
  78. <!-- ===================================================================== -->
  79. <target name="preFetch">
  80. </target>
  81. <!-- ===================================================================== -->
  82. <!-- Steps to do after fetching the build elements -->
  83. <!-- ===================================================================== -->
  84. <target name="postFetch">
  85. </target>
  86. <!-- ===================================================================== -->
  87. <!-- Steps to do before the repositories are being processed -->
  88. <!-- ===================================================================== -->
  89. <target name="preProcessRepos">
  90. </target>
  91. <!-- ===================================================================== -->
  92. <!-- Steps to do after the repositories have been processed -->
  93. <!-- ===================================================================== -->
  94. <target name="postProcessRepos">
  95. </target>
  96. <!-- ===================================================================== -->
  97. <!-- Steps to do before generating the build scripts. -->
  98. <!-- ===================================================================== -->
  99. <target name="preGenerate">
  100. </target>
  101. <!-- ===================================================================== -->
  102. <!-- Steps to do after generating the build scripts. -->
  103. <!-- ===================================================================== -->
  104. <target name="postGenerate">
  105. <antcall target="clean" />
  106. </target>
  107. <!-- ===================================================================== -->
  108. <!-- Steps to do before running the build.xmls for the elements being built. -->
  109. <!-- ===================================================================== -->
  110. <target name="preProcess">
  111. </target>
  112. <!-- ===================================================================== -->
  113. <!-- Steps to do after running the build.xmls for the elements being built. -->
  114. <!-- ===================================================================== -->
  115. <target name="postProcess">
  116. </target>
  117. <!-- ===================================================================== -->
  118. <!-- Steps to do before running assemble. -->
  119. <!-- ===================================================================== -->
  120. <target name="preAssemble">
  121. </target>
  122. <!-- ===================================================================== -->
  123. <!-- Steps to do after running assemble. -->
  124. <!-- ===================================================================== -->
  125. <target name="postAssemble">
  126. </target>
  127. <!-- ===================================================================== -->
  128. <!-- Steps to do before running package. -->
  129. <!-- ===================================================================== -->
  130. <target name="prePackage">
  131. </target>
  132. <!-- ===================================================================== -->
  133. <!-- Steps to do after running package. -->
  134. <!-- ===================================================================== -->
  135. <target name="postPackage">
  136. </target>
  137. <!-- ===================================================================== -->
  138. <!-- Steps to do after the build is done. -->
  139. <!-- ===================================================================== -->
  140. <target name="postBuild">
  141. <antcall target="gatherLogs" />
  142. <!-- Added this custom target ! -->
  143. <antcall target="generateUpdateSite" />
  144. </target>
  145. <!-- ===================================================================== -->
  146. <!-- Steps to do to test the build results -->
  147. <!-- ===================================================================== -->
  148. <target name="test">
  149. </target>
  150. <!-- ===================================================================== -->
  151. <!-- Steps to do to publish the build results -->
  152. <!-- ===================================================================== -->
  153. <target name="publish">
  154. </target>
  155. <!-- ===================================================================== -->
  156. <!-- Default target -->
  157. <!-- ===================================================================== -->
  158. <target name="noDefault">
  159. <echo message="You must specify a target when invoking this file" />
  160. </target>
  161. <!-- ===================================================================== -->
  162. <!-- Custom target: -->
  163. <!-- Steps to do to generate the update site -->
  164. <!-- ===================================================================== -->
  165. <target name="generateUpdateSite">
  166. <echo message="Copying update site source ${updateSiteSource} to destination ${updateSiteDestination}"/>
  167. <copy file="${updateSiteSource}/site.xml" overwrite="true" todir="${updateSiteDestination}"/>
  168. <!-- replace qualifier version references with build label -->
  169. <replace file="${updateSiteDestination}/site.xml" token="qualifier" value="${forceContextQualifier}"/>
  170. <!-- now extract each features zip to update site -->
  171. <antcall target="allElements">
  172. <param name="genericTargets" value="${builder}/buildUpdateSite.xml"/>
  173. <param name="target" value="extractFeature" />
  174. </antcall>
  175. </target>
  176. </project>