forked from apache/netbeans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
196 lines (158 loc) · 10 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?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">
<property name="probe.javac.release" value="8"/>
<mkdir dir="${build.classes.dir}/org/netbeans/installer/utils/applications/"/>
<javac srcdir="probesrc" destdir="${build.classes.dir}/org/netbeans/installer/utils/applications/" release="${probe.javac.release}" debug="true" deprecation="true"/>
</target>
</project>