build.xml
author PGebauer <pgebauer@netbeans.org>
Mon, 19 Dec 2016 11:56:51 +0100
branchdonation_review
changeset 470 84c93a6efd2a
parent 313 22a75d08e0d0
permissions -rw-r--r--
The donation_review branch created.
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. -->
chrislovsund@294
     5
<project name="plsql support" basedir="." default="netbeans" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
chrislovsund@294
     6
   <description>Builds the module suite plsql support.</description>
chrislovsund@294
     7
chrislovsund@294
     8
   <property file="nbproject/private/platform-private.properties"/>
chrislovsund@294
     9
   <property file="build.properties"/>
chrislovsund@294
    10
   <property file="nbproject/platform.properties"/>
chrislovsund@294
    11
chrislovsund@294
    12
   <property name="use.timestamp" value="true"/>
chrislovsund@294
    13
   <property name="timestamp.file" value=".lastModified"/>
chrislovsund@294
    14
chrislovsund@294
    15
   <property environment="env"/>
chrislovsund@467
    16
   <property name="env.BUILD_NUMBER" value="0-SNAPSHOT" description="Set a fake value if not run from Jenkins"/>
chrislovsund@467
    17
   <property name="env.next_jira_release_version" value="8.72" description="Set a fake value if not run from Jenkins"/>
chrislovsund@266
    18
   <property name="new_version" value="${env.next_jira_release_version}.${env.BUILD_NUMBER}" description="Set a version number based on info from Jenkins"/>
chrislovsund@266
    19
chrislovsund@294
    20
   <condition property="build.id" value="${env.BUILD_ID}" else="dev">
chrislovsund@294
    21
      <isset property="env.BUILD_ID"/>
chrislovsund@294
    22
   </condition>
jrechtacek@0
    23
chrislovsund@294
    24
   <target name="calculate-netbeans-url" unless="skip.calculation">
chrislovsund@294
    25
      <get src="${netbeans.base.url}" dest="netbeans.html" usetimestamp="${use.timestamp}" verbose="true" ignoreerrors="${offline}"/>
chrislovsund@294
    26
      <loadfile srcfile="netbeans.html" property="netbeans.binaries.url">
chrislovsund@294
    27
         <filterchain>
chrislovsund@294
    28
            <tokenfilter>
chrislovsund@294
    29
               <containsregex pattern=".*href=&quot;(netbeans-[a-z0-9-.]*javaee\.zip)&quot;.*" replace="${netbeans.base.url}/\1" flags="im"/>
chrislovsund@294
    30
            </tokenfilter>
chrislovsund@294
    31
         </filterchain>
chrislovsund@294
    32
      </loadfile>
chrislovsund@294
    33
   </target>
chrislovsund@294
    34
chrislovsund@294
    35
   <target name="download-binaries" depends="calculate-netbeans-url" unless="skip.download">
chrislovsund@294
    36
      <parallel>
chrislovsund@294
    37
         <get src="${netbeans.binaries.url}" dest="netbeans.zip" usetimestamp="${use.timestamp}" verbose="false" ignoreerrors="${offline}"/>
chrislovsund@294
    38
      </parallel>
chrislovsund@294
    39
   </target>
chrislovsund@294
    40
chrislovsund@294
    41
   <target name="check-binaries">
chrislovsund@294
    42
      <condition property="binaries.uptodate">
chrislovsund@294
    43
         <and>
chrislovsund@294
    44
            <uptodate targetfile="${timestamp.file}">
chrislovsund@294
    45
               <srcfiles dir="." includes="*.zip"/>
chrislovsund@294
    46
            </uptodate>
chrislovsund@294
    47
         </and>
chrislovsund@294
    48
      </condition>
chrislovsund@294
    49
   </target>
chrislovsund@294
    50
chrislovsund@294
    51
   <target name="unzip-binaries" unless="binaries.uptodate">
chrislovsund@294
    52
      <echo message="New binaries downloaded - re-installing."/>
chrislovsund@294
    53
      <delete dir="ide"/>
chrislovsund@294
    54
      <unzip src="netbeans.zip" dest="ide"/>
chrislovsund@294
    55
      <touch file="${timestamp.file}"/>
chrislovsund@294
    56
   </target>
chrislovsund@294
    57
chrislovsund@294
    58
   <target name="update-binaries" depends="download-binaries,check-binaries,unzip-binaries"/>
