author | Jiri Rechtacek <jrechtacek@netbeans.org> |
Tue, 09 Oct 2012 20:25:25 +0200 | |
branch | release701 |
changeset 298 | 772c9847bda0 |
parent 289 | 0deb4af6b395 |
permissions | -rw-r--r-- |
jrechtacek@0 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
jrechtacek@0 | 2 |
<!-- You may freely edit this file. See harness/README in the NetBeans platform --> |
jrechtacek@0 | 3 |
<!-- for some information on what you could do (e.g. targets to override). --> |
jrechtacek@0 | 4 |
<!-- If you delete this file and reopen the project it will be recreated. --> |
jrechtacek@0 | 5 |
<project name="plsql support" basedir="." default="netbeans"> |
jrechtacek@0 | 6 |
<description>Builds the module suite plsql support.</description> |
jrechtacek@0 | 7 |
|
jrechtacek@20 | 8 |
<property file="nbproject/private/platform-private.properties"/> |
jrechtacek@0 | 9 |
<property file="build.properties"/> |
jrechtacek@11 | 10 |
<property file="nbproject/platform.properties"/> |
jrechtacek@0 | 11 |
|
jrechtacek@0 | 12 |
<property name="use.timestamp" value="true"/> |
jrechtacek@15 | 13 |
<property name="timestamp.file" value=".lastModified"/> |
jrechtacek@0 | 14 |
|
jrechtacek@0 | 15 |
<property environment="env"/> |
jrechtacek@0 | 16 |
<condition property="build.id" value="${env.BUILD_ID}" else="dev"> |
jrechtacek@0 | 17 |
<isset property="env.BUILD_ID"/> |
jrechtacek@0 | 18 |
</condition> |
jrechtacek@0 | 19 |
|
jrechtacek@0 | 20 |
<target name="calculate-netbeans-url" unless="skip.calculation"> |
jrechtacek@0 | 21 |
<get src="${netbeans.base.url}" dest="netbeans.html" usetimestamp="${use.timestamp}" verbose="true" ignoreerrors="${offline}"/> |
jrechtacek@0 | 22 |
<loadfile srcfile="netbeans.html" property="netbeans.binaries.url"> |
jrechtacek@0 | 23 |
<filterchain> |
jrechtacek@0 | 24 |
<tokenfilter> |
jrechtacek@0 | 25 |
<containsregex pattern=".*href="(netbeans-[a-z0-9-.]*javaee\.zip)".*" replace="${netbeans.base.url}/\1" flags="im"/> |
jrechtacek@0 | 26 |
</tokenfilter> |
jrechtacek@0 | 27 |
</filterchain> |
jrechtacek@0 | 28 |
</loadfile> |
jrechtacek@0 | 29 |
</target> |
jrechtacek@0 | 30 |
|
jrechtacek@0 | 31 |
<target name="download-binaries" depends="calculate-netbeans-url" unless="skip.download"> |
jrechtacek@0 | 32 |
<parallel> |
jrechtacek@0 | 33 |
<get src="${netbeans.binaries.url}" dest="netbeans.zip" usetimestamp="${use.timestamp}" verbose="false" ignoreerrors="${offline}"/> |
jrechtacek@0 | 34 |
</parallel> |
jrechtacek@0 | 35 |
</target> |
jrechtacek@0 | 36 |
|
jrechtacek@0 | 37 |
<target name="check-binaries"> |
jrechtacek@0 | 38 |
<condition property="binaries.uptodate"> |
jrechtacek@0 | 39 |
<and> |
jrechtacek@0 | 40 |
<uptodate targetfile="${timestamp.file}"> |
jrechtacek@0 | 41 |
<srcfiles dir="." includes="*.zip"/> |
jrechtacek@0 | 42 |
</uptodate> |
jrechtacek@292 | 43 |
<available file="ide" type="dir"/> |
jrechtacek@0 | 44 |
</and> |
jrechtacek@0 | 45 |
</condition> |
jrechtacek@0 | 46 |
</target> |
jrechtacek@0 | 47 |
|
jrechtacek@0 | 48 |
<target name="unzip-binaries" unless="binaries.uptodate"> |
jrechtacek@0 | 49 |
<echo message="New binaries downloaded - re-installing."/> |
jrechtacek@0 | 50 |
<delete dir="ide"/> |
jrechtacek@0 | 51 |
<unzip src="netbeans.zip" dest="ide"/> |
jrechtacek@0 | 52 |
<touch file="${timestamp.file}"/> |
jrechtacek@0 | 53 |
</target> |
jrechtacek@0 | 54 |
|
jrechtacek@0 | 55 |
<target name="update-binaries" depends="download-binaries,check-binaries,unzip-binaries"/> |
jrechtacek@0 | 56 |
|
jrechtacek@11 | 57 |
<target name="check-harness"> |
jrechtacek@8 | 58 |
<echo>nbplatform.default.netbeans.dest.dir resolved to ${nbplatform.default.netbeans.dest.dir}</echo> |
jrechtacek@0 | 59 |
<echo>nbplatform.default.harness.dir resolved to ${nbplatform.default.harness.dir}</echo> |
jrechtacek@289 | 60 |
<fail message="Harness is missing. Specify nbplatform.default.netbeans.dest.dir={path-to-your-sources-root}/ide/netbeans in nbproject/private/platform-private.properties"> |
jrechtacek@11 | 61 |
<condition> |
jrechtacek@11 | 62 |
<not> |
jrechtacek@11 | 63 |
<available file="${nbplatform.default.harness.dir}" type="dir"/> |
jrechtacek@11 | 64 |
</not> |
jrechtacek@11 | 65 |
</condition> |
jrechtacek@11 | 66 |
</fail> |
jrechtacek@11 | 67 |
</target> |
jrechtacek@11 | 68 |
|
jrechtacek@11 | 69 |
<target name="build-suite" depends="check-harness"> |
jrechtacek@0 | 70 |
<ant antfile="build-suite.xml" target="build" inheritAll="false"/> |
jrechtacek@0 | 71 |
</target> |
jrechtacek@0 | 72 |
|
jrechtacek@10 | 73 |
<target name="printinfo"> |
jrechtacek@10 | 74 |
<property environment="env" /> |
jrechtacek@10 | 75 |
<echo message="${env.BUILD_TAG}"/> |
jrechtacek@10 | 76 |
<echo message="${env.JAVA_HOME}"/> |
jrechtacek@10 | 77 |
</target> |
jrechtacek@10 | 78 |
|
jrechtacek@0 | 79 |
<target name="netbeans" depends="update-binaries,build-suite"/> |
jrechtacek@0 | 80 |
<target name="build" depends="netbeans"/> |
jrechtacek@0 | 81 |
|
jrechtacek@0 | 82 |
<target name="clean"> |
jrechtacek@0 | 83 |
<ant antfile="build-suite.xml" target="clean" inheritAll="false"/> |
jrechtacek@292 | 84 |
<delete dir="ide"/> |
jrechtacek@0 | 85 |
</target> |
jrechtacek@0 | 86 |
|
jrechtacek@0 | 87 |
<target name="real-clean" depends="clean"> |
jrechtacek@0 | 88 |
<echo message="Cleaning netbeans IDE"/> |
jrechtacek@0 | 89 |
<delete dir="build"/> |
jrechtacek@0 | 90 |
<delete dir="dist"/> |
jrechtacek@0 | 91 |
<delete dir="ide"/> |
jrechtacek@0 | 92 |
<delete> |
jrechtacek@0 | 93 |
<fileset dir="." includes="*.zip"/> |
jrechtacek@0 | 94 |
</delete> |
jrechtacek@0 | 95 |
<delete> |
jrechtacek@0 | 96 |
<fileset dir="." includes="*.html"/> |
jrechtacek@0 | 97 |
</delete> |
jrechtacek@0 | 98 |
<delete file="${timestamp.file}"/> |
jrechtacek@0 | 99 |
</target> |
jrechtacek@0 | 100 |
|
jrechtacek@7 | 101 |
<target name="nbms" depends="update-binaries"> |
jrechtacek@7 | 102 |
<ant antfile="build-suite.xml" target="nbms" inheritAll="false"/> |
jrechtacek@7 | 103 |
</target> |
jrechtacek@7 | 104 |
|
jrechtacek@7 | 105 |
<target name="daily" depends="update-binaries,build"> |
jrechtacek@7 | 106 |
<mkdir dir="dist"/> |
darrshan@35 | 107 |
<zip destfile="dist/netbeans-701-${build.id}-plsql.zip" duplicate="add"> |
jrechtacek@7 | 108 |
<zipfileset dir="build/cluster" prefix="netbeans/extra"/> |
jrechtacek@7 | 109 |
<zipfileset dir="ide/netbeans" prefix="netbeans"/> |
jrechtacek@7 | 110 |
</zip> |
jrechtacek@7 | 111 |
</target> |
jrechtacek@7 | 112 |
|
chrislovsund@40 | 113 |
<property name="ant.contrib.jar" value="${basedir}/Libraries/ThirdParty/ant/ant-contrib-1.0b3.jar" /> |
chrislovsund@40 | 114 |
<taskdef resource="net/sf/antcontrib/antcontrib.properties"> |
chrislovsund@40 | 115 |
<classpath> |
chrislovsund@40 | 116 |
<pathelement location="${ant.contrib.jar}"/> |
chrislovsund@40 | 117 |
</classpath> |
chrislovsund@40 | 118 |
</taskdef> |
chrislovsund@40 | 119 |
|
chrislovsund@40 | 120 |
<path id="manifest.file.paths"> |
chrislovsund@40 | 121 |
<fileset dir="${basedir}"> |
chrislovsund@40 | 122 |
<include name="**/manifest.mf"/> |
chrislovsund@40 | 123 |
<!-- <exclude name="**/Libraries/ThirdParty/**"/>--> |
chrislovsund@40 | 124 |
</fileset> |
chrislovsund@40 | 125 |
</path> |
chrislovsund@40 | 126 |
|
chrislovsund@40 | 127 |
<target name="-find-modules-for-update" description="find all modules in suite that has changes since last release" > |
chrislovsund@40 | 128 |
<loadproperties srcfile="nbproject/project.properties" /> |
chrislovsund@40 | 129 |
<mkdir dir="build"/> |
chrislovsund@40 | 130 |
<delete file="build/nbms_update.properties" /> |
chrislovsund@40 | 131 |
|
chrislovsund@40 | 132 |
<echo level="verbose">${modules}</echo> |
chrislovsund@40 | 133 |
|
chrislovsund@40 | 134 |
<foreach param="module.path" target="-vcs-log" list="${modules}" delimiter=":"/> |
chrislovsund@40 | 135 |
<propertyfile file="build/nbms_update.properties"> |
chrislovsund@40 | 136 |
<entry key="selected.modules" default="" operation="+" value="plsql-support.kit/manifest.mf:"/> |
chrislovsund@40 | 137 |
</propertyfile> |
chrislovsund@40 | 138 |
<!-- <echoproperties srcfile="build/nbms_update.properties" />--> |
chrislovsund@40 | 139 |
</target> |
chrislovsund@40 | 140 |
|
chrislovsund@40 | 141 |
<target name="-vcs-log" description="use mercurial to check if the last commit was a release commit"> |
chrislovsund@40 | 142 |
<echo level="info">module.path: ${module.path}</echo> |
chrislovsund@40 | 143 |
|
chrislovsund@40 | 144 |
<!-- find out revision number of HEAD, need svn.exe installed on local machine --> |
chrislovsund@40 | 145 |
<exec executable="hg" outputproperty="hglog.out" > |
chrislovsund@40 | 146 |
<arg line="log -l 1 --style compact '${module.path}'"/> |
chrislovsund@40 | 147 |
</exec> |
chrislovsund@40 | 148 |
<echo level="verbose">${hglog.out}</echo> |
chrislovsund@40 | 149 |
|
chrislovsund@40 | 150 |
<echo level="verbose">${force.increment}</echo> |
chrislovsund@40 | 151 |
<condition property="nbm.update.needed"> |
chrislovsund@40 | 152 |
<or> |
chrislovsund@40 | 153 |
<not> |
chrislovsund@40 | 154 |
<contains string="${hglog.out}" substring="automated commit from "/> |
chrislovsund@40 | 155 |
</not> |
chrislovsund@40 | 156 |
<istrue value="${force.increment}" /> |
chrislovsund@40 | 157 |
</or> |
chrislovsund@40 | 158 |
</condition> |
chrislovsund@40 | 159 |
<echo level="verbose">nbm.update.needed=${nbm.update.needed}</echo> |
chrislovsund@40 | 160 |
<antcall target="-concat-modules" inheritall="true" /> |
chrislovsund@40 | 161 |
</target> |
chrislovsund@40 | 162 |
|
chrislovsund@40 | 163 |
<target name="-concat-modules" if="nbm.update.needed" description="Concatinate the selected module paths and put in .properties file"> |
chrislovsund@40 | 164 |
<echo>Module needs to be updated: ${nbm.update.needed}</echo> |
chrislovsund@40 | 165 |
<echo level="info">module.path: ${module.path}</echo> |
chrislovsund@40 | 166 |
<propertyfile file="build/nbms_update.properties"> |
chrislovsund@40 | 167 |
<entry key="selected.modules" default="" operation="+" value="${module.path}/manifest.mf:"/> |
chrislovsund@40 | 168 |
</propertyfile> |
chrislovsund@40 | 169 |
</target> |
chrislovsund@40 | 170 |
|
chrislovsund@40 | 171 |
<target name="show-current-versions" description="show current specification versions for all modules"> |
chrislovsund@40 | 172 |
<foreach param="manifest.file" target="current-version" > |
chrislovsund@40 | 173 |
<path refid="manifest.file.paths"/> |
chrislovsund@40 | 174 |
</foreach> |
chrislovsund@40 | 175 |
</target> |
chrislovsund@40 | 176 |
|
chrislovsund@40 | 177 |
<target name="current-version" depends="-read-version" description="show current specification.version"> |
chrislovsund@40 | 178 |
</target> |
chrislovsund@40 | 179 |
|
chrislovsund@40 | 180 |
<target name="incr-major" description="increment major version for modules with changes" depends="-find-modules-for-update"> |
chrislovsund@40 | 181 |
<loadproperties srcfile="build/nbms_update.properties" /> |
chrislovsund@40 | 182 |
<echo>selected.modules=${selected.modules}</echo> |
chrislovsund@40 | 183 |
<foreach param="manifest.file" target="-major" > |
chrislovsund@40 | 184 |
<path path="${selected.modules}"/> |
chrislovsund@40 | 185 |
</foreach> |
chrislovsund@40 | 186 |
<delete file="build_info.properties" /> |
chrislovsund@40 | 187 |
</target> |
chrislovsund@40 | 188 |
|
chrislovsund@40 | 189 |
<target name="incr-minor" description="increment minor version for modules with changes" depends="-find-modules-for-update"> |
chrislovsund@40 | 190 |
<loadproperties srcfile="build/nbms_update.properties" /> |
chrislovsund@40 | 191 |
<echo>selected.modules=${selected.modules}</echo> |
chrislovsund@40 | 192 |
<foreach param="manifest.file" target="-minor" > |
chrislovsund@40 | 193 |
<path path="${selected.modules}"/> |
chrislovsund@40 | 194 |
</foreach> |
chrislovsund@40 | 195 |
<delete file="build_info.properties" /> |
chrislovsund@40 | 196 |
</target> |
chrislovsund@40 | 197 |
|
chrislovsund@40 | 198 |
<target name="incr-revision" description="increment revision version for modules with changes" depends="-find-modules-for-update"> |
chrislovsund@40 | 199 |
<loadproperties srcfile="build/nbms_update.properties" /> |
chrislovsund@40 | 200 |
<echo>selected.modules=${selected.modules}</echo> |
chrislovsund@40 | 201 |
<foreach param="manifest.file" target="-revision" > |
chrislovsund@40 | 202 |
<path path="${selected.modules}"/> |
chrislovsund@40 | 203 |
</foreach> |
chrislovsund@40 | 204 |
<delete file="build_info.properties" /> |
chrislovsund@40 | 205 |
</target> |
chrislovsund@40 | 206 |
|
chrislovsund@40 | 207 |
<target name="-read-version"> |
chrislovsund@40 | 208 |
<echo level="verbose">manifest.file: ${manifest.file}</echo> |
chrislovsund@40 | 209 |
<property file="${manifest.file}"></property> |
chrislovsund@40 | 210 |
<property name="specification.version" value="${OpenIDE-Module-Specification-Version}"/> |
chrislovsund@40 | 211 |
<echo>OpenIDE-Module: ${OpenIDE-Module}</echo> |
chrislovsund@40 | 212 |
<echo>Current build number:${specification.version}</echo> |
chrislovsund@40 | 213 |
<propertyregex property="major.version" input="${specification.version}" regexp="(\d+)\.(\d+)\.(\d+)$" select="\1" /> |
chrislovsund@40 | 214 |
<echo level="verbose">major: ${major.version}</echo> |
chrislovsund@40 | 215 |
<propertyregex property="minor.version" input="${specification.version}" regexp="(\d+)\.(\d+)\.(\d+)$" select="\2" /> |
chrislovsund@40 | 216 |
<echo level="verbose">minor: ${minor.version}</echo> |
chrislovsund@40 | 217 |
<propertyregex property="revision.version" input="${specification.version}" regexp="(\d+)\.(\d+)\.(\d+)$" select="\3" /> |
chrislovsund@40 | 218 |
<echo level="verbose">revision: ${revision.version}</echo> |
chrislovsund@40 | 219 |
<propertyfile file="build_info.properties"> |
chrislovsund@40 | 220 |
<entry key="build.major.number" type="int" value="${major.version}" /> |
chrislovsund@40 | 221 |
<entry key="build.minor.number" type="int" value="${minor.version}" /> |
chrislovsund@40 | 222 |
<entry key="build.revision.number" type="int" value="${revision.version}" /> |
chrislovsund@40 | 223 |
</propertyfile> |
chrislovsund@40 | 224 |
</target> |
chrislovsund@40 | 225 |
|
chrislovsund@40 | 226 |
<target name="-revision" depends="-read-version"> |
chrislovsund@40 | 227 |
<propertyfile file="build_info.properties"> |
chrislovsund@40 | 228 |
<entry key="build.revision.number" type="int" operation="+" value="1"/> |
chrislovsund@40 | 229 |
</propertyfile> |
chrislovsund@40 | 230 |
|
chrislovsund@40 | 231 |
<loadproperties srcfile="build_info.properties" /> |
chrislovsund@40 | 232 |
<manifest file="${manifest.file}" mode="update"> |
chrislovsund@40 | 233 |
<attribute name="OpenIDE-Module-Specification-Version" value="${build.major.number}.${build.minor.number}.${build.revision.number}" /> |
chrislovsund@40 | 234 |
</manifest> |
chrislovsund@40 | 235 |
<replaceregexp match="(dependency\D*code-name-base\W${OpenIDE-Module}\W/\D*)(\d+\.\d+\.\d+)" byline="false" |
chrislovsund@40 | 236 |
file="plsql-support.kit/nbproject/project.xml" replace="\1${build.major.number}.${build.minor.number}.${build.revision.number}"/> |
chrislovsund@40 | 237 |
</target> |
chrislovsund@40 | 238 |
|
chrislovsund@40 | 239 |
<target name="-minor" depends="-read-version"> |
chrislovsund@40 | 240 |
<propertyfile file="build_info.properties"> |
chrislovsund@40 | 241 |
<entry key="build.minor.number" type="int" operation="+" value="1" /> |
chrislovsund@40 | 242 |
<entry key="build.revision.number" type="int" value="0" /> |
chrislovsund@40 | 243 |
</propertyfile> |
chrislovsund@40 | 244 |
<loadproperties srcfile="build_info.properties" /> |
chrislovsund@40 | 245 |
|
chrislovsund@40 | 246 |
<manifest file="${manifest.file}" mode="update"> |
chrislovsund@40 | 247 |
<attribute name="OpenIDE-Module-Specification-Version" value="${build.major.number}.${build.minor.number}.${build.revision.number}" /> |
chrislovsund@40 | 248 |
</manifest> |
chrislovsund@40 | 249 |
<replaceregexp match="(dependency\D*code-name-base\W${OpenIDE-Module}\W/\D*)(\d+\.\d+\.\d+)" byline="false" |
chrislovsund@40 | 250 |
file="plsql-support.kit/nbproject/project.xml" replace="\1${build.major.number}.${build.minor.number}.${build.revision.number}"/> |
chrislovsund@40 | 251 |
</target> |
chrislovsund@40 | 252 |
|
chrislovsund@40 | 253 |
<target name="-major" depends="-read-version"> |
chrislovsund@40 | 254 |
<propertyfile file="build_info.properties"> |
chrislovsund@40 | 255 |
<entry key="build.major.number" type="int" operation="+" value="1" /> |
chrislovsund@40 | 256 |
<entry key="build.minor.number" type="int" value="0" /> |
chrislovsund@40 | 257 |
<entry key="build.revision.number" type="int" value="0" /> |
chrislovsund@40 | 258 |
</propertyfile> |
chrislovsund@40 | 259 |
<!--<echoproperties srcfile="build_info.properties" />--> |
chrislovsund@40 | 260 |
<loadproperties srcfile="build_info.properties" /> |
chrislovsund@40 | 261 |
|
chrislovsund@40 | 262 |
<manifest file="${manifest.file}" mode="update" > |
chrislovsund@40 | 263 |
<attribute name="OpenIDE-Module-Specification-Version" value="${build.major.number}.${build.minor.number}.${build.revision.number}" /> |
chrislovsund@40 | 264 |
</manifest> |
chrislovsund@40 | 265 |
<replaceregexp match="(dependency\D*code-name-base\W${OpenIDE-Module}\W/\D*)(\d+\.\d+\.\d+)" byline="false" |
chrislovsund@40 | 266 |
file="plsql-support.kit/nbproject/project.xml" replace="\1${build.major.number}.${build.minor.number}.${build.revision.number}"/> |
chrislovsund@40 | 267 |
</target> |
chrislovsund@40 | 268 |
|
chrislovsund@40 | 269 |
<target name="all"> |
chrislovsund@40 | 270 |
<propertyfile file="build_info.properties"> |
chrislovsund@40 | 271 |
<entry key="build.major.number" type="int" operation="+" value="1" /> |
chrislovsund@40 | 272 |
<entry key="build.minor.number" type="int" operation="+" value="1" /> |
chrislovsund@40 | 273 |
<entry key="build.revision.number" type="int" operation="+" value="1" /> |
chrislovsund@40 | 274 |
</propertyfile> |
chrislovsund@40 | 275 |
</target> |
chrislovsund@40 | 276 |
|
chrislovsund@43 | 277 |
<target name="echo-manifest" description="echo kit version that is found in manifest. Used by hudson" > |
chrislovsund@43 | 278 |
<echoproperties srcfile="plsql-support.kit/manifest.mf"/> |
chrislovsund@43 | 279 |
</target> |
chrislovsund@43 | 280 |
|
jrechtacek@0 | 281 |
</project> |