📄 suite.xml
字号:
<?xml version="1.0" encoding="UTF-8"?><!--The contents of this file are subject to the terms of the Common Developmentand Distribution License (the License). You may not use this file except incompliance with the License.You can obtain a copy of the License at http://www.netbeans.org/cddl.htmlor http://www.netbeans.org/cddl.txt.When distributing Covered Code, include this CDDL Header Notice in each fileand include the License file at http://www.netbeans.org/cddl.txt.If applicable, add the following below the CDDL Header, with the fieldsenclosed by brackets [] replaced by your own identifying information:"Portions Copyrighted [year] [name of copyright owner]"The Original Software is NetBeans. The Initial Developer of the OriginalSoftware is Sun Microsystems, Inc. Portions Copyright 1997-2006 SunMicrosystems, Inc. All Rights Reserved.--><project name="suite" basedir="."> <import file="jdk.xml"/> <target name="-taskdefs" unless="harness.taskdefs.done"> <dirname property="harness.dir" file="${suite.file}"/> <echo level="verbose">Using build harness in ${harness.dir}</echo> <taskdef classpath="${harness.dir}/tasks.jar" resource="org/netbeans/nbbuild/taskdefs.properties"/> <property name="harness.taskdefs.done" value="true"/> </target> <target name="-init" depends="-taskdefs"> <property file="nbproject/private/private.properties"/> <property file="nbproject/project.properties"/> <sortsuitemodules unsortedmodules="${modules}" sortedmodulesproperty="modules.sorted"/> <property name="cluster" location="build/cluster"/> <echo level="verbose">Suite in ${basedir} with target platform ${netbeans.dest.dir}, build cluster ${cluster}, and sorted modules ${modules.sorted}</echo> <!-- synchronize with SuiteProject --> <property name="disabled.modules" value=""/> <property name="enabled.clusters" value=""/> <property name="disabled.clusters" value=""/> </target> <target name="build" depends="-init,branding" description="Build all modules in the suite."> <subant target="netbeans" buildpath="${modules.sorted}" inheritrefs="false" inheritall="false"/> <mkdir dir="${cluster}/config/Modules"/> <createmodulexml xmldir="${cluster}/config/Modules"> <hidden dir="${netbeans.dest.dir}"> <custom classpath="${harness.dir}/tasks.jar" classname="org.netbeans.nbbuild.ModuleSelector"> <param name="excludeModules" value="${disabled.modules}"/> <param name="excluded" value="true"/> </custom> </hidden> </createmodulexml> </target> <target name="nbms" depends="build" description="Build NBMs and an Auto Update site descriptor for all modules in the suite."> <property name="build.updates.dir" location="build/updates"/> <!-- reads from suite/project.properties first --> <condition property="help.target.cluster" value="${nbm.target.cluster}" > <isset property="nbm.target.cluster"/> </condition> <!-- reads app.name if exists --> <condition property="help.target.cluster" value="${app.name}" > <and> <isset property="app.name"/> <!-- #74866: only works for 6.0+ platforms. --> <available resource="org/netbeans/updater/resources/autoupdate-info-2_4.dtd"> <classpath> <fileset dir="${netbeans.dest.dir}"> <include name="platform*/modules/ext/updater.jar"/> </fileset> </classpath> </available> </and> </condition> <!-- sets property 'nbm.target.cluster.name' to 'nbm.target.cluster' if helper property set --> <condition property="nbm.target.cluster.name" value="nbm.target.cluster" > <isset property="help.target.cluster"/> </condition> <property name="nbm.target.cluster.name" value="" /> <mkdir dir="${build.updates.dir}"/> <subant target="nbm" buildpath="${modules.sorted}" inheritrefs="false" inheritall="false"> <property name="nbm.target.dir" location="${build.updates.dir}"/> <property name="${nbm.target.cluster.name}" value="${help.target.cluster}" /> </subant> <makeupdatedesc desc="${build.updates.dir}/updates.xml" distbase="."> <fileset dir="${build.updates.dir}"> <include name="*.nbm"/> </fileset> </makeupdatedesc> </target> <target name="build-launchers" depends="-init"> <fail unless="app.name">Must have set at least an application name ('app.name')</fail> <pathconvert property="zip.platform.update.tracking"> <path> <fileset dir="${netbeans.dest.dir}"> <include name="**/update_tracking/*.xml"/> </fileset> </path> </pathconvert> <selector id="zip.platform.included.files"> <custom classpath="${harness.dir}/tasks.jar" classname="org.netbeans.nbbuild.ModuleSelector"> <param name="excludeModules" value="${disabled.modules}"/> <param name="includeClusters" value="${enabled.clusters}"/> <param name="excludeClusters" value="${disabled.clusters}"/> <param name="updateTrackingFiles" value="${zip.platform.update.tracking}"/> </custom> </selector> <pathconvert property="zip.platform.clusters.duplicates" pathsep=","> <path> <fileset dir="${netbeans.dest.dir}"> <selector refid="zip.platform.included.files"/> </fileset> </path> <mapper type="regexp" from="[/\\]([^/\\]+)[/\\]config[/\\]Modules[/\\]" to="\1"/> <!-- #71849 --> </pathconvert> <dirset id="zip.platform.clusters" dir="${netbeans.dest.dir}" includes="${zip.platform.clusters.duplicates}" excludes="platform*"/> <pathconvert property="zip.platform.clusters.bare" pathsep=" "> <!-- #71128: \n OK on Win but \r\n bad on Unix --> <path> <dirset refid="zip.platform.clusters"/> </path> <mapper type="regexp" from="[/\\]([^/\\]+)[/\\]?$" to="\1"/> <!-- #71849 --> </pathconvert> <property name="build.launcher.dir" location="build/launcher"/> <mkdir dir="${build.launcher.dir}/etc"/> <mkdir dir="${build.launcher.dir}/bin"/> <copy file="${harness.dir}/launchers/app.exe" tofile="${build.launcher.dir}/bin/${app.name}.exe"/> <copy file="${harness.dir}/launchers/app_w.exe" tofile="${build.launcher.dir}/bin/${app.name}_w.exe"/> <copy file="${harness.dir}/launchers/app.sh" tofile="${build.launcher.dir}/bin/${app.name}"/> <copy file="${harness.dir}/etc/app.conf" tofile="${build.launcher.dir}/etc/${app.name}.conf"/> <echo message="${app.name}" file="${build.launcher.dir}/etc/${app.name}.clusters"/> <echo message=" " file="${build.launcher.dir}/etc/${app.name}.clusters" append="true"/> <echo message="${zip.platform.clusters.bare}" file="${build.launcher.dir}/etc/${app.name}.clusters" append="true"/> <echo message=" " file="${build.launcher.dir}/etc/${app.name}.clusters" append="true"/> </target> <target name="build-zip" depends="build,build-launchers" description="Builds a ZIP distribution of the suite, launchers, and selected modules from the platform."> <mkdir dir="dist"/> <zip destfile="dist/${app.name}.zip"> <zipfileset dir="${build.launcher.dir}/bin/" filemode="755" prefix="${app.name}/bin"/> <zipfileset dir="${build.launcher.dir}/etc/" prefix="${app.name}/etc"/> <zipfileset dir="${netbeans.dest.dir}" filemode="755" prefix="${app.name}"> <include name="**/lib/nbexec*"/> </zipfileset> <zipfileset dir="${netbeans.dest.dir}" prefix="${app.name}"> <and> <not> <filename name="**/lib/nbexec*"/> </not> <selector refid="zip.platform.included.files"/> </and> </zipfileset> <!-- Yes, the doubled app.name is a bit ugly, but better than the alternative; cf. #66441: --> <zipfileset dir="${cluster}" prefix="${app.name}/${app.name}"> <exclude name="config/Modules/*.xml_hidden"/> </zipfileset> </zip> </target> <target name="build-mac" depends="build,build-launchers" description="Builds a ZIP distribution of the suite, launchers, and selected modules from the platform."> <mkdir dir="dist"/> <mkdir dir="dist/${app.name}.app"/> <mkdir dir="dist/${app.name}.app/Contents"/> <mkdir dir="dist/${app.name}.app/Contents/MacOS"/> <mkdir dir="dist/${app.name}.app/Contents/Resources"/> <copy file="${harness.dir}/etc/applicationIcon.icns" tofile="dist/${app.name}.app/Contents/Resources/${app.name}.icns"/> <copy todir="dist/${app.name}.app/Contents/Resources/${app.name}/bin"> <fileset dir="${build.launcher.dir}/bin/" /> </copy> <copy todir="dist/${app.name}.app/Contents/Resources/${app.name}/etc"> <fileset dir="${build.launcher.dir}/etc/" /> </copy> <copy todir="dist/${app.name}.app/Contents/Resources/${app.name}"> <fileset dir="${netbeans.dest.dir}"> <include name="**/lib/nbexec*"/> </fileset> <fileset dir="${netbeans.dest.dir}"> <and> <not> <filename name="**/lib/nbexec*"/> </not> <selector refid="zip.platform.included.files"/> </and> </fileset> </copy> <copy todir="dist/${app.name}.app/Contents/Resources/${app.name}/${app.name}"> <fileset dir="${cluster}"/> </copy> <delete file="${basedir}/dist/${app.name}.app/Contents/MacOS/${app.name}"/> <symlink link="${basedir}/dist/${app.name}.app/Contents/MacOS/${app.name}" resource="../Resources/${app.name}/bin/${app.name}"/> <chmod file="dist/${app.name}.app/Contents/Resources/${app.name}/bin/${app.name}" perm="755"/> <chmod dir="dist" includes="${app.name}.app/Contents/Resources/${app.name}/platform*/lib/nbexec" perm="755"/> <copy file="${harness.dir}/etc/Info.plist" tofile="dist/${app.name}.app/Contents/Info.plist"> <filterchain> <replacestring from="$${app.name}" to="${app.name}"/> <replacestring from="$${app.title}" to="${app.title}"/> <replacestring from="$${app.icon}" to="master.png"/> <replacestring from="$${branding.token}" to="${branding.token}"/> </filterchain> </copy> </target> <target name="-testuserdir-delete-init" depends="-init"> <property name="test.user.dir" location="build/testuserdir"/> <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="Delete testing user directory (if the application is not running); clears any saved settings etc."> <ant antfile="${harness.dir}/jnlp.xml" target="clean"/> </target> <target name="clean" depends="-init,testuserdir-delete" description="Clean everything."> <delete failonerror="false" includeemptydirs="true"> <fileset dir="build"> <exclude name="testuserdir/"/> </fileset> </delete> <subant target="clean" buildpath="${modules.sorted}" inheritrefs="false" inheritall="false"/> <delete dir="dist"/> </target> <target name="branding" depends="-init" if="branding.token"> <property name="branding.dir" location="branding"/> <mkdir dir="${cluster}"/> <branding cluster="${cluster}" overrides="${branding.dir}" token="${branding.token}"/> </target> <target name="run" depends="build,-jdk-init" description="Runs this suite in place."> <ant antfile="${harness.dir}/run.xml" target="run"/> </target> <target name="debug" depends="build,-jdk-init,-jdk-presetdef-nbjpdastart" description="Runs this suite in place in the debugger."> <ant antfile="${harness.dir}/run.xml" target="debug"/> </target> <target name="profile" depends="build,-jdk-init,-jdk-presetdef-nbprofiledirect" description="Runs this suite in place in the profiler."> <ant antfile="${harness.dir}/run.xml" target="profile"/> </target> <target name="build-jnlp" depends="build,-jdk-init" description="Packages this suite as a JNLP application."> <ant antfile="${harness.dir}/jnlp.xml" target="build"/> </target> <target name="run-jnlp" depends="build,-jdk-init" description="Runs this suite as a JNLP application."> <ant antfile="${harness.dir}/jnlp.xml" target="run"/> </target> <target name="debug-jnlp" depends="build,-jdk-init,-jdk-presetdef-nbjpdastart" description="Runs this suite as a JNLP application in the debugger."> <ant antfile="${harness.dir}/jnlp.xml" target="debug"/> </target> </project>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -