Skip to content

Commit

Permalink
Include resource-config.json in the jar manifest
Browse files Browse the repository at this point in the history
Updated the LDAP SDK build process so that it includes the
resource-config.json file in the jar file manifest (in a
native-image subdirectory) rather than providing the file outside
of the jar but in the LDAP SDK zip file.  Including the file in the
manifest eliminates the need to explicitly reference it on the
command line using the GraalVM native-image tool.
  • Loading branch information
dirmgr committed Aug 26, 2022
1 parent 46c0162 commit 3321398
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
9 changes: 4 additions & 5 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
resource-config.json file -->
<property name="gvmnir.src.dir" location="${build-src.dir}/graalvmnativeimageresources" />
<property name="gvmnir.classes.dir" location="${build.dir}/graalvmnativeimageresources" />
<property name="gvmnir.output.file" location="${gvmnir.classes.dir}/graalvm-native-image-resource-config.json" />
<property name="gvmnir.output.dir" location="${gvmnir.classes.dir}/meta-inf" />
<property name="gvmnir.output.file" location="${gvmnir.output.dir}/native-image/resource-config.json" />


<!-- Define properties used for copying the documentation into place. -->
Expand Down Expand Up @@ -264,7 +265,7 @@
<target name="generate-graalvm-native-image-resource-config-json"
description="Generates a resource-config.json file for use by GraalVM native-image"
depends="compile">
<mkdir dir="${gvmnir.classes.dir}" />
<mkdir dir="${gvmnir.output.dir}/native-image" />
<javac srcdir="${gvmnir.src.dir}" destdir="${gvmnir.classes.dir}"
source="1.7" target="1.7" deprecation="true" fork="true"
memoryInitialSize="${MEM}" memoryMaximumSize="${MEM}"
Expand Down Expand Up @@ -356,7 +357,6 @@
<mkdir dir="${sdk.package.dir}/android-ldap-client" />
<mkdir dir="${sdk.package.dir}/docs" />
<mkdir dir="${sdk.package.dir}/docs/javadoc" />
<mkdir dir="${sdk.package.dir}/resource" />

<copy todir="${sdk.package.dir}">
<fileset dir="${dist-root.dir}">
Expand All @@ -366,8 +366,6 @@
</fileset>
</copy>

<copy todir="${sdk.package.dir}/resource" file="${gvmnir.output.file}" />

<copydocs sourceDir="${docs.dir}" destinationDir="${sdk.package.dir}/docs"
headerFile="${resource.dir}/localdoc.header"
footerFile="${resource.dir}/localdoc.footer" extension="html"
Expand Down Expand Up @@ -444,6 +442,7 @@
value="javax.crypto,javax.crypto.spec,javax.naming,javax.naming.directory,javax.naming.ldap,javax.net,javax.net.ssl,javax.security.auth,javax.security.auth.callback,javax.security.auth.login,javax.security.auth.x500,javax.security.sasl" />
<attribute name="Sealed" value="true" />
</manifest>
<metainf dir="${gvmnir.output.dir}" />
</jar>

<javadoc destdir="${sdk.package.dir}/docs/javadoc" source="1.7"
Expand Down
13 changes: 6 additions & 7 deletions docs/release-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,12 @@ <h3>Version 6.0.6</h3>
</li>

<li>
Updated the LDAP SDK to include a graalvm-native-image-resource-config.json file
as part of the LDAP SDK package. Wnen using the GraalVM native-image tool to
generate a self-contained executable version of a Java program that uses the
LDAP SDK, this file can be used to ensure that all of the appropriate resource
files (including message property files, the schema used by the in-memory
directory server, and the OID registry used by the oid-lookup tool) are
included as part of the generated image.
Updated the LDAP SDK to include a native-image/resource-config.json file in the
jar file manifest. Wnen using the GraalVM native-image tool to generate a
self-contained executable version of a Java program that uses the LDAP SDK, this
file helps ensure that all of the appropriate resource files (including message
property files, a default standard schema, and a registry file used by the
oid-lookup tool) are included as part of the generated image.
<br><br>
</li>
</ul>
Expand Down

0 comments on commit 3321398

Please sign in to comment.