chrislovsund@294
    59
chrislovsund@294
    60
   <target name="check-harness">
chrislovsund@294
    61
      <echo>nbplatform.default.netbeans.dest.dir resolved to ${nbplatform.default.netbeans.dest.dir}</echo>
chrislovsund@294
    62
      <echo>nbplatform.default.harness.dir resolved to ${nbplatform.default.harness.dir}</echo>
chrislovsund@294
    63
      <fail message="Harness is missing. Specify nbplatform.default.netbeans.dest.dir={path-to-your-sources-root}/ide/netbeans in nbproject/private/platform-private.properties">
chrislovsund@294
    64
         <condition>
chrislovsund@294
    65
            <not>
chrislovsund@294
    66
               <available file="${nbplatform.default.harness.dir}" type="dir"/>
chrislovsund@294
    67
            </not>
chrislovsund@294
    68
         </condition>
chrislovsund@294
    69
      </fail>
chrislovsund@294
    70
   </target>
chrislovsund@294
    71
chrislovsund@294
    72
   <target name="build-suite" depends="check-harness">
chrislovsund@294
    73
      <ant antfile="build-suite.xml" target="build" inheritAll="false"/>
chrislovsund@294
    74
   </target>
chrislovsund@294
    75
chrislovsund@294
    76
   <target name="printinfo">
jrechtacek@10
    77
      <property environment="env" />
jrechtacek@10
    78
      <echo message="${env.BUILD_TAG}"/>
jrechtacek@10
    79
      <echo message="${env.JAVA_HOME}"/>
chrislovsund@294
    80
   </target>
jrechtacek@0
    81
chrislovsund@294
    82
   <target name="netbeans" depends="update-binaries,build-suite"/>
chrislovsund@294
    83
   <target name="build" depends="netbeans"/>
chrislovsund@294
    84
chrislovsund@294
    85
   <target name="clean">
chrislovsund@294
    86
      <echo>nbplatform.default.netbeans.dest.dir resolved to ${nbplatform.default.netbeans.dest.dir}</echo>
chrislovsund@294
    87
      <echo>nbplatform.default.harness.dir resolved to ${nbplatform.default.harness.dir}</echo>
chrislovsund@294
    88
      <ant antfile="build-suite.xml" target="clean" inheritAll="false"/>
chrislovsund@294
    89
   </target>
chrislovsund@294
    90
chrislovsund@294
    91
   <target name="real-clean" depends="clean">
chrislovsund@294
    92
      <echo message="Cleaning netbeans IDE"/>
chrislovsund@294
    93
      <delete dir="build"/>
chrislovsund@294
    94
      <delete dir="dist"/>
chrislovsund@294
    95
      <delete dir="ide"/>
chrislovsund@294
    96
      <delete>
chrislovsund@294
    97
         <fileset dir="." includes="*.zip"/>
chrislovsund@294
    98
      </delete>
chrislovsund@294
    99
      <delete>
chrislovsund@294
   100
         <fileset dir="." includes="*.html"/>
chrislovsund@294
   101
      </delete>
chrislovsund@294
   102
      <delete file="${timestamp.file}"/>
chrislovsund@294
   103
   </target>
chrislovsund@294
   104
chrislovsund@294
   105
   <target name="nbms" depends="update-binaries">
chrislovsund@294
   106
      <ant antfile="build-suite.xml" target="nbms" inheritAll="false"/>
chrislovsund@294
   107
   </target>
chrislovsund@294
   108
chrislovsund@294
   109
   <target name="daily" depends="update-binaries,build">
chrislovsund@294
   110
      <mkdir dir="dist"/>
chrislovsund@294
   111
      <zip destfile="dist/netbeans-trunk-${build.id}-plsql.zip" duplicate="add">
chrislovsund@294
   112
         <zipfileset dir="build/cluster" prefix="netbeans/extra"/>
chrislovsund@294
   113
         <zipfileset dir="ide/netbeans" prefix="netbeans"/>
chrislovsund@294
   114
      </zip>
chrislovsund@294
   115
   </target>
jrechtacek@7
   116
chrislovsund@40
   117
   <property name="ant.contrib.jar" value="${basedir}/Libraries/ThirdParty/ant/ant-contrib-1.0b3.jar" />
chrislovsund@40
   118
   <taskdef resource="net/sf/antcontrib/antcontrib.properties">
