Skip to content

Commit

Permalink
Fix image properties applied on task configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Malandril committed Sep 1, 2024
1 parent 2c1cdd9 commit a25cab5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
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

0 comments on commit a25cab5

Please sign in to comment.