Compile with parameter names

Compiled code should contain parameter names to avoid the need
for class resources to be included in native image builds.

Closes gh-27369
This commit is contained in:
Sébastien Deleuze
2021-09-07 15:08:15 +02:00
parent d8191b4808
commit 3f66ef7aee

View File

@@ -32,6 +32,7 @@ import org.gradle.api.tasks.compile.JavaCompile;
*
* @author Brian Clozel
* @author Sam Brannen
* @author Sebastien Deleuze
*/
public class CompilerConventionsPlugin implements Plugin<Project> {
@@ -43,7 +44,8 @@ public class CompilerConventionsPlugin implements Plugin<Project> {
List<String> commonCompilerArgs = Arrays.asList(
"-Xlint:serial", "-Xlint:cast", "-Xlint:classfile", "-Xlint:dep-ann",
"-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", "-Xlint:overrides",
"-Xlint:path", "-Xlint:processing", "-Xlint:static", "-Xlint:try", "-Xlint:-options"
"-Xlint:path", "-Xlint:processing", "-Xlint:static", "-Xlint:try", "-Xlint:-options",
"-parameters"
);
COMPILER_ARGS = new ArrayList<>();
COMPILER_ARGS.addAll(commonCompilerArgs);
@@ -54,7 +56,7 @@ public class CompilerConventionsPlugin implements Plugin<Project> {
TEST_COMPILER_ARGS = new ArrayList<>();
TEST_COMPILER_ARGS.addAll(commonCompilerArgs);
TEST_COMPILER_ARGS.addAll(Arrays.asList("-Xlint:-varargs", "-Xlint:-fallthrough", "-Xlint:-rawtypes",
"-Xlint:-deprecation", "-Xlint:-unchecked", "-parameters"));
"-Xlint:-deprecation", "-Xlint:-unchecked"));
}
@Override