chrislovsund@40
   119
      <classpath>
chrislovsund@40
   120
         <pathelement location="${ant.contrib.jar}"/>
chrislovsund@40
   121
      </classpath>
chrislovsund@40
   122
   </taskdef>
chrislovsund@40
   123
chrislovsund@40
   124
   <path id="manifest.file.paths">
chrislovsund@40
   125
      <fileset dir="${basedir}">
chrislovsund@40
   126
         <include name="**/manifest.mf"/>
chrislovsund@294
   127
         <!--            <exclude name="**/Libraries/ThirdParty/**"/>-->
chrislovsund@40
   128
      </fileset>
chrislovsund@40
   129
   </path>
chrislovsund@40
   130
chrislovsund@40
   131
   <target name="-find-modules-for-update" description="find all modules in suite that has changes since last release" >
chrislovsund@40
   132
      <loadproperties srcfile="nbproject/project.properties" />
chrislovsund@40
   133
      <mkdir dir="build"/>
chrislovsund@40
   134
      <delete file="build/nbms_update.properties" />
chrislovsund@40
   135
chrislovsund@40
   136
      <echo level="verbose">${modules}</echo>
chrislovsund@40
   137
chrislovsund@40
   138
      <foreach param="module.path" target="-vcs-log" list="${modules}" delimiter=":"/>
chrislovsund@294
   139
      <!--        <echoproperties srcfile="build/nbms_update.properties" />-->
chrislovsund@266
   140
   </target>
chrislovsund@266
   141
chrislovsund@266
   142
   <target name="-add-kit-module" description="add kit module to update" >
chrislovsund@40
   143
      <propertyfile  file="build/nbms_update.properties">
chrislovsund@40
   144
         <entry key="selected.modules" default="" operation="+" value="plsql-support.kit/manifest.mf:"/>
chrislovsund@40
   145
      </propertyfile>
chrislovsund@40
   146
   </target>
chrislovsund@40
   147
chrislovsund@40
   148
   <target name="-vcs-log" description="use mercurial to check if the last commit was a release commit">
chrislovsund@40
   149
      <echo level="info">module.path: ${module.path}</echo>
chrislovsund@40
   150
chrislovsund@294
   151
      <!-- find out revision number of HEAD, need svn.exe installed on local machine -->
chrislovsund@40
   152
      <exec executable="hg" outputproperty="hglog.out" >
chrislovsund@40
   153
         <arg line="log -l 1 --style compact '${module.path}'"/>
chrislovsund@40
   154
      </exec>
chrislovsund@40
   155
      <echo level="verbose">${hglog.out}</echo>
chrislovsund@40
   156
chrislovsund@40
   157
      <echo level="verbose">${force.increment}</echo>
chrislovsund@40
   158
      <condition property="nbm.update.needed">
chrislovsund@40
   159
         <or>
chrislovsund@40
   160
            <not>
chrislovsund@40
   161
               <contains string="${hglog.out}" substring="automated commit from "/>
chrislovsund@40
   162
            </not>
chrislovsund@40
   163
            <istrue value="${force.increment}" />
chrislovsund@40
   164
         </or>
chrislovsund@40
   165
      </condition>
chrislovsund@40
   166
      <echo level="verbose">nbm.update.needed=${nbm.update.needed}</echo>
chrislovsund@40
   167
      <antcall target="-concat-modules"  inheritall="true" />
chrislovsund@40
   168
   </target>
chrislovsund@40
   169
chrislovsund@40
   170
   <target name="-concat-modules" if="nbm.update.needed" description="Concatinate the selected module paths and put in .properties file">
chrislovsund@40
   171
      <echo>Module needs to be updated: ${nbm.update.needed}</echo>
chrislovsund@40
   172
      <echo level="info">module.path: ${module.path}</echo>
chrislovsund@40
   173
      <propertyfile  file="build/nbms_update.properties">
chrislovsund@40
   174
         <entry key="selected.modules" default="" operation="+" value="${module.path}/manifest.mf:"/>
chrislovsund@40
   175
      </propertyfile>
chrislovsund@40
   176
   </target>
chrislovsund@40
   177
chrislovsund@40
   178
   <target name="show-current-versions" description="show current specification versions for all modules">
chrislovsund@40
   179
      <foreach param="manifest.file" target="current-version" >
chrislovsund@40
   180
         <path refid="manifest.file.paths"/>
