Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
<fail message="Please build using Ant 1.9.8 or higher.">
<condition>
<not>
<antversion atleast="1.9.8"/>
</not>
</condition>
</fail>
<import file="default.xml"/>
<!-- To make people happy who want to do `ant clean all': -->
<target name="all" depends="build,commit-validation" description="Build the IDE and run basic validation tests."/>
<target name="all-nozip" depends="build-nozip,commit-validation" description="Build the IDE (no ZIP file, unpacked) and run basic validation tests."/>
<target name="bootstrap" description="Bootstrap NetBeans-specific Ant extensions."
depends="-jdk-init,-load-build-properties">
<echo message="ant version: ${ant.version}"/>
<echo message="Java version: ${java.version}"/>
<echo message="JAVA_HOME: ${java.home}"/>
<fail message="You need to run on JDK 8+ to build NetBeans; java.home=${java.home}">
<condition>
<matches pattern="^1\.[01234567].*" string="${java.version}"/>
</condition>
</fail>
<fail message="You need JDK 8+ to build NetBeans; nbjdk.home=${nbjdk.home} java.home=${java.home}">
<condition>
<not>
<or>
<isset property="have-jdk-1.8"/>
<isset property="have-jdk-1.9"/>
</or>
</not>
</condition>
</fail>
<property name="build.ant.classes.dir" location="${nb.build.dir}/antclasses"/>
<mkdir dir="${build.ant.classes.dir}"/>
<javac srcdir="antsrc" destdir="${build.ant.classes.dir}" deprecation="true" debug="${build.compiler.debug}" source="1.8" target="1.8">
<classpath>
<pathelement location="${ant.core.lib}"/>
</classpath>
<include name="org/netbeans/nbbuild/extlibs/DeregisterExternalHook.java"/>
<include name="org/netbeans/nbbuild/extlibs/DownloadBinaries.java"/>
<compilerarg line="-Xlint -Xlint:-serial"/>
</javac>
<taskdef name="deregisterexternalhook" classname="org.netbeans.nbbuild.extlibs.DeregisterExternalHook" classpath="${build.ant.classes.dir}"/>
<deregisterexternalhook root=".."/>
<taskdef name="downloadbinaries" classname="org.netbeans.nbbuild.extlibs.DownloadBinaries" classpath="${build.ant.classes.dir}"/>
<taskdef name="configureproxy" classname="org.netbeans.nbbuild.extlibs.ConfigureProxy" classpath="${build.ant.classes.dir}"/>
<property name="have-downloadbinaries-task" value="true" />
<downloadbinaries cache="${binaries.cache}" server="${binaries.server}" repos="${binaries.repos}">
<manifest dir="${nb_all}">
<include name="nbbuild/external/binaries-list"/>
<include name="platform/libs.junit4/external/binaries-list"/>
<include name="platform/javahelp/external/binaries-list"/>
</manifest>
</downloadbinaries> <!-- nb-extra-files denotes directories/files, that are not packed for distribution. The clusters are only used for local development/testing. The files must not be included in distribution zip and also need to be excluded from license analysis
-->
<property name="nb-extra-files" value="test/**,extra/**"/>
<echo message="Bootstrapping NetBeans-specific Ant extensions..."/>
<path id="bootstrap-cp">
<pathelement location="${ant.core.lib}"/>
<fileset dir=".."> <!-- For JavaHelp indexing and link checking: -->
<include name="platform/javahelp/external/jhall*.jar"/> <!-- For json parsing -->
<include name="nbbuild/external/json-simple*.jar"/> <!-- For parsing some web : -->
<include name="nbbuild/external/jsoup*.jar"/>
</fileset>
</path>
<javac srcdir="antsrc" destdir="${build.ant.classes.dir}" deprecation="true" debug="${build.compiler.debug}" source="1.8" target="1.8">
<classpath refid="bootstrap-cp"/>
<compilerarg line="-Xlint -Xlint:-serial"/>
</javac>
<jar jarfile="${nbantext.jar}">
<fileset dir="${build.ant.classes.dir}"/>
<fileset dir="antsrc">
<exclude name="**/*.java"/>
<exclude name="**/package.html"/>
<exclude name="package-list"/>
</fileset>
<zipfileset dir="${nb_all}" includes="LICENSE" fullpath="META-INF/LICENSE"/>
<zipfileset dir="${nb_all}/nbbuild" includes="notice-stub.txt" fullpath="META-INF/NOTICE"/>
</jar>
<taskdef name="createlicensesummary" classname="org.netbeans.nbbuild.extlibs.CreateLicenseSummary" classpath="${nbantext.jar}"/>
<!-- prepare task to create properties files-->
<taskdef name="releasejson" classname="org.netbeans.nbbuild.ReleaseJsonProperties" >
<classpath>
<pathelement location="${nbantext.jar}"/>
<fileset dir="${nb_all}/nbbuild/external">
<include name="json*.jar"/>
</fileset>
</classpath>
</taskdef> <!-- task to alter cluster definition for javadoc -->
<taskdef name="setjavadoc" classname="org.netbeans.nbbuild.SetApidocClustersConfig"classpath="${nbantext.jar}"/>
<antcall target="getjsonfile" /> <!-- get branches and git information as previous not overrided this will take new-->
<antcall target="getgitinformation" />
<target name="getjsonfile"> <!-- copy all related release properties -->
<copy file="${nb_all}/nbbuild/netbeansrelease.json" tofile="${nb_all}/nbbuild/build/netbeansrelease.json" failonerror="false"/> <!-- read info from gitinfo.properties , if present in source bundle copy gitinfo-->
<copy file="${nb_all}/nbbuild/gitinfo.properties" tofile="${nb_all}/nbbuild/build/gitinfo.properties" failonerror="false"/>
<property name="metabuild.releasejson" value="${nb_all}/nbbuild/build/netbeansrelease.json"/> <!-- get all json info we have on apache gitbox -->
<condition property="metabuild.jsonurl" value="https://netbeans.apache.org/nbbuild/netbeansrelease.json">
<not>
<isset property="metabuild.jsonurl"/>
</not>
</condition>
<condition property="needjsondownload" value="true" else="false">
<not>
<available file="${nb_all}/nbbuild/build/netbeansrelease.json" />
</not>
</condition>
<sequential if:true="${needjsondownload}" >
<configureproxy connectTo="${metabuild.jsonurl}" hostProperty="proxyHost" portProperty="proxyPort"/>
<setproxy proxyhost="${proxyHost}" proxyPort="${proxyPort}"/>
<get dest="${metabuild.releasejson}" skipexisting="false" src="${metabuild.jsonurl}"/>
</sequential>
</target>
<echo message="Processing build with branch ${metabuild.branch} and hash ${metabuild.hash}" /> <!-- if hash not present do not fail -->
<fail message="Branch not found use -Dmetabuild.branch=branchName " >
<condition>
<not>
<isset property="metabuild.branch"/>
</not>
</condition>
</fail>
<echo unless:set="metabuild.hash" file="${nb_all}/nbbuild/build/gitinfo.properties" >metabuild.branch=${metabuild.branch}</echo>
<echo if:set="metabuild.hash" file="${nb_all}/nbbuild/build/gitinfo.properties" >metabuild.branch=${metabuild.branch}
metabuild.hash=${metabuild.hash}</echo>
</target>
<target name="-git.up" if="${gitinfo.present}" depends="-gitinfo.ispresent">
<property file="${nb_all}/nbbuild/build/gitinfo.properties"/>
<echo message="Processing build with branch ${metabuild.branch} and hash ${metabuild.hash}" />
</target>
<target name="init" depends="init-module-list,set-buildnumber">
<fail message="You need to have some modules checked out to build NetBeans. For example, try running the 'checkout' target.">
<condition>
<not>
<available file="../platform/core.startup/"/>
</not>
</condition>
</fail>
<taskdef name="nbmerge" classname="org.netbeans.nbbuild.NbMerge" classpath="${nbantext.jar}"/>
<taskdef name="getdependsclusters" classname="org.netbeans.nbbuild.GetDependsClusters" classpath="${nbantext.jar}"/>
<taskdef name="repeat" classname="org.netbeans.nbbuild.Repeat" classpath="${nbantext.jar}"/>
<target name="javadoc" depends="bootstrap" description="Builds Javadoc for all NetBeans modules with some APIs">
<ant dir="javadoctools" target="build-javadoc"/>
</target>
<target name="javadoc-nb" depends="javadoc" description="Builds Javadoc and opens it in a web browser">
<nbbrowse file="${netbeans.javadoc.dir}/index.html"/>
</target>
<!-- build source zips for selected modules - useful for populating maven repository only-->
<target name="build-source-zips" depends="init" description="Builds source zips for maven repository inclusion.">
<property name="netbeans.zipped.sources.dir" location="${nb.build.dir}/source-zips"/>
<!-- Use of nbmerge target has the effect of automatically depending on all-X for every module. --> <!-- It also runs deltree(dir=wherever) and copydir(src=../X/netbeans,dest=wherever) to create the IDE install. -->
<target name="build-nozip" depends="init,download-selected-extbins,clean-cluster-flags,build-clusters,create-mandatory-files-for-binary,create-netbeans-import,finish-build,add-junit" description="Build the IDE but do not create a final ZIP file."/>
<target name="-check-nb-cluster" depends="init">
<condition property="has.nb.cluster">
<contains string="${nb.clusters.list}" substring="nb.cluster.nb" />
</condition>
</target>
<target name="finish-build" depends="finish-build-platform,finish-build-nb"/>
<target name="finish-build-platform" depends="init,-check-nb-cluster" unless="has.nb.cluster">
<copy file="../platform/o.n.bootstrap/readme/README-bin.txt" tofile="${netbeans.dest.dir}/README.txt" overwrite="true"/>
<fixcrlf eol="lf" srcdir="${netbeans.dest.dir}" >
<include name="${nb.cluster.platform.dir}/lib/nbexec" />
</fixcrlf>
</target>
<mkdir dir="${netbeans.dest.dir}/bin" />
<copy file="../nb/ide.launcher/unix/netbeans" todir="${netbeans.dest.dir}/bin" />
<chmod file="${netbeans.dest.dir}/bin/netbeans" perm="ugo+rx"/> <!-- if anybody knows better place for icons, let me know: jtulach@netbeans.org -->
<target name="build-nozip-ml" depends="init-module-list" description="Build the Multilanguage IDE but do not create a final ZIP file.">
<subant target="netbeans-ml" buildpath="${modules.fullpath}">
<property name="netbeans.dest.dir" value="${netbeans.dest.dir}"/>
</subant>
</target>
<target name="build-zip-ml" depends="bootstrap,set-buildnumber,check-locales-set,build-nozip-ml"
description="Create a compleate multilanguage build including a ZIP distributions">
<fail message="Property locales must be set to reasonable value" unless="locales.is.set"/>
<echo message="nb.clusters.list is ${nb.clusters.list}"/>
<taskdef name="repeat" classname="org.netbeans.nbbuild.Repeat"
classpath="${nbantext.jar}"/>
<property name="buildnum" value="dev-${buildnumber}"/>
<repeat target="pack-one-cluster-ml" name="one.cluster.name.ml" values="${nb.clusters.list}"/>
</target>
<target name="-testuserdir-delete-init" depends="-load-build-properties">
<property name="test.user.dir.lock" location="${test.user.dir}/lock"/>
<available property="app.running" file="${test.user.dir.lock}"/>
</target>
<target name="-testuserdir-delete-ok" depends="-testuserdir-delete-init" unless="app.running">
<delete dir="${test.user.dir}"/>
</target>
<target name="-testuserdir-delete-fail" depends="-testuserdir-delete-init" if="app.running"> <!-- #66799: best to warn about this condition... -->
<fail>Will not delete ${test.user.dir} because ${test.user.dir.lock} still exists; kill any running process and delete lock file if necessary</fail>
</target>
<target name="testuserdir-delete" depends="-testuserdir-delete-ok,-testuserdir-delete-fail" description="Clean temporary testing user directory."/>
<target name="tryme-debug" depends="-jdk-presetdef-nbjpdastart" description="Start IDE in debugger. May only be called from within IDE.">
<echo>Searching for JARs in ${netbeans.dest.dir}, this may take a moment...</echo>
<nbjpdastart name="NetBeans" addressproperty="debug.port" transport="dt_socket">
<classpath>
<fileset dir="${netbeans.dest.dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</nbjpdastart>
<property name="debug.server" value="n"/>
<antcall target="tryme"/>
</target>
<target name="-tryme-profile-pre72" depends="-jdk-presetdef-nbprofiledirect" if="profiler.info.jvmargs.agent" description="Start IDE in profiler (pre72 compatibility mode). May only be called from within IDE.">
<property name="profiler.roots.path" value="profiler.roots.all" />
<fileset id="profiler.roots.all" dir="${netbeans.dest.dir}">
<include name="**/*.jar"/>
</fileset>
<nbprofiledirect
jvmargsprefix="-J"
jvmargsproperty="profiler.jvmargs"
mainclass="org.netbeans.Main"
>
<classpath>
<fileset dir="${netbeans.dest.dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<rootspath>
<fileset refid="${profiler.roots.path}" />
</rootspath>
</nbprofiledirect>
</target>
<target name="tryme-profile" depends="-profile-check,-tryme-profile-pre72" if="profiler.configured" unless="profiler.info.jvmargs.agent" description="Start IDE in profiler. May only be called from within IDE.">
<startprofiler/>
<property name="tryme.debug.args" value="-J-Dorg.osgi.framework.bootdelegation=org.netbeans.lib.profiler,org.netbeans.lib.profiler.*" />
<antcall target="tryme"/>
</target>
<target name="tryme" depends="-load-build-properties,tryme-setup-debug-args,-jdk-init"
description="Try running the IDE interactively.
It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in debug mode"
>
<taskdef name="mergetrymeargs" classname="org.netbeans.nbbuild.MergeTrymeArgs" classpath="${nbantext.jar}"/>
<mergetrymeargs/>
<property name="tryme.jdkhome" value="${nbjdk.home}"/>
<property name="tryme.debug.args" value="" />
<property environment="env"/>
<condition property="run.env.display" value="${env.NBDISPLAY}" else="${env.DISPLAY}">
<isset property="env.NBDISPLAY"/>
</condition>
<!-- architecture of jvm on which app will run -->
<condition property="jvm.arch.string" value="" else="64">
<or>
<available file="${nbjdk.home}\bin\javaaccessbridge-32.dll" /> <!-- 32-bit Java 9+ -->
<available file="${nbjdk.home}\jre\bin\JavaAccessBridge-32.dll" /> <!-- 32-bit Java 8 -->
</or>
</condition>
<target name="clean-untracked-files" depends="bootstrap" description="Removes files from clusters which are not listed as belonging to any NBM.">
<taskdef name="ducf" classname="org.netbeans.nbbuild.DeleteUnreferencedClusterFiles" classpath="${nbantext.jar}"/>
<ducf report="${nb.build.dir}/ducf.xml">
<clusters dir="${netbeans.dest.dir}">
<include name="*"/>
</clusters>
<selection excludes="build_info"/>
</ducf>
</target>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.