diff --git a/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractFeatureTask.groovy b/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractFeatureTask.groovy index 852f1c6e..a19d79c3 100644 --- a/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractFeatureTask.groovy +++ b/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractFeatureTask.groovy @@ -24,10 +24,13 @@ import io.openliberty.tools.common.plugins.util.ServerFeatureUtil import io.openliberty.tools.gradle.utils.ArtifactDownloadUtil import org.gradle.api.Project import org.gradle.api.logging.LogLevel +import org.gradle.api.tasks.Input import org.gradle.api.tasks.Internal +import org.gradle.api.tasks.OutputDirectory import org.gradle.api.tasks.options.Option import org.gradle.testfixtures.ProjectBuilder import org.gradle.api.artifacts.Configuration +import org.gradle.api.file.FileCollection public class AbstractFeatureTask extends AbstractServerTask { @@ -186,8 +189,9 @@ public class AbstractFeatureTask extends AbstractServerTask { } return result; } + - protected Set getSpecifiedFeatures(String containerName) throws PluginExecutionException { + public Set getSpecifiedFeatures(String containerName) throws PluginExecutionException { InstallFeatureUtil util = getInstallFeatureUtil(null, containerName); // if createNewInstallFeatureUtil failed to create a new InstallFeatureUtil instance, then features are installed via ant if (installFeaturesFromAnt) { diff --git a/src/main/groovy/io/openliberty/tools/gradle/tasks/InstallFeatureTask.groovy b/src/main/groovy/io/openliberty/tools/gradle/tasks/InstallFeatureTask.groovy index 44c61691..ce3f2673 100644 --- a/src/main/groovy/io/openliberty/tools/gradle/tasks/InstallFeatureTask.groovy +++ b/src/main/groovy/io/openliberty/tools/gradle/tasks/InstallFeatureTask.groovy @@ -19,8 +19,12 @@ import java.util.Set import org.gradle.api.artifacts.ResolveException import org.gradle.api.logging.LogLevel +import org.gradle.api.tasks.OutputDirectory import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.options.Option +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.Internal +import org.gradle.api.tasks.OutputDirectory import io.openliberty.tools.common.plugins.util.InstallFeatureUtil import io.openliberty.tools.common.plugins.util.DevUtil @@ -43,6 +47,16 @@ class InstallFeatureTask extends AbstractFeatureTask { this.containerName = containerName; } + @Input + public Set getSpecifiedFeatures() throws PluginExecutionException { + return super.getSpecifiedFeatures(containerName) + } + + @OutputDirectory + public File getLibDirectory() { + return new File(getInstallDir(project),"/lib/features") + } + @TaskAction void installFeature() { // If non-container mode, check for Beta version and skip if needed. Container mode does not need to check since featureUtility will check when it is called.