From 211650bc10cc83aba21febd0d08077c5215e97e2 Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Tue, 26 Sep 2023 12:08:51 +0200 Subject: [PATCH] Make configurable fields public Some plugins tasks properties were _protected_, which prevents the user from configuring them using the Kotlin DSL. There were accessible in Groovy scripts, which we use in tests, so these were unnoticed. Revealed by comment in #785 Fixes #785 --- .../micronaut/gradle/aot/AbstractMicronautAotCliTask.java | 8 ++++---- .../internal/build/sourcegen/SimpleSourceProcessor.java | 6 +++--- .../micronaut/gradle/ApplicationClasspathInspector.java | 6 +++--- .../gradle/testresources/StartTestResourcesService.java | 2 +- .../gradle/testresources/StopTestResourcesService.java | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/aot-plugin/src/main/java/io/micronaut/gradle/aot/AbstractMicronautAotCliTask.java b/aot-plugin/src/main/java/io/micronaut/gradle/aot/AbstractMicronautAotCliTask.java index 4f0573c4..ae0375bf 100644 --- a/aot-plugin/src/main/java/io/micronaut/gradle/aot/AbstractMicronautAotCliTask.java +++ b/aot-plugin/src/main/java/io/micronaut/gradle/aot/AbstractMicronautAotCliTask.java @@ -52,18 +52,18 @@ abstract class AbstractMicronautAotCliTask extends DefaultTask implements Optimi protected abstract ExecOperations getExecOperations(); @Input - protected abstract Property getDebug(); + public abstract Property getDebug(); @Input - protected abstract Property getAotVersion(); + public abstract Property getAotVersion(); @Input @Optional - protected abstract MapProperty getEnvironmentVariables(); + public abstract MapProperty getEnvironmentVariables(); @Input @Optional - protected abstract ListProperty getJvmArgs(); + public abstract ListProperty getJvmArgs(); protected AbstractMicronautAotCliTask() { getDebug().convention(false); diff --git a/buildSrc/src/main/groovy/io/micronaut/internal/build/sourcegen/SimpleSourceProcessor.java b/buildSrc/src/main/groovy/io/micronaut/internal/build/sourcegen/SimpleSourceProcessor.java index 92038846..4827eb6d 100644 --- a/buildSrc/src/main/groovy/io/micronaut/internal/build/sourcegen/SimpleSourceProcessor.java +++ b/buildSrc/src/main/groovy/io/micronaut/internal/build/sourcegen/SimpleSourceProcessor.java @@ -38,13 +38,13 @@ public abstract class SimpleSourceProcessor extends DefaultTask { @InputDirectory @PathSensitive(PathSensitivity.RELATIVE) - abstract DirectoryProperty getTemplates(); + public abstract DirectoryProperty getTemplates(); @OutputDirectory - abstract DirectoryProperty getOutputDirectory(); + public abstract DirectoryProperty getOutputDirectory(); @Input - abstract MapProperty getReplacements(); + public abstract MapProperty getReplacements(); @TaskAction public void process() throws IOException { diff --git a/minimal-plugin/src/main/java/io/micronaut/gradle/ApplicationClasspathInspector.java b/minimal-plugin/src/main/java/io/micronaut/gradle/ApplicationClasspathInspector.java index 660246fc..fa27f54e 100644 --- a/minimal-plugin/src/main/java/io/micronaut/gradle/ApplicationClasspathInspector.java +++ b/minimal-plugin/src/main/java/io/micronaut/gradle/ApplicationClasspathInspector.java @@ -35,7 +35,7 @@ public abstract class ApplicationClasspathInspector extends DefaultTask { @InputFiles @PathSensitive(PathSensitivity.RELATIVE) - abstract ConfigurableFileCollection getResources(); + public abstract ConfigurableFileCollection getResources(); /** * The runtime classpath. Curently we only care about the file names, @@ -44,10 +44,10 @@ public abstract class ApplicationClasspathInspector extends DefaultTask { */ @InputFiles @PathSensitive(PathSensitivity.NAME_ONLY) - abstract ConfigurableFileCollection getRuntimeClasspath(); + public abstract ConfigurableFileCollection getRuntimeClasspath(); @OutputFile - abstract RegularFileProperty getReportFile(); + public abstract RegularFileProperty getReportFile(); @TaskAction void inspect() throws IOException { diff --git a/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/StartTestResourcesService.java b/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/StartTestResourcesService.java index c9979d63..e9f0bad9 100644 --- a/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/StartTestResourcesService.java +++ b/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/StartTestResourcesService.java @@ -62,7 +62,7 @@ public abstract class StartTestResourcesService extends DefaultTask { @InputFiles @Classpath @Incremental - abstract ConfigurableFileCollection getClasspath(); + public abstract ConfigurableFileCollection getClasspath(); /** * The directory where the settings to connect to diff --git a/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/StopTestResourcesService.java b/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/StopTestResourcesService.java index 62497b68..45747da4 100644 --- a/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/StopTestResourcesService.java +++ b/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/StopTestResourcesService.java @@ -30,7 +30,7 @@ */ public abstract class StopTestResourcesService extends DefaultTask { @Destroys - abstract DirectoryProperty getSettingsDirectory(); + public abstract DirectoryProperty getSettingsDirectory(); @Inject protected abstract FileOperations getFileOperations();