diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs index e889521..e479558 100644 --- a/.settings/org.eclipse.buildship.core.prefs +++ b/.settings/org.eclipse.buildship.core.prefs @@ -1,2 +1,13 @@ +arguments= +auto.sync=false +build.scans.enabled=false +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) connection.project.dir= eclipse.preferences.version=1 +gradle.user.home= +java.home= +jvm.arguments= +offline.mode=false +override.workspace.settings=false +show.console.view=false +show.executions.view=false diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/build.gradle b/build.gradle index 171a5da..63394d4 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ plugins { } group 'com.formkiq.gradle' -version '1.3.0' +version '1.3.1' sourceCompatibility = "11" targetCompatibility = "11" diff --git a/src/main/java/com/formkiq/gradle/GraalvmNativeExtension.java b/src/main/java/com/formkiq/gradle/GraalvmNativeExtension.java index e6c7667..a6418cc 100644 --- a/src/main/java/com/formkiq/gradle/GraalvmNativeExtension.java +++ b/src/main/java/com/formkiq/gradle/GraalvmNativeExtension.java @@ -28,6 +28,8 @@ public class GraalvmNativeExtension { /** Additional Classpaths comma separated. */ private Property addClasspath; + /** Enable Add All Charsets. */ + private Property enableAddAllCharsets; /** Allow image building with an incomplete class path. */ private Property enableAllowIncompleteClasspath; /** Add all security service classes to the generated image. */ @@ -74,12 +76,16 @@ public class GraalvmNativeExtension { private ListProperty initializeAtRunTime; /** Java Version. */ private Property javaVersion; + /** JNI Config File. */ + private Property jniConfigurationFiles; /** Class Name with main() method. */ private Property mainClassName; /** Output File Name. */ private Property outputFileName; /** Reflection Config File. */ private Property reflectionConfig; + /** Resource Configuration Files. */ + private Property resourceConfigurationFiles; /** Reflection Config File. */ private Property serializationConfig; /** Java System Properties. */ @@ -99,8 +105,11 @@ public GraalvmNativeExtension(final ObjectFactory objects) { this.mainClassName = objects.property(String.class); this.reflectionConfig = objects.property(String.class); this.serializationConfig = objects.property(String.class); + this.jniConfigurationFiles = objects.property(String.class); + this.resourceConfigurationFiles = objects.property(String.class); this.enableHttp = objects.property(Boolean.class); this.enableHttps = objects.property(Boolean.class); + this.enableAddAllCharsets = objects.property(Boolean.class); this.enableVerbose = objects.property(Boolean.class); this.enableAutoFallback = objects.property(Boolean.class); this.enableForceFallback = objects.property(Boolean.class); @@ -190,6 +199,14 @@ public String getJavaVersion() { return this.javaVersion.getOrElse(DEFAULT_JAVA_VERSION); } + /** + * Get JNI Configuration Files. + * @return {@link String} + */ + public String getJniConfigurationFiles() { + return this.jniConfigurationFiles.getOrNull(); + } + /** * Get Main Class Name. * @@ -217,6 +234,14 @@ public String getReflectionConfig() { return this.reflectionConfig.getOrNull(); } + /** + * Get Resource Configuration Files. + * @return {@link String} + */ + public String getResourceConfigurationFiles() { + return this.resourceConfigurationFiles.getOrNull(); + } + /** * Get Serialization Config File. * @@ -253,6 +278,14 @@ public Boolean isAllowIncompleteClasspath() { return this.enableAllowIncompleteClasspath.getOrElse(Boolean.FALSE); } + /** + * Enable Add All Charsets. + * @return {@link Boolean} + */ + public Boolean isEnableAddAllCharsets() { + return this.enableAddAllCharsets.getOrElse(Boolean.FALSE); + } + /** * Is Enable All Security Services. * @@ -315,7 +348,7 @@ public Boolean isEnableForceFallback() { public Boolean isEnableHttp() { return this.enableHttp.getOrElse(Boolean.TRUE); } - + /** * Is Enable Https. * @@ -406,6 +439,15 @@ public void setAddClasspath(final String cp) { this.addClasspath.set(cp); } + /** + * Set Enable AddAllCharsets. + * + * @param enabled Boolean + */ + public void setEnableAddAllCharsets(final Boolean enabled) { + this.enableAddAllCharsets.set(enabled); + } + /** * Set Allow Incomplete Classpath. * @@ -469,7 +511,7 @@ public void setEnableForceFallback(final Boolean enabled) { public void setEnableHttp(final Boolean enabled) { this.enableHttp.set(enabled); } - + /** * Set Enable Https. * @@ -614,6 +656,15 @@ public void setJavaVersion(final String version) { this.javaVersion.set(version); } + /** + * Set JNI Config File. + * + * @param configFile {@link String} + */ + public void setJniConfigurationFiles(final String configFile) { + this.jniConfigurationFiles.set(configFile); + } + /** * Set Main Class Name. * @@ -641,6 +692,15 @@ public void setReflectionConfig(final String configFile) { this.reflectionConfig.set(configFile); } + /** + * Set Resource Config File. + * + * @param configFile {@link String} + */ + public void setResourceConfigurationFiles(final String configFile) { + this.resourceConfigurationFiles.set(configFile); + } + /** * Set Serialization Config File. * @@ -649,7 +709,7 @@ public void setReflectionConfig(final String configFile) { public void setSerializationConfig(final String configFile) { this.serializationConfig.set(configFile); } - + /** * Set System Property. * diff --git a/src/main/java/com/formkiq/gradle/internal/NativeImageExecutor.java b/src/main/java/com/formkiq/gradle/internal/NativeImageExecutor.java index 9ebfefb..f1ebe03 100644 --- a/src/main/java/com/formkiq/gradle/internal/NativeImageExecutor.java +++ b/src/main/java/com/formkiq/gradle/internal/NativeImageExecutor.java @@ -80,6 +80,7 @@ private List getBuildGraalvmImageArguments(final Project project, final addBooleanArgument(args, this.extension.isEnableShared(), "--shared"); addBooleanArgument(args, this.extension.isEnableStatic(), "--static"); + addBooleanArgument(args, this.extension.isEnableAddAllCharsets(), "-H:+AddAllCharsets"); addStringListArgument(args, this.extension.getInitializeAtBuildTime(), "--initialize-at-build-time"); addStringListArgument(args, this.extension.getInitializeAtRunTime(), @@ -100,6 +101,16 @@ private List getBuildGraalvmImageArguments(final Project project, final "-H:SerializationConfigurationResources=" + serializationConfig); } + String jniConfig = this.extension.getJniConfigurationFiles(); + if (jniConfig != null) { + addStringArgument(args, jniConfig, "-H:JNIConfigurationFiles=" + jniConfig); + } + + String resourceConfig = this.extension.getResourceConfigurationFiles(); + if (resourceConfig != null) { + addStringArgument(args, resourceConfig, "-H:ResourceConfigurationFiles=" + resourceConfig); + } + addStringArgument(args, this.extension.getFeatures(), "--features=" + this.extension.getFeatures());