Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype / early discussion for enabling incremental build for installFeature #811

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -186,8 +189,9 @@ public class AbstractFeatureTask extends AbstractServerTask {
}
return result;
}


protected Set<String> getSpecifiedFeatures(String containerName) throws PluginExecutionException {
public Set<String> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -43,6 +47,16 @@ class InstallFeatureTask extends AbstractFeatureTask {
this.containerName = containerName;
}

@Input
public Set<String> 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.
Expand Down