sierra/build.xml
author Jesse Glick <jglick@netbeans.org>
Fri, 15 Apr 2011 18:22:14 -0400
changeset 4883 3463c7d16cd0
parent 4612 8faffb7e4b91
parent 4553 008d740df84b
permissions -rw-r--r--
Prefer soa-main versions of sierra scripts.
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <!--
     3     DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     4 
     5     Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
     6 
     7     Oracle and Java are registered trademarks of Oracle and/or its affiliates.
     8     Other names may be trademarks of their respective owners.
     9 
    10     The contents of this file are subject to the terms of either the GNU
    11     General Public License Version 2 only ("GPL") or the Common
    12     Development and Distribution License("CDDL") (collectively, the
    13     "License"). You may not use this file except in compliance with the
    14     License. You can obtain a copy of the License at
    15     http://www.netbeans.org/cddl-gplv2.html
    16     or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    17     specific language governing permissions and limitations under the
    18     License. When distributing the software, include this License Header
    19     Notice in each file and include the License file at
    20     nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    21     particular file as subject to the "Classpath" exception as provided
    22     by Oracle in the GPL Version 2 section of the License file that
    23     accompanied this code. If applicable, add the following below the
    24     License Header, with the fields enclosed by brackets [] replaced by
    25     your own identifying information:
    26     "Portions Copyrighted [year] [name of copyright owner]"
    27 
    28     Contributor(s):
    29 
    30     The Original Software is NetBeans. The Initial Developer of the Original
    31     Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
    32     Microsystems, Inc. All Rights Reserved.
    33 
    34     If you wish your version of this file to be governed by only the CDDL
    35     or only the GPL Version 2, indicate your decision by adding
    36     "[Contributor] elects to include this software in this distribution
    37     under the [CDDL or GPL Version 2] license." If you do not indicate a
    38     single choice of license, a recipient has the option to distribute
    39     your version of this file under either the CDDL, the GPL Version 2 or
    40     to extend the choice of license to its licensees as provided above.
    41     However, if you add GPL Version 2 code and therefore, elected the GPL
    42     Version 2 license, then the option applies only if the new code is
    43     made subject to such option by the copyright holder.
    44 -->
    45 <project name="main" basedir="." default="main">
    46     <import file="build.tst"/>
    47 
    48     <target name="main" depends="init,netbeans,clean,build,javadoc,zip"/>
    49     <target name="test" depends="get-daily-test,clean,init,sierra"/>
    50 
    51     <target name="init">
    52         <property name="env.BUILD_NUMBER" value=""/>
    53         
    54         <tstamp>
    55             <format property="time.stamp" pattern="yyyyMMdd_HHmm"/>
    56         </tstamp>
    57 
    58         <ant dir="${home}/nbbuild" target="download-all-extbins"/>
    59     </target>
    60 
    61     <!-- netbeans -->
    62     <target name="netbeans">
    63         <java jar="build.jar" fork="true" classpath="." outputproperty="netbeans.file">
    64             <sysproperty key="netbeans-prox" value="${netbeans.prox}"/>
    65             <sysproperty key="netbeans-type" value="${netbeans.type}"/>
    66             <sysproperty key="netbeans-link" value="${netbeans.host}/${netbeans.path}"/>
    67         </java>
    68 
    69         <mkdir dir="${cache}/netbeans"/>
    70         <property name="netbeans.url" value="${netbeans.host}/${netbeans.path}/${netbeans.file}"/>
    71         <get src="${netbeans.url}" dest="${cache}/netbeans/${netbeans.zip}" usetimestamp="true"/>
    72 
    73         <delete dir="${home}/nbbuild/netbeans"/>
    74         <unzip src="${cache}/netbeans/${netbeans.zip}" dest="${home}/nbbuild"/>
    75 
    76         <replace file="${home}/nbbuild/netbeans/etc/netbeans.conf" token="${netbeans.user}" value="${sierra.user}"/>
    77 
    78         <echo file="${build.number}" message="netbeans build: ${netbeans.file}${line.separator}" append="true"/>
    79         <echo file="${build.number}" message="sierra build: ${time.stamp}${line.separator}" append="true"/>
    80         <echo file="${build.number}" message="sierra hudson: ${env.BUILD_NUMBER}${line.separator}" append="true"/>
    81         <echo file="${build.number}" message="repository: ${repository}" append="true"/>
    82         
    83         <chmod file="${home}/nbbuild/netbeans/bin/netbeans" perm="ugo+rx"/>
    84     </target>
    85 
    86     <!-- sierra -->
    87     <target name="sierra">
    88         <mkdir dir="${cache}/netbeans"/>
    89         <property name="sierra.url" value="${sierra.host}/${sierra.path}/${sierra.file}"/>
    90         <get src="${sierra.url}" dest="${cache}/netbeans/${sierra.file}" usetimestamp="true"/>
    91         <delete dir="${home}/nbbuild/netbeans"/>
    92         <unzip src="${cache}/netbeans/${sierra.file}" dest="${home}/nbbuild"/>
    93     </target>
    94 
    95     <!-- zip -->
    96     <target name="zip">
    97         <delete dir="${cache}/latest"/>
    98         <mkdir dir="${cache}/latest"/>
    99 
   100         <zip destfile="${cache}/latest/${build.name}_${env.BUILD_NUMBER}_${time.stamp}.zip">
   101             <zipfileset dir="${home}/nbbuild">
   102                 <include name="netbeans/**"/>
   103                 <exclude name="netbeans/ergonomics/**"/>
   104                 <exclude name="netbeans/groovy/**"/>
   105                 <exclude name="netbeans/identity/**"/>
   106                 <exclude name="netbeans/javacard/**"/>
   107                 <exclude name="netbeans/mobility/**"/>
   108                 <exclude name="netbeans/profiler/**"/>
   109                 <exclude name="netbeans/moduleCluster.properties"/>
   110                 <exclude name="netbeans/**/.lastModified"/>
   111             </zipfileset>
   112         </zip>
   113 
   114         <copy file="${cache}/latest/${build.name}_${env.BUILD_NUMBER}_${time.stamp}.zip" tofile="${cache}/latest/${build.name}.zip"/>
   115     </target>
   116 
   117     <!-- daily -->
   118     <target name="get-daily-test" depends="check-daily,get-test"/>
   119     
   120     <target name="check-daily">
   121         <mkdir dir="${cache}/test/lock"/>
   122 
   123         <tstamp>
   124             <format property="daily" pattern="yyyyMMdd"/>
   125         </tstamp>
   126 
   127         <available property="lock.available" file="${cache}/test/lock/${daily}"/>
   128     </target>
   129 
   130     <target name="get-test" unless="lock.available">
   131         <delete>
   132             <fileset dir="${cache}/test/lock" includes="*"/>
   133         </delete>
   134 
   135         <echo file="${cache}/test/lock/${daily}" message="${daily}"/>
   136         <cvs package="${test.cvs.modules}" cvsRoot="${test.cvs.host}" dest="${cache}/test" command="-q co -P ${test.cvs.branch}" failonerror="false"/>
   137     </target>
   138 
   139     <!-- javadoc -->
   140     <target name="javadoc">
   141         <!--ant target="javadoc" dir="${home}/print"/-->
   142     </target>
   143 
   144     <!-- module -->
   145     <!--target name="build-module">
   146         <echo message="============= ${module} ============="/>
   147         <ant dir="${home}/${module}" target="netbeans"/>
   148     </target-->
   149 
   150     <!-- clean -->
   151     <target name="clean">
   152         <delete>
   153             <fileset dir="${home}" includes="*/build/**/*"/>
   154         </delete>
   155     </target>
   156 
   157     <!-- build -->
   158     <target name="build" depends="build-01, build-02, build-03"/>
   159     
   160     <target name="build-01">
   161         <ant dir="${home}/xml.kit" target="netbeans"/>
   162         <ant dir="${home}/soa.kit" target="netbeans"/>
   163     </target>
   164 
   165     <target name="build-02">
   166         <ant dir="${home}/bpel.kit" target="netbeans"/>
   167         <ant dir="${home}/xslt.kit" target="netbeans"/>
   168         <ant dir="${home}/wlm.kit" target="netbeans"/>
   169     </target>
   170 
   171     <target name="build-03">
   172         <ant dir="${home}/esb.kit" target="netbeans"/>
   173         <ant dir="${home}/encoder.kit" target="netbeans"/>
   174         <ant dir="${home}/wsdlextensions.kit" target="netbeans"/>
   175     </target>
   176 </project>