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

Make devc command line properties persist between Gradle runners #869

Merged
merged 1 commit into from
Dec 8, 2023
Merged
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
10 changes: 8 additions & 2 deletions src/main/groovy/io/openliberty/tools/gradle/tasks/DevTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ class DevTask extends AbstractFeatureTask {
void setContainerfile(String containerfile) {
if (containerfile != null) {
// ensures the containerfile is defined with the full path - matches how maven behaves
this.containerfile = convertParameterToCanonicalFile(containerfile, "containerfile");
this.containerfile = convertParameterToCanonicalFile(containerfile, "containerfile");
project.liberty.dev.containerfile = this.containerfile;
cherylking marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand All @@ -220,7 +221,8 @@ class DevTask extends AbstractFeatureTask {
void setContainerBuildContext(String containerBuildContext) {
if (containerBuildContext != null) {
// ensures the containerBuildContext is defined with the full path - matches how maven behaves
this.containerBuildContext = convertParameterToCanonicalFile(containerBuildContext, "containerBuildContext");
this.containerBuildContext = convertParameterToCanonicalFile(containerBuildContext, "containerBuildContext");
project.liberty.dev.containerBuildContext = this.containerBuildContext;
}
}

Expand Down Expand Up @@ -255,6 +257,7 @@ class DevTask extends AbstractFeatureTask {
@Option(option = 'containerRunOpts', description = 'Additional options for the container run command when dev mode starts a container.')
void setContainerRunOpts(String containerRunOpts) {
this.containerRunOpts = containerRunOpts;
project.liberty.dev.containerRunOpts = this.containerRunOpts;
}

private String dockerRunOpts;
Expand All @@ -271,6 +274,7 @@ class DevTask extends AbstractFeatureTask {
void setContainerBuildTimeout(String inputValue) {
try {
this.containerBuildTimeout = Integer.valueOf(inputValue);
project.liberty.dev.containerBuildTimeout = this.containerBuildTimeout;
} catch (NumberFormatException e) {
logger.error(String.format("Unexpected value: %s for dev mode option containerBuildTimeout. containerBuildTimeout should be a valid integer.", inputValue));
throw e;
Expand All @@ -290,13 +294,15 @@ class DevTask extends AbstractFeatureTask {
@Option(option = 'skipDefaultPorts', description = 'If true, the default container port mappings are skipped in the container run command.')
void setSkipDefaultPorts(boolean skipDefaultPorts) {
this.skipDefaultPorts = skipDefaultPorts;
project.liberty.dev.skipDefaultPorts = this.skipDefaultPorts;
}

private Boolean keepTempContainerfile;

@Option(option = 'keepTempContainerfile', description = 'If true, preserve the temporary Containerfile/Dockerfile used to build the container.')
void setKeepTempContainerfile(boolean keepTempContainerfile) {
this.keepTempContainerfile = keepTempContainerfile;
project.liberty.dev.keepTempContainerfile = this.keepTempContainerfile;
}

private Boolean keepTempDockerfile;
Expand Down
Loading