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