Skip to content

Commit 3321398

Browse files
committed
Include resource-config.json in the jar manifest
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.
1 parent 46c0162 commit 3321398

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

build.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
resource-config.json file -->
7171
<property name="gvmnir.src.dir" location="${build-src.dir}/graalvmnativeimageresources" />
7272
<property name="gvmnir.classes.dir" location="${build.dir}/graalvmnativeimageresources" />
73-
<property name="gvmnir.output.file" location="${gvmnir.classes.dir}/graalvm-native-image-resource-config.json" />
73+
<property name="gvmnir.output.dir" location="${gvmnir.classes.dir}/meta-inf" />
74+
<property name="gvmnir.output.file" location="${gvmnir.output.dir}/native-image/resource-config.json" />
7475

7576

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

361361
<copy todir="${sdk.package.dir}">
362362
<fileset dir="${dist-root.dir}">
@@ -366,8 +366,6 @@
366366
</fileset>
367367
</copy>
368368

369-
<copy todir="${sdk.package.dir}/resource" file="${gvmnir.output.file}" />
370-
371369
<copydocs sourceDir="${docs.dir}" destinationDir="${sdk.package.dir}/docs"
372370
headerFile="${resource.dir}/localdoc.header"
373371
footerFile="${resource.dir}/localdoc.footer" extension="html"
@@ -444,6 +442,7 @@
444442
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" />
445443
<attribute name="Sealed" value="true" />
446444
</manifest>
445+
<metainf dir="${gvmnir.output.dir}" />
447446
</jar>
448447

449448
<javadoc destdir="${sdk.package.dir}/docs/javadoc" source="1.7"

docs/release-notes.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,12 @@ <h3>Version 6.0.6</h3>
168168
</li>
169169

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

0 commit comments

Comments
 (0)