blob: e5e034ca079ac23b0fd4502335db2dad90b7d15d [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
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
http://www.apache.org/licenses/LICENSE-2.0
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.
-->
<project name="NBI_Engine" default="default" basedir=".">
<property file="build.properties"/>
<property file="${native.dirname}/build.properties"/>
<!-- prepend bootclasspath for JDK 9+ JEP 272: Platform-Specific Desktop Features stubs -->
<condition property="desktop-classes-classes.dir" value="build/desktop-classes-classes" else="${build.dir}/desktop-classes-classes">
<isset property="IS_NB_INSTALLER"/>
</condition>
<condition property="endorsed.classpath" value="${desktop-classes-classes.dir}" else="" >
<not>
<isset property="permit.jdk9.builds"/>
</not>
</condition>
<import file="nbproject/build-impl.xml"/>
<import file="${native.dirname}/build.xml"/>
<!-- =======================================================================
Target overrides
======================================================================== -->
<target name="-post-clean" depends="native-clean"/>
<target name="-post-compile" depends="native-build,copy-native,create-jar-contents-list,probe"/>
<!-- =======================================================================
Support JDK 9+ JEP 272: Platform-Specific Desktop Features.
======================================================================== -->
<condition property="relative.nbbuild.dir" value="../../../../../../.." else="../..">
<isset property="IS_NB_INSTALLER"/>
</condition>
<!-- NetBeans Installer makes a copy then compiles again so check if directory exists -->
<condition property="nbbuild.dir" value="${relative.nbbuild.dir}/nbbuild" else="../../../../../../../../../../../../nbbuild">
<available file="${relative.nbbuild.dir}/nbbuild"/>
</condition>
<target name="-define-downloadbinaries-task" unless="have-downloadbinaries-task">
<taskdef name="downloadbinaries" classname="org.netbeans.nbbuild.extlibs.DownloadBinaries" classpath="${nbbuild.dir}/build/antclasses"/>
<property name="have-downloadbinaries-task" value="true" />
</target>
<import file="${nbbuild.dir}/binaries-default-properties.xml"/>
<target name="-download.release.files" depends="-define-downloadbinaries-task">
<downloadbinaries cache="${binaries.cache}" server="${binaries.server}">
<manifest dir=".">
<include name="external/binaries-list"/>
</manifest>
</downloadbinaries>
</target>
<available property="desktop.classes.available" classname="java.awt.desktop.AppEvent"/>
<target name="-compile-depend" depends="-download.release.files" unless="desktop.classes.available">
<mkdir dir="${build.dir}/desktop-classes-src" />
<unzip src="external/applemenu-external-desktop-classes-8.2.zip" dest="${build.dir}/desktop-classes-src"/>
<mkdir dir="${build.dir}/desktop-classes-classes" />
<javac srcdir="${build.dir}/desktop-classes-src" destdir="${build.dir}/desktop-classes-classes"/>
</target>
<!-- =======================================================================
NetBeans Installer engine specific targets
======================================================================== -->
<target name="create-jar-contents-list">
<pathconvert property="build.classes.dir.normalized" dirsep="/">
<path location="${build.classes.dir}"/>
</pathconvert>
<pathconvert pathsep="${line.separator}" property="engine.files" dirsep="/">
<fileset dir="${build.classes.dir}" includes="${jar.contents.includes}"/>
<mapper>
<chainedmapper>
<globmapper handledirsep="true" from="${build.classes.dir.normalized}/*" to="*"/>
</chainedmapper>
</mapper>
</pathconvert>
<echo file="${build.classes.dir}/${jar.contents.list}">${engine.files}</echo>
</target>
<target name="copy-unix-launcher">
<mkdir dir="${build.classes.dir}/${native.dirname}/${native.launcher.unix.stub.dst.dir}"/>
<!-- copy windows launcher stub -->
<copy file="${native.dirname}/${native.launcher.unix.stub.src}"
todir="${build.classes.dir}/${native.dirname}/${native.launcher.unix.stub.dst.dir}"/>
<!-- copy windows launcher i18n messages -->
<copy todir="${build.classes.dir}/${native.dirname}/${native.launcher.unix.i18n.dir}">
<fileset dir="${native.dirname}/${native.launcher.unix.i18n.dir}">
<include name="*"/>
</fileset>
</copy>
</target>
<target name="copy-windows-launcher">
<mkdir dir="${build.classes.dir}/${native.dirname}/${native.launcher.windows.stub.dst.dir}"/>
<!-- copy windows launcher stub -->
<copy file="${native.dirname}/${native.launcher.windows.stub.src}"
todir="${build.classes.dir}/${native.dirname}/${native.launcher.windows.stub.dst.dir}"/>
<!-- copy windows launcher i18n messages -->
<copy todir="${build.classes.dir}/${native.dirname}/${native.launcher.windows.i18n.dir}">
<fileset dir="${native.dirname}/${native.launcher.windows.i18n.dir}">
<include name="*"/>
</fileset>
</copy>
</target>
<target name="copy-native">
<antcall target="copy-jnilibs"/>
<antcall target="copy-launchers"/>
<antcall target="copy-cleaners"/>
</target>
<target name="copy-jnilibs">
<mkdir dir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir}"/>
<mkdir dir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.windows}"/>
<mkdir dir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.linux}"/>
<mkdir dir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.solaris-sparc}"/>
<mkdir dir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.solaris-x86}"/>
<mkdir dir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.macosx}"/>
<copy file="${native.dirname}/${native.jnilib.dir.windows}/${native.dist.dir}/${native.jnilib.file.windows.i386}"
todir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.windows}"/>
<copy file="${native.dirname}/${native.jnilib.dir.windows}/${native.dist.dir}/${native.jnilib.file.windows.amd64}"
todir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.windows}"/>
<copy file="${native.dirname}/${native.jnilib.dir.windows}/${native.dist.dir}/${native.jnilib.file.windows.ia64}"
todir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.windows}"/>
<copy file="${native.dirname}/${native.jnilib.dir.linux}/${native.dist.dir}/${native.jnilib.file.linux.i386}"
todir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.linux}"/>
<copy file="${native.dirname}/${native.jnilib.dir.linux}/${native.dist.dir}/${native.jnilib.file.linux.amd64}"
todir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.linux}"/>
<copy file="${native.dirname}/${native.jnilib.dir.solaris-x86}/${native.dist.dir}/${native.jnilib.file.solaris-x86}"
todir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.solaris-x86}"/>
<copy file="${native.dirname}/${native.jnilib.dir.solaris-x86}/${native.dist.dir}/${native.jnilib.file.solaris-amd64}"
todir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.solaris-x86}"/>
<copy file="${native.dirname}/${native.jnilib.dir.solaris-sparc}/${native.dist.dir}/${native.jnilib.file.solaris-sparc}"
todir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.solaris-sparc}"/>
<copy file="${native.dirname}/${native.jnilib.dir.solaris-sparc}/${native.dist.dir}/${native.jnilib.file.solaris-sparcv9}"
todir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.solaris-sparc}"/>
<copy file="${native.dirname}/${native.jnilib.dir.macosx}/${native.dist.dir}/${native.jnilib.file.macosx}"
todir="${build.classes.dir}/${native.dirname}/${native.jnilib.dir.macosx}"/>
</target>
<target name="copy-launchers">
<antcall target="copy-windows-launcher"/>
<antcall target="copy-unix-launcher"/>
</target>
<target name="copy-cleaners">
<mkdir dir="${build.classes.dir}/${native.dirname}/${native.cleaner.dir}"/>
<mkdir dir="${build.classes.dir}/${native.dirname}/${native.cleaner.windows.dir}"/>
<mkdir dir="${build.classes.dir}/${native.dirname}/${native.cleaner.unix.dir}"/>
<copy file="${native.dirname}/${native.cleaner.windows.srcdir}/${native.cleaner.windows.file}"
todir="${build.classes.dir}/${native.dirname}/${native.cleaner.windows.dir}"/>
<copy file="${native.dirname}/${native.cleaner.unix.srcdir}/${native.cleaner.unix.file}"
todir="${build.classes.dir}/${native.dirname}/${native.cleaner.unix.dir}"/>
</target>
<target name="probe" depends="init">
<available property="probe.javac.source" value="1.6" classname="java.lang.Module"/>
<available property="probe.javac.target" value="1.6" classname="java.lang.Module"/>
<available property="probe.javac.source" value="1.6" file="${nbjdk.home}/bin/jmod"/>
<available property="probe.javac.target" value="1.6" file="${nbjdk.home}/bin/jmod"/>
<property name="probe.javac.source" value="1.4"/>
<property name="probe.javac.target" value="1.4"/>
<mkdir dir="${build.classes.dir}/org/netbeans/installer/utils/applications/"/>
<javac srcdir="probesrc" destdir="${build.classes.dir}/org/netbeans/installer/utils/applications/" source="${probe.javac.source}" debug="true" deprecation="true" target="${probe.javac.target}"/>
</target>
</project>