-
Notifications
You must be signed in to change notification settings - Fork 38
/
build.xml
166 lines (148 loc) · 6.55 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="javaLauncher" default="default" basedir=".">
<property name="jcef.version" value="122.1.9-gd14e051-chromium-122.0.6261.94-api-1.17"/>
<property environment="env"/>
<property name="out.path" value="${env.OUT_PATH}"/>
<property name="out.name" value="${env.OUT_NAME}"/>
<property name="out.id" value="${env.OUT_ID}"/>
<property name="out.mainclass" value="${env.OUT_MAINCLASS}"/>
<path id="module.path">
<pathelement location="third_party/jogamp/jar"/>
<pathelement location="third_party/jogamp/jar/gluegen-rt.jar"/>
</path>
<condition property="jvm.opts"
value="--module-path=${toString:module.path} --add-modules jogl.all,gluegen.rt --add-exports jogl.all/com.jogamp.nativewindow=jcef --add-exports jogl.all/com.jogamp.opengl.awt=jcef --add-exports jogl.all/com.jogamp.opengl.util=jcef --add-exports jogl.all/com.jogamp.opengl=jcef --add-exports java.desktop/sun.awt=jcef --add-exports java.desktop/java.awt.peer=jcef --add-exports java.desktop/sun.lwawt.macosx=jcef --add-exports java.desktop/sun.lwawt=jcef"
else="">
<matches pattern="17*.*" string="${java.version}"/>
</condition>
<condition property="include.module-info.class"
value="module-info.class"
else="">
<matches pattern="17*.*" string="${java.version}"/>
</condition>
<condition property="exclude.module-info.java"
value="module-info.java"
else="">
<matches pattern="1.8.*" string="${java.version}"/>
</condition>
<condition property="exclude.source.mac"
value=""
else="org/cef/browser/mac/CefBrowserWindowMac.java">
<os family="mac"/>
</condition>
<condition property="modular-sdk.module-info.java.path"
value="jb/tools/common/module-info-aarch64.java"
else="java/module-info.java">
<and>
<!-- From jb/tools/windows/set_env.bat -->
<or>
<equals arg1="${env.OS}" arg2="windows"/>
<equals arg1="${env.OS}" arg2="linux"/>
</or>
<equals arg1="${env.TARGET_ARCH}" arg2="arm64"/>
</and>
</condition>
<taskdef name="bundleapp"
classname="com.oracle.appbundler.AppBundlerTask"
classpath="third_party/appbundler/appbundler-1.0.jar" />
<path id="class.path">
<fileset dir="third_party/jogamp/jar">
<include name="gluegen-rt.jar"/>
<include name="gluegen-rt-natives-macosx-universal.jar"/>
<include name="jogl-all.jar"/>
<include name="jogl-all-natives-macosx-universal.jar"/>
</fileset>
</path>
<path id="class.path.tests">
<fileset dir="third_party/gson" includes="gson-2.10.1.jar"/>
<fileset dir="third_party/junit" includes="junit-platform-console-standalone-1.10.0.jar"/>
<fileset dir="third_party/jakarta" includes="jakarta.xml.bind-api-2.3.2.jar"/>
<fileset dir="third_party/jbrapi" includes="jbr-api-17.1.10.0.jar"/>
<fileset dir="${out.path}" includes="jcef.jar"/>
</path>
<target name="compile">
<mkdir dir="${out.path}"/>
<javac encoding="UTF8" nowarn="on" deprecation="off" debug="on" includeantruntime="false" destdir="${out.path}"
fork="true" memoryinitialsize="32m" memorymaximumsize="128m" includeJavaRuntime="yes">
<compilerarg line="-XDignore.symbol.file ${jvm.opts}"/>
<classpath refid="class.path"/>
<src path="java/"/>
<include name="**/*.java"/>
<exclude name="${exclude.source.mac}"/>
<exclude name="tests/**"/>
<exclude name="${exclude.module-info.java}"/>
</javac>
<copy todir="${out.path}">
<fileset dir="java" casesensitive="no">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<!-- Workaround for building junit tests without using module-info -->
<target name="compile.tests">
<mkdir dir="${out.path}/tmp"/>
<mkdir dir="${out.path}/tests"/>
<mkdir dir="${out.path}/tests/junittests/data"/>
<!-- Javac will always recompile the tests due to https://ant.apache.org/faq.html#always-recompiles -->
<javac encoding="UTF8" nowarn="on" deprecation="off" debug="on" includeantruntime="false" fork="true"
destdir="${out.path}/tmp">
<classpath refid="class.path.tests"/>
<src path="java_tests/tests/"/>
<include name="**/*.java"/>
</javac>
<copy todir="${out.path}/tests/junittests/data">
<fileset dir="java_tests/tests/junittests/data" includes="*" />
</copy>
<move file="${out.path}/tmp/tests" tofile="${out.path}/tests"/>
<delete dir="${out.path}/tmp"/>
</target>
<target name="jar" depends="compile">
<mkdir dir="${out.path}"/>
<echo message="${jcef.version}" file="${out.path}/com/jetbrains/cef/version.info" append="false"/>
<jar destfile="${out.path}/jcef.jar" index="true" update="false" manifest="java/manifest/MANIFEST.MF">
<fileset dir="${out.path}">
<include name="org/cef/**"/>
<include name="com/jetbrains/**"/>
<include name="${include.module-info.class}"/>
</fileset>
</jar>
<jar destfile="${out.path}/jcef-sources.jar" index="true" update="false">
<fileset dir="java">
<include name="org/cef/**"/>
<include name="com/jetbrains/**"/>
</fileset>
</jar>
</target>
<target name="tests-jar" depends="compile.tests">
<mkdir dir="${out.path}"/>
<jar destfile="${out.path}/jcef-tests.jar" index="true" update="false">
<fileset dir="${out.path}">
<include name="tests/**"/>
<include name="com/**"/>
</fileset>
</jar>
</target>
<target name="bundle" depends="jar,tests-jar">
<mkdir dir="${out.path}"/>
<bundleapp outputdirectory="${out.path}"
name="${out.name}"
displayname="${out.name}"
identifier="${out.id}"
mainclassname="${out.mainclass}"
icon="third_party/cef/res/CefIcon.icns">
<runtime dir="${env.JAVA_HOME}"/>
<classpath dir="${out.path}">
<include name="jcef.jar"/>
<include name="jcef-tests.jar"/>
</classpath>
<classpath dir="third_party/jogamp/jar/">
<include name="gluegen-rt.jar"/>
<include name="gluegen-rt-natives-macosx-universal.jar" />
<include name="jogl-all.jar" />
<include name="jogl-all-natives-macosx-universal.jar" />
</classpath>
<classpath dir="third_party/junit" includes="junit*.jar"/>
<option value="-Djava.library.path=$APP_ROOT/Contents/Java/:$APP_ROOT/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries" />
</bundleapp>
</target>
</project>