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

Fix image properties applied on gradle task configuration #42934

Closed
wants to merge 1 commit into from
Closed
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 @@ -6,6 +6,7 @@
import javax.inject.Inject;

import org.gradle.api.provider.MapProperty;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.options.Option;

public abstract class ImageBuild extends ImageTask {
Expand All @@ -20,8 +21,14 @@ public void setBuilder(Builder builder) {
@Inject
public ImageBuild() {
super("Perform an image build");
}

@TaskAction
@Override
public void checkRequiredExtensions() {
MapProperty<String, String> forcedProperties = extension().forcedPropertiesProperty();
forcedProperties.put(QUARKUS_CONTAINER_IMAGE_BUILD, "true");
forcedProperties.put(QUARKUS_CONTAINER_IMAGE_BUILDER, getProject().provider(() -> builder().name()));
super.checkRequiredExtensions();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ public abstract class ImagePush extends ImageTask {
@Inject
public ImagePush() {
super("Perform an image push");
MapProperty<String, String> forcedProperties = extension().forcedPropertiesProperty();
forcedProperties.put(QUARKUS_CONTAINER_IMAGE_BUILD, "true");
forcedProperties.put(QUARKUS_CONTAINER_IMAGE_PUSH, "true");
}

@TaskAction
public void checkRequiredExtensions() {
MapProperty<String, String> forcedProperties = extension().forcedPropertiesProperty();
forcedProperties.put(QUARKUS_CONTAINER_IMAGE_BUILD, "true");
forcedProperties.put(QUARKUS_CONTAINER_IMAGE_PUSH, "true");
List<String> containerImageExtensions = getProject().getConfigurations().stream()
.flatMap(c -> c.getDependencies().stream())
.map(d -> d.getName())
Expand Down
Loading