blob: c1480ccc8633bcca5ff3edb2efbbe634bd552d20 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<project name="javaLauncher" default="default" basedir=".">
<property name="jcef.version" value="111.2.1-g870da30-chromium-111.0.5563.64-api-1.12"/>
<property environment="env"/>
<property name="out.native.path" value="${env.OUT_NATIVE_PATH}"/>
<property name="bundle.natives.path" value="${env.BUNDLE_NATIVES_PATH}"/>
<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}"/>
<condition property="jvm.opts"
value="--module-path third_party/jogamp/jar --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="${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"/>
<echo message="${bundle.natives.path}"/>
<exec executable="ls">
<arg value="-l" />
</exec>
<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>
<fileset dir="${bundle.natives.path}">
<include name="native*"/>
</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>