diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java index d09453167ded..59872390786c 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java @@ -54,6 +54,7 @@ import com.oracle.svm.core.option.HostedOptionKey; import com.oracle.svm.core.option.HostedOptionValues; import com.oracle.svm.core.option.LocatableMultiOptionValue; +import com.oracle.svm.core.option.OptionMigrationMessage; import com.oracle.svm.core.option.RuntimeOptionKey; import com.oracle.svm.core.option.SubstrateOptionsParser; import com.oracle.svm.core.thread.VMOperationControl; @@ -337,7 +338,8 @@ public static void setOptimizeValueUpdateHandler(ValueUpdateHandler LinkerRPath = new HostedOptionKey<>(LocatableMultiOptionValue.Strings.buildWithCommaDelimiter()); - @Option(help = {"Directory of the image file to be generated", "Use the '-o' option instead."}, type = OptionType.User)// + @OptionMigrationMessage("Use the '-o' option instead.")// + @Option(help = "Directory of the image file to be generated", type = OptionType.User)// public static final HostedOptionKey Path = new HostedOptionKey<>(null); public static final class GCGroup implements APIOptionGroup { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationFiles.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationFiles.java index 2c6f5fa18570..4597c9d8595e 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationFiles.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationFiles.java @@ -34,15 +34,16 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import jdk.graal.compiler.options.Option; -import jdk.graal.compiler.options.OptionStability; -import jdk.graal.compiler.options.OptionType; - import com.oracle.svm.core.option.BundleMember; import com.oracle.svm.core.option.HostedOptionKey; import com.oracle.svm.core.option.LocatableMultiOptionValue; +import com.oracle.svm.core.option.OptionMigrationMessage; import com.oracle.svm.core.util.UserError; +import jdk.graal.compiler.options.Option; +import jdk.graal.compiler.options.OptionStability; +import jdk.graal.compiler.options.OptionType; + /** * Gathers configuration files from specified directories without having to provide each * configuration file individually. @@ -50,6 +51,7 @@ public final class ConfigurationFiles { public static final class Options { + @Option(help = "Directories directly containing configuration files for dynamic features at runtime.", type = OptionType.User, stability = OptionStability.STABLE)// @BundleMember(role = BundleMember.Role.Input)// static final HostedOptionKey ConfigurationFileDirectories = new HostedOptionKey<>(LocatableMultiOptionValue.Paths.buildWithCommaDelimiter()); @@ -57,27 +59,28 @@ public static final class Options { @Option(help = "Resource path above configuration resources for dynamic features at runtime.", type = OptionType.User)// public static final HostedOptionKey ConfigurationResourceRoots = new HostedOptionKey<>(LocatableMultiOptionValue.Strings.buildWithCommaDelimiter()); + @OptionMigrationMessage("Use a reflect-config.json in your META-INF/native-image// directory instead.")// @Option(help = "file:doc-files/ReflectionConfigurationFilesHelp.txt", type = OptionType.User)// @BundleMember(role = BundleMember.Role.Input)// public static final HostedOptionKey ReflectionConfigurationFiles = new HostedOptionKey<>(LocatableMultiOptionValue.Paths.buildWithCommaDelimiter()); - @Option(help = {"Resources describing program elements to be made available for reflection (see ReflectionConfigurationFiles).", - "Use a reflect-config.json in your META-INF/native-image// directory instead."}, type = OptionType.User)// + @Option(help = "Resources describing program elements to be made available for reflection (see ReflectionConfigurationFiles).", type = OptionType.User)// public static final HostedOptionKey ReflectionConfigurationResources = new HostedOptionKey<>(LocatableMultiOptionValue.Strings.buildWithCommaDelimiter()); + @OptionMigrationMessage("Use a proxy-config.json in your META-INF/native-image// directory instead.")// @Option(help = "file:doc-files/ProxyConfigurationFilesHelp.txt", type = OptionType.User)// @BundleMember(role = BundleMember.Role.Input)// public static final HostedOptionKey DynamicProxyConfigurationFiles = new HostedOptionKey<>(LocatableMultiOptionValue.Paths.buildWithCommaDelimiter()); - @Option(help = {"Resources describing program elements to be made available for reflection (see ProxyConfigurationFiles).", - "Use a proxy-config.json in your META-INF/native-image// directory instead."}, type = OptionType.User)// + @Option(help = "Resources describing program elements to be made available for reflection (see ProxyConfigurationFiles).", type = OptionType.User)// public static final HostedOptionKey DynamicProxyConfigurationResources = new HostedOptionKey<>(LocatableMultiOptionValue.Strings.buildWithCommaDelimiter()); + @OptionMigrationMessage("Use a serialization-config.json in your META-INF/native-image// directory instead.")// @Option(help = "file:doc-files/SerializationConfigurationFilesHelp.txt", type = OptionType.User)// @BundleMember(role = BundleMember.Role.Input)// public static final HostedOptionKey SerializationConfigurationFiles = new HostedOptionKey<>(LocatableMultiOptionValue.Paths.buildWithCommaDelimiter()); - @Option(help = {"Resources describing program elements to be made available for serialization (see SerializationConfigurationFiles).", - "Use a serialization-config.json in your META-INF/native-image// directory instead."}, type = OptionType.User)// + @Option(help = "Resources describing program elements to be made available for serialization (see SerializationConfigurationFiles).", type = OptionType.User)// public static final HostedOptionKey SerializationConfigurationResources = new HostedOptionKey<>(LocatableMultiOptionValue.Strings.buildWithCommaDelimiter()); + @OptionMigrationMessage("Use a serialization-config.json in your META-INF/native-image// directory instead.")// @Option(help = "file:doc-files/SerializationConfigurationFilesHelp.txt", type = OptionType.User)// @BundleMember(role = BundleMember.Role.Input)// public static final HostedOptionKey SerializationDenyConfigurationFiles = new HostedOptionKey<>(LocatableMultiOptionValue.Paths.buildWithCommaDelimiter()); @@ -85,24 +88,22 @@ public static final class Options { public static final HostedOptionKey SerializationDenyConfigurationResources = new HostedOptionKey<>( LocatableMultiOptionValue.Strings.buildWithCommaDelimiter()); - @Option(help = {"Files describing Java resources to be included in the image according to the schema at " + - "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/resource-config-schema-v1.0.0.json", - "Use a resource-config.json in your META-INF/native-image// directory instead."}, type = OptionType.User)// + @OptionMigrationMessage("Use a resource-config.json in your META-INF/native-image// directory instead.")// + @Option(help = "Files describing Java resources to be included in the image according to the schema at " + + "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/resource-config-schema-v1.0.0.json", type = OptionType.User)// @BundleMember(role = BundleMember.Role.Input)// public static final HostedOptionKey ResourceConfigurationFiles = new HostedOptionKey<>(LocatableMultiOptionValue.Paths.buildWithCommaDelimiter()); - @Option(help = {"Resources describing Java resources to be included in the image according to the schema at " + - "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/resource-config-schema-v1.0.0.json", - "Use a resource-config.json in your META-INF/native-image// directory instead."}, type = OptionType.User)// + @Option(help = "Resources describing Java resources to be included in the image according to the schema at " + + "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/resource-config-schema-v1.0.0.json", type = OptionType.User)// public static final HostedOptionKey ResourceConfigurationResources = new HostedOptionKey<>(LocatableMultiOptionValue.Strings.buildWithCommaDelimiter()); - @Option(help = {"Files describing program elements to be made accessible via JNI according to the schema at " + - "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/jni-config-schema-v1.1.0.json", - "Use a jni-config.json in your META-INF/native-image// directory instead."}, type = OptionType.User)// + @OptionMigrationMessage("Use a jni-config.json in your META-INF/native-image// directory instead.")// + @Option(help = "Files describing program elements to be made accessible via JNI according to the schema at " + + "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/jni-config-schema-v1.1.0.json", type = OptionType.User)// @BundleMember(role = BundleMember.Role.Input)// public static final HostedOptionKey JNIConfigurationFiles = new HostedOptionKey<>(LocatableMultiOptionValue.Paths.buildWithCommaDelimiter()); - @Option(help = {"Resources describing program elements to be made accessible via JNI according to the schema at " + - "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/jni-config-schema-v1.1.0.json", - "Use a jni-config.json in your META-INF/native-image// directory instead."}, type = OptionType.User)// + @Option(help = "Resources describing program elements to be made accessible via JNI according to the schema at " + + "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/jni-config-schema-v1.1.0.json", type = OptionType.User)// public static final HostedOptionKey JNIConfigurationResources = new HostedOptionKey<>(LocatableMultiOptionValue.Strings.buildWithCommaDelimiter()); @Option(help = "Files describing stubs allowing foreign calls.", type = OptionType.User)// @@ -111,14 +112,13 @@ public static final class Options { @Option(help = "Resources describing stubs allowing foreign calls.", type = OptionType.User)// public static final HostedOptionKey ForeignResources = new HostedOptionKey<>(LocatableMultiOptionValue.Strings.buildWithCommaDelimiter()); - @Option(help = {"Files describing predefined classes that can be loaded at runtime according to the schema at " + - "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/predefined-classes-config-schema-v1.0.0.json", - "Use a predefined-classes-config.json in your META-INF/native-image// directory instead."}, type = OptionType.User)// + @OptionMigrationMessage("Use a predefined-classes-config.json in your META-INF/native-image// directory instead.")// + @Option(help = "Files describing predefined classes that can be loaded at runtime according to the schema at " + + "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/predefined-classes-config-schema-v1.0.0.json", type = OptionType.User)// @BundleMember(role = BundleMember.Role.Input)// public static final HostedOptionKey PredefinedClassesConfigurationFiles = new HostedOptionKey<>(LocatableMultiOptionValue.Paths.buildWithCommaDelimiter()); - @Option(help = {"Resources describing predefined classes that can be loaded at runtime according to the schema at " + - "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/predefined-classes-config-schema-v1.0.0.json", - "Use a predefined-classes-config.json in your META-INF/native-image// directory instead."}, type = OptionType.User)// + @Option(help = "Resources describing predefined classes that can be loaded at runtime according to the schema at " + + "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/predefined-classes-config-schema-v1.0.0.json", type = OptionType.User)// public static final HostedOptionKey PredefinedClassesConfigurationResources = new HostedOptionKey<>( LocatableMultiOptionValue.Strings.buildWithCommaDelimiter()); diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/doc-files/ProxyConfigurationFilesHelp.txt b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/doc-files/ProxyConfigurationFilesHelp.txt index a8144f0d4a3a..a4841995909f 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/doc-files/ProxyConfigurationFilesHelp.txt +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/doc-files/ProxyConfigurationFilesHelp.txt @@ -1,5 +1,4 @@ One or several (comma-separated) paths to JSON files that specify lists of interfaces that define Java proxy classes. -Use a proxy-config.json in your META-INF/native-image// directory instead. The JSON structure is described in the following schema: diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/doc-files/ReflectionConfigurationFilesHelp.txt b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/doc-files/ReflectionConfigurationFilesHelp.txt index 1e2a5871659b..cc20fd1e7d7f 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/doc-files/ReflectionConfigurationFilesHelp.txt +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/doc-files/ReflectionConfigurationFilesHelp.txt @@ -1,5 +1,4 @@ One or several (comma-separated) paths to JSON files that specify which program elements should be made available via reflection. -Use a reflect-config.json in your META-INF/native-image// directory instead. The JSON object schema is described at: diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/doc-files/SerializationConfigurationFilesHelp.txt b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/doc-files/SerializationConfigurationFilesHelp.txt index b6509022c68f..e606e1ede89c 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/doc-files/SerializationConfigurationFilesHelp.txt +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/doc-files/SerializationConfigurationFilesHelp.txt @@ -1,5 +1,4 @@ One or several (comma-separated) paths to JSON files that specify lists of serialization configurations. -Use a serialization-config.json in your META-INF/native-image// directory instead. The structure is described in the following schema: diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionMigrationMessage.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionMigrationMessage.java new file mode 100644 index 000000000000..e5d4543511aa --- /dev/null +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionMigrationMessage.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.oracle.svm.core.option; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import jdk.graal.compiler.options.Option; + +/** + * If an {@link Option} is additionally annotated with {@link OptionMigrationMessage}, the message + * will be shown to guide users when the option is listed as experimental in the build output. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD}) +public @interface OptionMigrationMessage { + String value(); +} diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionUtils.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionUtils.java index c6f856e88104..19144f42e34f 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionUtils.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,8 @@ package com.oracle.svm.core.option; import java.io.IOException; +import java.lang.annotation.Annotation; +import java.lang.reflect.Field; import java.nio.file.Path; import java.util.Arrays; import java.util.List; @@ -35,6 +37,7 @@ import com.oracle.svm.core.SubstrateUtil; import com.oracle.svm.core.util.UserError; +import jdk.graal.compiler.options.OptionDescriptor; import jdk.graal.compiler.options.OptionKey; /** @@ -121,4 +124,13 @@ public InvalidMacroException(String arg0) { super(arg0); } } + + public static List getAnnotationsByType(OptionDescriptor optionDescriptor, Class annotationClass) { + try { + Field field = optionDescriptor.getDeclaringClass().getDeclaredField(optionDescriptor.getFieldName()); + return List.of(field.getAnnotationsByType(annotationClass)); + } catch (NoSuchFieldException e) { + return List.of(); + } + } } diff --git a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/APIOptionHandler.java b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/APIOptionHandler.java index 06ed2cdfb4f9..223b0bd7b17b 100644 --- a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/APIOptionHandler.java +++ b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/APIOptionHandler.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.driver; -import java.lang.annotation.Annotation; -import java.lang.reflect.Field; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; @@ -46,9 +44,6 @@ import java.util.stream.Collectors; import org.graalvm.collections.EconomicMap; -import jdk.graal.compiler.options.OptionDescriptor; -import jdk.graal.compiler.options.OptionDescriptors; -import jdk.graal.compiler.options.OptionStability; import org.graalvm.nativeimage.ImageSingletons; import org.graalvm.nativeimage.hosted.Feature; @@ -61,6 +56,7 @@ import com.oracle.svm.core.option.BundleMember; import com.oracle.svm.core.option.HostedOptionKey; import com.oracle.svm.core.option.OptionOrigin; +import com.oracle.svm.core.option.OptionUtils; import com.oracle.svm.core.option.SubstrateOptionsParser; import com.oracle.svm.core.util.VMError; import com.oracle.svm.driver.NativeImage.ArgumentQueue; @@ -72,6 +68,10 @@ import com.oracle.svm.util.ReflectionUtil.ReflectionUtilError; import com.oracle.svm.util.StringUtil; +import jdk.graal.compiler.options.OptionDescriptor; +import jdk.graal.compiler.options.OptionDescriptors; +import jdk.graal.compiler.options.OptionStability; + class APIOptionHandler extends NativeImage.OptionHandler { private static final String ENTER_UNLOCK_SCOPE = SubstrateOptionsParser.commandArgument(SubstrateOptions.UnlockExperimentalVMOptions, "+"); private static final String LEAVE_UNLOCK_SCOPE = SubstrateOptionsParser.commandArgument(SubstrateOptions.UnlockExperimentalVMOptions, "-"); @@ -140,7 +140,7 @@ static SortedMap extractOptions(ServiceLoader apiOptions, Map groupInfos, Map, APIOptionGroup> groupInstances, Set stableOptionNames) { - for (APIOption apiAnnotation : getAnnotationsByType(optionDescriptor, APIOption.class)) { + for (APIOption apiAnnotation : OptionUtils.getAnnotationsByType(optionDescriptor, APIOption.class)) { String builderOption = optionPrefix; if (apiAnnotation.name().length <= 0) { VMError.shouldNotReachHere(String.format("APIOption for %s does not provide a name entry", optionDescriptor.getLocation())); @@ -277,7 +277,7 @@ private static void extractPathOption(String optionPrefix, OptionDescriptor opti String rawOptionName = optionDescriptor.getName(); String builderOption = optionPrefix + rawOptionName; BundleMember.Role role = BundleMember.Role.Ignore; - for (BundleMember bundleMember : getAnnotationsByType(optionDescriptor, BundleMember.class)) { + for (BundleMember bundleMember : OptionUtils.getAnnotationsByType(optionDescriptor, BundleMember.class)) { role = bundleMember.role(); } pathOptions.put(builderOption, new PathsOptionInfo(multiOptionDefaultValue.getDelimiter(), role)); @@ -285,15 +285,6 @@ private static void extractPathOption(String optionPrefix, OptionDescriptor opti } } - private static List getAnnotationsByType(OptionDescriptor optionDescriptor, Class annotationClass) { - try { - Field field = optionDescriptor.getDeclaringClass().getDeclaredField(optionDescriptor.getFieldName()); - return List.of(field.getAnnotationsByType(annotationClass)); - } catch (NoSuchFieldException e) { - return List.of(); - } - } - private static String startLowerCase(String str) { return str.substring(0, 1).toLowerCase(Locale.ROOT) + str.substring(1); } diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java index 7c965c5623d6..9a6b97572759 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java @@ -39,10 +39,10 @@ import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.Map.Entry; import java.util.Optional; import java.util.TreeMap; import java.util.TreeSet; +import java.util.Map.Entry; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; @@ -74,7 +74,9 @@ import com.oracle.svm.core.option.HostedOptionKey; import com.oracle.svm.core.option.HostedOptionValues; import com.oracle.svm.core.option.LocatableMultiOptionValue; +import com.oracle.svm.core.option.OptionMigrationMessage; import com.oracle.svm.core.option.OptionOrigin; +import com.oracle.svm.core.option.OptionUtils; import com.oracle.svm.core.option.RuntimeOptionKey; import com.oracle.svm.core.option.SubstrateOptionsParser; import com.oracle.svm.core.util.UserError; @@ -356,8 +358,7 @@ private void printExperimentalOptions(ImageClassLoader classLoader) { continue; } String origins = ""; - /* The first extra help item is used for migration messages of options. */ - String migrationMessage = descriptor.getExtraHelp().isEmpty() ? "" : descriptor.getExtraHelp().getFirst(); + String migrationMessage = OptionUtils.getAnnotationsByType(descriptor, OptionMigrationMessage.class).stream().map(a -> a.value()).collect(Collectors.joining(". ")); String alternatives = ""; if (optionValue instanceof LocatableMultiOptionValue lmov) { diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ResourcesFeature.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ResourcesFeature.java index ec3eb51f3e7f..f8642070a2db 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ResourcesFeature.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ResourcesFeature.java @@ -85,6 +85,7 @@ import com.oracle.svm.core.jdk.resources.NativeImageResourceFileSystemProvider; import com.oracle.svm.core.option.HostedOptionKey; import com.oracle.svm.core.option.LocatableMultiOptionValue; +import com.oracle.svm.core.option.OptionMigrationMessage; import com.oracle.svm.core.util.UserError; import com.oracle.svm.core.util.VMError; import com.oracle.svm.hosted.classinitialization.ClassInitializationSupport; @@ -140,8 +141,8 @@ public final class ResourcesFeature implements InternalFeature { static final String MODULE_NAME_ALL_UNNAMED = "ALL-UNNAMED"; public static class Options { - @Option(help = {"Regexp to match names of resources to be included in the image.", - "Use a resource-config.json in your META-INF/native-image// directory instead."}, type = OptionType.User)// + @OptionMigrationMessage("Use a resource-config.json in your META-INF/native-image// directory instead.")// + @Option(help = "Regexp to match names of resources to be included in the image.", type = OptionType.User)// public static final HostedOptionKey IncludeResources = new HostedOptionKey<>(LocatableMultiOptionValue.Strings.build()); @Option(help = "Regexp to match names of resources to be excluded from the image.", type = OptionType.User)// diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/ImageHeapConnectedComponentsFeature.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/ImageHeapConnectedComponentsFeature.java index c093b5d9f716..2dc9d079eef8 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/ImageHeapConnectedComponentsFeature.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/ImageHeapConnectedComponentsFeature.java @@ -24,24 +24,25 @@ */ package com.oracle.svm.hosted.image; +import java.io.File; +import java.io.PrintWriter; +import java.nio.file.Path; +import java.util.function.Consumer; + import com.oracle.graal.pointsto.reports.ReportUtils; import com.oracle.svm.core.SubstrateOptions; import com.oracle.svm.core.feature.AutomaticallyRegisteredFeature; import com.oracle.svm.core.feature.InternalFeature; import com.oracle.svm.core.option.HostedOptionKey; import com.oracle.svm.hosted.FeatureImpl; + import jdk.graal.compiler.options.Option; import jdk.graal.compiler.options.OptionType; -import java.io.File; -import java.io.PrintWriter; -import java.nio.file.Path; -import java.util.function.Consumer; - @AutomaticallyRegisteredFeature public class ImageHeapConnectedComponentsFeature implements InternalFeature { public static class Options { - @Option(help = {"file:doc-files/PrintImageHeapConnectedComponents.md"}, type = OptionType.Debug)// + @Option(help = "file:doc-files/PrintImageHeapConnectedComponents.md", type = OptionType.Debug)// static final HostedOptionKey PrintImageHeapConnectedComponents = new HostedOptionKey<>(false); }