Source

main-silver / o.n.core / build.xml

<?xml version='1.0' encoding='ISO-8859-1' ?><!-- -*- sgml-indent-step: 2 -*- -->
<!--
                Sun Public License Notice

The contents of this file are subject to the Sun Public License
Version 1.0 (the "License"). You may not use this file except in
compliance with the License. A copy of the License is available at
http://www.sun.com/

The Original Code is NetBeans. The Initial Developer of the Original
Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
Microsystems, Inc. All Rights Reserved.
-->

<project name="core" default="netbeans" basedir=".">

  <taskdef name="locjar" classname="org.netbeans.nbbuild.LocalizedJar" classpath="../nbbuild/nbantext.jar"/>
  <taskdef name="makenbm" classname="org.netbeans.nbbuild.MakeNBM" classpath="../nbbuild/nbantext.jar"/>
  <taskdef name="genlist" classname="org.netbeans.nbbuild.MakeListOfNBM" classpath="../nbbuild/nbantext.jar"/>
  <property name="homepage.base" value="netbeans.org"/>
  <property name="dist.base" value="www.netbeans.org/download/nbms/40"/>
  <property name="license.file" location="../nbbuild/standard-nbm-license.txt"/>

  <target name="init">
    <ant dir="external" target="unscramble"/>
  </target>

  <target name="compile" depends="boot">
    <javac srcdir="src" destdir="src" deprecation="${build.compiler.deprecation}" debug="${build.compiler.debug}">
      <classpath>
        <pathelement location="../openide/openide-13javac-workaround.jar"/>
        <pathelement location="../openide/netbeans/lib/openide.jar"/>
        <pathelement location="netbeans/lib/ext/boot.jar"/>
        <fileset dir="external">
          <include name="regexp*.jar"/>
          <include name="xml-apis*.jar"/>
        </fileset>
      </classpath>
    </javac>
  </target>

  <!-- XXX move to bootstrap/build.xml -->  
  <target name="boot" depends="init">
    <javac srcdir="bootstrap/src" destdir="bootstrap/src" deprecation="${build.compiler.deprecation}" debug="${build.compiler.debug}"/>
    <mkdir dir="netbeans/lib/ext" />
    <jar jarfile="netbeans/lib/ext/boot.jar"
            basedir="bootstrap/src"
            excludesfile="../nbbuild/standard-jar-excludes.txt"
	    compress="false">
    </jar>
  </target>

  <target name="jars" depends="compile">
    <mkdir dir="netbeans/lib"/>
    <filter token="BUILD_NUMBER_SUBST" value="${buildnumber}"/>
    <copy file="manifest.mf" tofile="manifest-subst.mf" filtering="on"/>
    <locjar jarfile="netbeans/lib/core.jar"
            basedir="src"
            manifest="manifest-subst.mf"
            excludesfile="../nbbuild/standard-jar-excludes.txt"
            excludes="org/netbeans/*class"
	    compress="false">
      <locale name="ja"/>
    </locjar>
  </target>

  <target name="release">
    <copy todir="netbeans" includeEmptyDirs="false">
      <fileset dir="release" excludesfile="../nbbuild/standard-jar-excludes.txt"/>
    </copy>
    <mkdir dir="netbeans/lib/ext"/>
    <copy todir="netbeans/lib/ext">
      <fileset dir="external">
        <include name="crimson*.jar"/>
        <include name="xerces*.jar"/>
        <include name="xml-apis*.jar"/>
        <include name="regexp*.jar"/>
      </fileset>
    </copy>
    <fixcrlf srcdir="netbeans/bin" eol="crlf">
      <include name="**/*.bat"/>
      <include name="**/*.cmd"/>
    </fixcrlf>
  </target>

  <target name="netbeans" depends="jars,release" description="Build everything.">
    <mkdir dir="netbeans/lib/patches"/>
    <mkdir dir="netbeans/modules"/>
    <genlist targetname="nbm" outputfiledir="netbeans"/>
  </target>

  <target name="nbm" depends="netbeans" description="Build an NBM.">
    <makenbm file="core.nbm"
             topdir="."
             module="netbeans/lib/core.jar"
	     homepage="http://core.${homepage.base}/"
	     distribution="http://${dist.base}/core.nbm">
      <license name="core-license.txt">
        <text>For the NetBeans core code itself:</text>
        <file location="${license.file}"/>
        <text>For the Crimson, Regexp, and Xerces software products
