1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- You may freely edit this file. See harness/README in the NetBeans platform -->
3 <!-- for some information on what you could do (e.g. targets to override). -->
4 <!-- If you delete this file and reopen the project it will be recreated. -->
5 <project name="plsql support" basedir="." default="netbeans">
6 <description>Builds the module suite plsql support.</description>
8 <property file="nbproject/private/platform-private.properties"/>
9 <property file="build.properties"/>
10 <property file="nbproject/platform.properties"/>
12 <property name="use.timestamp" value="true"/>
13 <property name="timestamp.file" value=".lastModified"/>
15 <property environment="env"/>
16 <property name="env.BUILD_NUMBER" value="0" description="Set a fake value if not run from Jenkins"/>
17 <property name="env.next_jira_release_version" value="8.72.0" description="Set a fake value if not run from Jenkins"/>
18 <property name="new_version" value="${env.next_jira_release_version}.${env.BUILD_NUMBER}" description="Set a version number based on info from Jenkins"/>
20 <condition property="build.id" value="${env.BUILD_ID}" else="dev">
21 <isset property="env.BUILD_ID"/>
24 <target name="calculate-netbeans-url" unless="skip.calculation">
25 <get src="${netbeans.base.url}" dest="netbeans.html" usetimestamp="${use.timestamp}" verbose="true" ignoreerrors="${offline}"/>
26 <loadfile srcfile="netbeans.html" property="netbeans.binaries.url">
29 <containsregex pattern=".*href="(netbeans-[a-z0-9-.]*javaee\.zip)".*" replace="${netbeans.base.url}/\1" flags="im"/>
35 <target name="download-binaries" depends="calculate-netbeans-url" unless="skip.download">
37 <get src="${netbeans.binaries.url}" dest="netbeans.zip" usetimestamp="${use.timestamp}" verbose="false" ignoreerrors="${offline}"/>
41 <target name="check-binaries">
42 <condition property="binaries.uptodate">
44 <uptodate targetfile="${timestamp.file}">
45 <srcfiles dir="." includes="*.zip"/>
51 <target name="unzip-binaries" unless="binaries.uptodate">
52 <echo message="New binaries downloaded - re-installing."/>
54 <unzip src="netbeans.zip" dest="ide"/>
55 <touch file="${timestamp.file}"/>
58 <target name="update-binaries" depends="download-binaries,check-binaries,unzip-binaries"/>
60 <target name="check-harness">
61 <echo>nbplatform.default.netbeans.dest.dir resolved to ${nbplatform.default.netbeans.dest.dir}</echo>
62 <echo>nbplatform.default.harness.dir resolved to ${nbplatform.default.harness.dir}</echo>
63 <fail message="Harness is missing. Specify nbplatform.default.netbeans.dest.dir={path-to-your-sources-root}/ide/netbeans in nbproject/private/platform-private.propetries">
66 <available file="${nbplatform.default.harness.dir}" type="dir"/>
72 <target name="build-suite" depends="check-harness">
73 <ant antfile="build-suite.xml" target="build" inheritAll="false"/>
76 <target name="printinfo">
77 <property environment="env" />
78 <echo message="${env.BUILD_TAG}"/>
79 <echo message="${env.JAVA_HOME}"/>
82 <target name="netbeans" depends="update-binaries,build-suite"/>
83 <target name="build" depends="netbeans"/>
86 <echo>nbplatform.default.netbeans.dest.dir resolved to ${nbplatform.default.netbeans.dest.dir}</echo>
87 <echo>nbplatform.default.harness.dir resolved to ${nbplatform.default.harness.dir}</echo>
88 <ant antfile="build-suite.xml" target="clean" inheritAll="false"/>
91 <target name="real-clean" depends="clean">
92 <echo message="Cleaning netbeans IDE"/>
97 <fileset dir="." includes="*.zip"/>
100 <fileset dir="." includes="*.html"/>
102 <delete file="${timestamp.file}"/>
105 <target name="nbms" depends="update-binaries">
106 <ant antfile="build-suite.xml" target="nbms" inheritAll="false"/>
109 <target name="daily" depends="update-binaries,build">
111 <zip destfile="dist/netbeans-701-${build.id}-plsql.zip" duplicate="add">
112 <zipfileset dir="build/cluster" prefix="netbeans/extra"/>
113 <zipfileset dir="ide/netbeans" prefix="netbeans"/>
117 <property name="ant.contrib.jar" value="${basedir}/Libraries/ThirdParty/ant/ant-contrib-1.0b3.jar" />
118 <taskdef resource="net/sf/antcontrib/antcontrib.properties">
120 <pathelement location="${ant.contrib.jar}"/>
124 <path id="manifest.file.paths">
125 <fileset dir="${basedir}">
126 <include name="**/manifest.mf"/>
127 <!-- <exclude name="**/Libraries/ThirdParty/**"/>-->
131 <target name="-find-modules-for-update" description="find all modules in suite that has changes since last release" >
132 <loadproperties srcfile="nbproject/project.properties" />
134 <delete file="build/nbms_update.properties" />
136 <echo level="verbose">${modules}</echo>
138 <foreach param="module.path" target="-vcs-log" list="${modules}" delimiter=":"/>
139 <!-- <echoproperties srcfile="build/nbms_update.properties" />-->
142 <target name="-add-kit-module" description="add kit module to update" >
143 <propertyfile file="build/nbms_update.properties">
144 <entry key="selected.modules" default="" operation="+" value="plsql-support.kit/manifest.mf:"/>
148 <target name="-vcs-log" description="use mercurial to check if the last commit was a release commit">
149 <echo level="info">module.path: ${module.path}</echo>
151 <!-- find out revision number of HEAD, need svn.exe installed on local machine -->
152 <exec executable="hg" outputproperty="hglog.out" >
153 <arg line="log -l 1 --style compact '${module.path}'"/>
155 <echo level="verbose">${hglog.out}</echo>
157 <echo level="verbose">${force.increment}</echo>
158 <condition property="nbm.update.needed">
161 <contains string="${hglog.out}" substring="automated commit from "/>
163 <istrue value="${force.increment}" />
166 <echo level="verbose">nbm.update.needed=${nbm.update.needed}</echo>
167 <antcall target="-concat-modules" inheritall="true" />
170 <target name="-concat-modules" if="nbm.update.needed" description="Concatinate the selected module paths and put in .properties file">
171 <echo>Module needs to be updated: ${nbm.update.needed}</echo>
172 <echo level="info">module.path: ${module.path}</echo>
173 <propertyfile file="build/nbms_update.properties">
174 <entry key="selected.modules" default="" operation="+" value="${module.path}/manifest.mf:"/>
178 <target name="show-current-versions" description="show current specification versions for all modules">
179 <foreach param="manifest.file" target="current-version" >
180 <path refid="manifest.file.paths"/>
184 <target name="current-version" depends="-read-version" description="show current specification.version">
187 <target name="update-version" depends="-find-modules-for-update, -add-kit-module"
188 description="update version for all modules in suite that has changes since last release">
189 <echo level="info">Updating modules to version: ${new_version}</echo>
190 <loadproperties srcfile="build/nbms_update.properties" />
191 <echo>selected.modules=${selected.modules}</echo>
192 <foreach param="manifest.file" target="-update-meta-files" >
193 <path path="${selected.modules}"/>
197 <target name="-read-version">
198 <echo level="verbose">manifest.file: ${manifest.file}</echo>
199 <property file="${manifest.file}"></property>
200 <property name="specification.version" value="${OpenIDE-Module-Specification-Version}"/>
201 <echo>OpenIDE-Module: ${OpenIDE-Module}</echo>
202 <echo>Current build number:${env.BUILD_NUMBER}</echo>
205 <target name="-update-meta-files" depends="-read-version">
206 <manifest file="${manifest.file}" mode="update" >
207 <attribute name="OpenIDE-Module-Specification-Version" value="${new_version}" />
209 <replaceregexp match="(dependency\D*code-name-base\W${OpenIDE-Module}\W/\D*)(\d+\.\d+\.\d+\.\d+)" byline="false"
210 file="plsql-support.kit/nbproject/project.xml" replace="\1${new_version}"/>
214 <propertyfile file="build_info.properties">
215 <entry key="build.major.number" type="int" operation="+" value="1" />
216 <entry key="build.minor.number" type="int" operation="+" value="1" />
217 <entry key="build.revision.number" type="int" operation="+" value="1" />
221 <target name="echo-manifest" description="echo kit version that is found in manifest. Used by hudson" >
222 <echoproperties srcfile="plsql-support.kit/manifest.mf"/>