chrislovsund@40
   181
      </foreach>
chrislovsund@40
   182
   </target>
chrislovsund@40
   183
chrislovsund@40
   184
   <target name="current-version" depends="-read-version" description="show current specification.version">
chrislovsund@40
   185
   </target>
chrislovsund@40
   186
chrislovsund@266
   187
   <target name="update-version" depends="-find-modules-for-update, -add-kit-module"
chrislovsund@266
   188
           description="update version for all modules in suite that has changes since last release">
chrislovsund@266
   189
      <echo level="info">Updating modules to version: ${new_version}</echo>
chrislovsund@40
   190
      <loadproperties srcfile="build/nbms_update.properties" />
chrislovsund@40
   191
      <echo>selected.modules=${selected.modules}</echo>
chrislovsund@266
   192
      <foreach param="manifest.file" target="-update-meta-files" >
chrislovsund@40
   193
         <path path="${selected.modules}"/>
chrislovsund@40
   194
      </foreach>
chrislovsund@40
   195
   </target>
chrislovsund@40
   196
chrislovsund@40
   197
   <target name="-read-version">
chrislovsund@40
   198
      <echo level="verbose">manifest.file: ${manifest.file}</echo>
chrislovsund@40
   199
      <property file="${manifest.file}"></property>
chrislovsund@40
   200
      <property name="specification.version" value="${OpenIDE-Module-Specification-Version}"/>
chrislovsund@40
   201
      <echo>OpenIDE-Module: ${OpenIDE-Module}</echo>
chrislovsund@266
   202
      <echo>Current build number:${env.BUILD_NUMBER}</echo>
chrislovsund@40
   203
   </target>
chrislovsund@40
   204
chrislovsund@266
   205
   <target name="-update-meta-files" depends="-read-version">
chrislovsund@266
   206
      <manifest file="${manifest.file}" mode="update" >
chrislovsund@266
   207
         <attribute name="OpenIDE-Module-Specification-Version" value="${new_version}" />
chrislovsund@40
   208
      </manifest>
chrislovsund@266
   209
      <replaceregexp match="(dependency\D*code-name-base\W${OpenIDE-Module}\W/\D*)(\d+\.\d+\.\d+\.\d+)" byline="false"
chrislovsund@266
   210
                     file="plsql-support.kit/nbproject/project.xml" replace="\1${new_version}"/>
chrislovsund@40
   211
   </target>
chrislovsund@40
   212
chrislovsund@40
   213
   <target name="all">
chrislovsund@40
   214
      <propertyfile  file="build_info.properties">
chrislovsund@40
   215
         <entry key="build.major.number" type="int" operation="+" value="1" />
chrislovsund@40
   216
         <entry key="build.minor.number" type="int" operation="+" value="1" />
chrislovsund@40
   217
         <entry key="build.revision.number" type="int" operation="+" value="1" />
chrislovsund@40
   218
      </propertyfile>
chrislovsund@40
   219
   </target>
chrislovsund@40
   220
chrislovsund@43
   221
   <target name="echo-manifest" description="echo kit version that is found in manifest. Used by hudson" >
chrislovsund@43
   222
      <echoproperties srcfile="plsql-support.kit/manifest.mf"/>
chrislovsund@43
   223
   </target>
chrislovsund@43
   224
chrislovsund@312
   225
   <path id="maven-ant-tasks.classpath" path="Libraries/ThirdParty/ant/maven-ant-tasks-2.1.3.jar" />
chrislovsund@312
   226
   <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
chrislovsund@312
   227
            uri="antlib:org.apache.maven.artifact.ant"
chrislovsund@312
   228
            classpathref="maven-ant-tasks.classpath" />
chrislovsund@312
   229
chrislovsund@467
   230
   <target name="maven-install" description="install jars in local maven repo" depends="nbms">
chrislovsund@313
   231
      <condition property="nbm.update.exists">
chrislovsund@313
   232
         <available file="${basedir}/build/updates" />
chrislovsund@313
   233
      </condition>
chrislovsund@312
   234
chrislovsund@312
   235
      <fail unless="nbm.update.exists" message="need to build nbms first" />
chrislovsund@312
   236
      <foreach param="jar.path" target="-maven-install-jar" inheritall="true">
chrislovsund@312
   237
         <path>
chrislovsund@312
   238
            <fileset dir="build/cluster/modules">