included with the NetBeans core:</text>
        <file location="../nbbuild/external/apache-license.txt"/>
        <text>For the XML Commons software product:</text>
        <file location="external/xml-apis-license.txt"/>
      </license>
      <signature keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
    </makenbm>
  </target>

  <target name="lib-modules" description="Create a standalone Modules API and implementation.">
    <mkdir dir="modules-lib/src"/>
    <copy todir="modules-lib/src">
      <fileset dir="../openide/src">
        <include name="org/openide/modules/SpecificationVersion.java"/>
        <include name="org/openide/modules/ModuleInfo.java"/>
        <include name="org/openide/modules/ModuleInstall.java"/>
        <include name="org/openide/modules/Dependency.java"/>
      </fileset>
      <fileset dir="src">
        <include name="org/netbeans/core/modules/ChangeFirer.java"/>
        <include name="org/netbeans/core/modules/DuplicateException.java"/>
        <include name="org/netbeans/core/modules/Events.java"/>
        <include name="org/netbeans/core/modules/InvalidException.java"/>
        <include name="org/netbeans/core/modules/JarClassLoader.java"/>
        <include name="org/netbeans/core/modules/ManifestSection.java"/>
        <include name="org/netbeans/core/modules/Module.java"/>
        <include name="org/netbeans/core/modules/ModuleInstaller.java"/>
        <include name="org/netbeans/core/modules/ModuleManager.java"/>
        <include name="org/netbeans/core/modules/ProxyClassLoader.java"/>
        <include name="org/netbeans/core/modules/Util.java"/>
      </fileset>
    </copy>
    <ant dir="../openide" target="lib-util"/>
    <javac srcdir="modules-lib/src" destdir="modules-lib/src" deprecation="${build.compiler.deprecation}" debug="${build.compiler.debug}">
      <exclude name="org/netbeans/core/modules/ManifestSection.java"/>
      <classpath>
        <pathelement location="../openide/netbeans/lib/openide-util.jar"/>
      </classpath>
    </javac>
    <ant dir="../openide" target="jars"/>
    <javac srcdir="modules-lib/src" destdir="modules-lib/src" deprecation="${build.compiler.deprecation}" debug="${build.compiler.debug}">
      <include name="org/netbeans/core/modules/ManifestSection.java"/>
      <classpath>
        <pathelement location="../openide/netbeans/lib/openide.jar"/>
      </classpath>
    </javac>
    <tstamp>
      <format property="buildnumber-default" pattern="yyyyMMddHHmm"/>
    </tstamp>
    <property name="buildnumber" value="${buildnumber-default}"/>
    <filter token="BUILD_NUMBER_SUBST" value="${buildnumber}"/>
    <copy file="manifest-modules.mf" tofile="modules-lib/manifest-modules-subst.mf" filtering="on"/>
    <jar jarfile="modules-lib/modules.jar" manifest="modules-lib/manifest-modules-subst.mf">
      <fileset dir="modules-lib/src">
        <exclude name="**/*.java"/>
        <exclude name="org/netbeans/core/modules/ManifestSection$*Section*.class"/>
      </fileset>
    </jar>
  </target>

  <target name="clean" description="Clean all build products.">
    <delete>
      <fileset dir="src">
        <include name="**/*.class"/>
      </fileset>
      <fileset dir="bootstrap/src">
        <include name="**/*.class"/>
      </fileset>
      <fileset dir=".">
        <include name="*-subst.mf"/>
      </fileset>
    </delete>
    <delete dir="netbeans"/>
    <delete dir="modules-lib"/>
    <delete dir="Info"/>
    <delete file="core.nbm"/>
  </target>

</project>