Skip to content

Commit

Permalink
Build: use jlink to create a custom jre to reduce embedded jre size
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@3525 3d1905a2-6b24-0410-a738-b14d5a86fcbd
  • Loading branch information
mguessan committed Mar 17, 2024
1 parent 744e3dd commit 3c6670f
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@
<exclude name="lib/hamcrest-core-*.jar"/>
</fileset>
</zip>
<antcall target="download-jre"/>
<antcall target="download-build-jre"/>
<zip file="dist/davmail-${release-name}-windows-standalone.zip">
<fileset dir="dist">
<include name="jre/**"/>
Expand Down Expand Up @@ -569,4 +569,28 @@
<delete file="dist/jrefx.zip"/>
</target>

<target name="download-build-jre">
<mkdir dir="dist"/>
<get src="https://api.azul.com/zulu/download/community/v1.0/bundles/latest/binary/?jdk_version=15&amp;ext=zip&amp;os=windows&amp;arch=x86&amp;hw_bitness=64&amp;bundle_type=jdk&amp;features=fx"
dest="dist/jdkfx.zip"
/>
<unzip src="dist/jdkfx.zip" dest="dist/jdk">
<cutdirsmapper dirs="1"/>
</unzip>
<delete file="dist/jdkfx.zip"/>

<echo message="Create custom jre"/>
<delete dir="dist/jre"/>
<exec dir="." executable="dist/jdk/bin/jlink.exe">
<arg value="--add-modules"/>
<arg value="java.base,java.datatransfer,java.desktop,java.naming,java.security.jgss,java.security.sasl,java.xml,javafx.base,javafx.controls,javafx.graphics,javafx.swing,javafx.web"/>
<arg value="--output"/>
<arg value="dist/jre"/>
<arg value="--strip-debug"/>
<arg value="--no-man-pages"/>
<arg value="--no-header-files"/>
</exec>
<delete dir="dist/jdk"/>
</target>

</project>

0 comments on commit 3c6670f

Please sign in to comment.