build.xml
author Jiri Rechtacek <jrechtacek@netbeans.org>
Sun, 18 Sep 2011 15:31:13 +0200
branchmultiview_prototype
changeset 19 cd34d58c6d85
parent 11 3802fd33af24
child 20 b6be3b960ca1
permissions -rw-r--r--
registrer Prototype multiview
     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>
     7     
     8     <property file="build.properties"/>
     9     <property file="nbproject/private/platform-private.properties"/>
    10     <property file="nbproject/platform.properties"/>
    11     
    12     <property name="use.timestamp" value="true"/>
    13     <property name="timestamp.file" value=".lastModified"/>
    14     
    15     <property environment="env"/>
    16     <condition property="build.id" value="${env.BUILD_ID}" else="dev">
    17         <isset property="env.BUILD_ID"/>
    18     </condition>
    19     
    20     <target name="calculate-netbeans-url" unless="skip.calculation">
    21         <get src="${netbeans.base.url}" dest="netbeans.html" usetimestamp="${use.timestamp}" verbose="true" ignoreerrors="${offline}"/>
    22         <loadfile srcfile="netbeans.html" property="netbeans.binaries.url">
    23             <filterchain>
    24                 <tokenfilter>
    25                     <containsregex pattern=".*href=&quot;(netbeans-[a-z0-9-.]*javaee\.zip)&quot;.*" replace="${netbeans.base.url}/\1" flags="im"/>
    26                 </tokenfilter>
    27             </filterchain>
    28         </loadfile>
    29     </target>
    30 
    31     <target name="download-binaries" depends="calculate-netbeans-url" unless="skip.download">
    32         <parallel>
    33             <get src="${netbeans.binaries.url}" dest="netbeans.zip" usetimestamp="${use.timestamp}" verbose="false" ignoreerrors="${offline}"/>
    34         </parallel>
    35      </target>
    36      
    37      <target name="check-binaries">
    38         <condition property="binaries.uptodate">
    39             <and>
    40                 <uptodate targetfile="${timestamp.file}">
    41                     <srcfiles dir="." includes="*.zip"/>
    42                 </uptodate>
    43             </and>            
    44         </condition>
    45      </target>     
    46 
    47      <target name="unzip-binaries" unless="binaries.uptodate">
    48         <echo message="New binaries downloaded - re-installing."/>
    49         <delete dir="ide"/>
    50         <unzip src="netbeans.zip" dest="ide"/>
    51         <touch file="${timestamp.file}"/>        
    52     </target>
    53     
    54     <target name="update-binaries" depends="download-binaries,check-binaries,unzip-binaries"/>
    55     
    56     <target name="check-harness">
    57         <echo>nbplatform.default.netbeans.dest.dir resolved to ${nbplatform.default.netbeans.dest.dir}</echo>
    58         <echo>nbplatform.default.harness.dir resolved to ${nbplatform.default.harness.dir}</echo>
    59         <fail message="Harness is missing. Specify nbplatform.default.netbeans.dest.dir={path-to-your-sources-root}/ide/netbeans in nbproject/private/platform-private.propetries">
    60             <condition>
    61                 <not>
    62                     <available file="${nbplatform.default.harness.dir}" type="dir"/>
    63                 </not>
    64             </condition>
    65         </fail>
    66     </target>
    67     
    68     <target name="build-suite" depends="check-harness">
    69         <ant antfile="build-suite.xml" target="build" inheritAll="false"/>
    70     </target>
    71     
    72     <target name="printinfo">
    73       <property environment="env" />
    74       <echo message="${env.BUILD_TAG}"/>
    75       <echo message="${env.JAVA_HOME}"/>
    76     </target>
    77     
    78     <target name="netbeans" depends="update-binaries,build-suite"/>
    79     <target name="build" depends="netbeans"/>
    80     
    81     <target name="clean">
    82         <echo>nbplatform.default.netbeans.dest.dir resolved to ${nbplatform.default.netbeans.dest.dir}</echo>
    83         <echo>nbplatform.default.harness.dir resolved to ${nbplatform.default.harness.dir}</echo>
    84         <ant antfile="build-suite.xml" target="clean" inheritAll="false"/>
    85     </target>
    86     
    87     <target name="real-clean" depends="clean">
    88         <echo message="Cleaning netbeans IDE"/>
    89         <delete dir="build"/>
    90         <delete dir="dist"/>
    91         <delete dir="ide"/>
    92         <delete>
    93             <fileset dir="." includes="*.zip"/>
    94         </delete>
    95         <delete>
    96             <fileset dir="." includes="*.html"/>
    97         </delete>
    98         <delete file="${timestamp.file}"/>
    99     </target>
   100 
   101     <target name="nbms" depends="update-binaries">
   102         <ant antfile="build-suite.xml" target="nbms" inheritAll="false"/>
   103     </target>
   104     
   105     <target name="daily" depends="update-binaries,build">
   106         <mkdir dir="dist"/>
   107         <zip destfile="dist/netbeans-trunk-${build.id}-plsql.zip" duplicate="add">
   108             <zipfileset dir="build/cluster" prefix="netbeans/extra"/>
   109             <zipfileset dir="ide/netbeans" prefix="netbeans"/>
   110         </zip>
   111     </target>
   112 
   113 </project>