chrislovsund@312
   239
               <include name="*.jar"/>
chrislovsund@312
   240
            </fileset>
chrislovsund@312
   241
         </path>
chrislovsund@312
   242
      </foreach>
chrislovsund@312
   243
   </target>
chrislovsund@312
   244
chrislovsund@312
   245
   <target name="-maven-install-jar" >
chrislovsund@312
   246
      <basename property="jar.file.name" file="${jar.path}"/>
chrislovsund@312
   247
      <basename property="name" file="${jar.path}" suffix=".jar"/>
chrislovsund@312
   248
      <echo level="info" message="Installing ${jar.file.name} in local maven repo as ${name}"/>
chrislovsund@312
   249
      <artifact:pom id="mypom" groupId="org.netbeans.api" artifactId="${name}" version="${new_version}" name="${name} project">
chrislovsund@312
   250
         <license name="IFS" url="http://www.ifsworld.com"/>
chrislovsund@312
   251
      </artifact:pom>
chrislovsund@312
   252
chrislovsund@312
   253
      <artifact:writepom pomRefId="mypom" file="build/mypom.xml"/>
chrislovsund@312
   254
      <artifact:pom id="mypom" file="build/mypom.xml" />
chrislovsund@312
   255
chrislovsund@312
   256
      <artifact:install file="${jar.path}"  >
chrislovsund@312
   257
         <pom refid="mypom"/>
chrislovsund@312
   258
         <attach file="${basedir}/build/updates/${name}.nbm" type="nbm"/>
chrislovsund@312
   259
      </artifact:install>
chrislovsund@312
   260
   </target>
chrislovsund@312
   261
chrislovsund@312
   262
   <target name="maven-deploy" description="deploy jars in remote internal maven repo" >
chrislovsund@313
   263
      <condition property="nbm.update.exists">
chrislovsund@313
   264
         <available file="${basedir}/build/updates" />
chrislovsund@313
   265
      </condition>
chrislovsund@312
   266
      <fail unless="nbm.update.exists" message="need to build nbms first" />
chrislovsund@312
   267
      <foreach param="jar.path" target="-maven-deploy-jar" inheritall="true">
chrislovsund@312
   268
         <path>
chrislovsund@312
   269
            <fileset dir="build/cluster/modules">
chrislovsund@312
   270
               <include name="*.jar"/>
chrislovsund@312
   271
            </fileset>
chrislovsund@312
   272
         </path>
chrislovsund@312
   273
      </foreach>
chrislovsund@312
   274
   </target>
chrislovsund@312
   275
chrislovsund@312
   276
   <target name="-maven-deploy-jar" >
chrislovsund@312
   277
      <artifact:install-provider artifactId="wagon-http" version="2.2"/>
chrislovsund@312
   278
chrislovsund@312
   279
      <basename property="jar.file.name" file="${jar.path}"/>
chrislovsund@312
   280
      <basename property="name" file="${jar.path}" suffix=".jar"/>
chrislovsund@312
   281
      <echo level="info" message="Installing ${jar.file.name} in local maven repo as ${name}"/>
chrislovsund@312
   282
      <artifact:pom id="mypom" groupId="org.netbeans.api" artifactId="${name}" version="${new_version}" name="${name} project">
chrislovsund@312
   283
         <license name="IFS" url="http://www.ifsworld.com"/>
chrislovsund@312
   284
      </artifact:pom>
chrislovsund@312
   285
chrislovsund@312
   286
      <artifact:writepom pomRefId="mypom" file="build/mypom.xml"/>
chrislovsund@312
   287
      <artifact:pom id="mypom" file="build/mypom.xml" />
chrislovsund@312
   288
chrislovsund@312
   289
      <artifact:deploy file="${jar.path}"  >
chrislovsund@312
   290
         <remoteRepository url="http://localhost:8082/nexus/content/repositories/releases">
chrislovsund@312
   291
            <authentication username="${maven.deploy.user}" password="${maven.deploy.password}"/>
chrislovsund@312
   292
         </remoteRepository>
chrislovsund@312
   293
         <pom refid="mypom"/>
chrislovsund@312
   294
         <attach file="${basedir}/build/updates/${name}.nbm" type="nbm"/>
chrislovsund@312
   295
      </artifact:deploy>
chrislovsund@312
   296
   </target>
chrislovsund@312
   297
chrislovsund@312
   298
jrechtacek@0
   299
</project>