-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43285 from gsmet/3.14.4-backports-1
[3.14] 3.14.4 backports 1
- Loading branch information
Showing
72 changed files
with
1,267 additions
and
2,525 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
152 changes: 12 additions & 140 deletions
152
devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 13 additions & 19 deletions
32
...ls/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/ImageBuild.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,27 @@ | ||
|
||
package io.quarkus.gradle.tasks; | ||
|
||
import static io.quarkus.gradle.tasks.ImageCheckRequirementsTask.QUARKUS_CONTAINER_IMAGE_BUILD; | ||
import static io.quarkus.gradle.tasks.ImageCheckRequirementsTask.QUARKUS_CONTAINER_IMAGE_BUILDER; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.gradle.api.tasks.TaskAction; | ||
import org.gradle.api.provider.MapProperty; | ||
import org.gradle.api.tasks.options.Option; | ||
|
||
public abstract class ImageBuild extends ImageTask { | ||
|
||
@Inject | ||
public ImageBuild() { | ||
super("Perform an image build", true); | ||
Optional<Builder> builder = Optional.empty(); | ||
|
||
@Option(option = "builder", description = "The container image extension to use for building the image (e.g. docker, jib, buildpack, openshift).") | ||
public void setBuilder(Builder builder) { | ||
this.builder = Optional.of(builder); | ||
} | ||
|
||
@TaskAction | ||
public void imageBuild() throws IOException { | ||
Map<String, String> forcedProperties = new HashMap<String, String>(); | ||
File imageBuilder = getBuilderName().get().getAsFile(); | ||
String inputString = new String(Files.readAllBytes(imageBuilder.toPath())); | ||
@Inject | ||
public ImageBuild() { | ||
super("Perform an image build"); | ||
MapProperty<String, String> forcedProperties = extension().forcedPropertiesProperty(); | ||
forcedProperties.put(QUARKUS_CONTAINER_IMAGE_BUILD, "true"); | ||
forcedProperties.put(QUARKUS_CONTAINER_IMAGE_BUILDER, inputString); | ||
getAdditionalForcedProperties().get().getProperties().putAll(forcedProperties); | ||
forcedProperties.put(QUARKUS_CONTAINER_IMAGE_BUILDER, getProject().provider(() -> builder().name())); | ||
} | ||
} |
121 changes: 0 additions & 121 deletions
121
...-application-plugin/src/main/java/io/quarkus/gradle/tasks/ImageCheckRequirementsTask.java
This file was deleted.
Oops, something went wrong.
39 changes: 29 additions & 10 deletions
39
...ols/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/ImagePush.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,45 @@ | ||
package io.quarkus.gradle.tasks; | ||
|
||
import static io.quarkus.gradle.tasks.ImageCheckRequirementsTask.*; | ||
package io.quarkus.gradle.tasks; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.gradle.api.provider.MapProperty; | ||
import org.gradle.api.tasks.TaskAction; | ||
|
||
public abstract class ImagePush extends ImageTask { | ||
|
||
@Inject | ||
public ImagePush() { | ||
super("Perform an image push", true); | ||
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 imagePush() { | ||
Map<String, String> forcedProperties = new HashMap<String, String>(); | ||
forcedProperties.put(QUARKUS_CONTAINER_IMAGE_BUILD, "true"); | ||
forcedProperties.put(QUARKUS_CONTAINER_IMAGE_PUSH, "true"); | ||
getAdditionalForcedProperties().get().getProperties().putAll(forcedProperties); | ||
public void checkRequiredExtensions() { | ||
List<String> containerImageExtensions = getProject().getConfigurations().stream() | ||
.flatMap(c -> c.getDependencies().stream()) | ||
.map(d -> d.getName()) | ||
.filter(n -> n.startsWith(QUARKUS_CONTAINER_IMAGE_PREFIX)) | ||
.map(n -> n.replaceAll("-deployment$", "")) | ||
.collect(Collectors.toList()); | ||
|
||
List<String> extensions = Arrays.stream(ImageBuild.Builder.values()).map(b -> QUARKUS_CONTAINER_IMAGE_PREFIX + b.name()) | ||
.collect(Collectors.toList()); | ||
|
||
if (containerImageExtensions.isEmpty()) { | ||
getLogger().warn("Task: {} requires a container image extension.", getName()); | ||
getLogger().warn("Available container image exntesions: [{}]", | ||
extensions.stream().collect(Collectors.joining(", "))); | ||
getLogger().warn("To add an extension to the project, you can run one of the commands below:"); | ||
extensions.forEach(e -> { | ||
getLogger().warn("\tgradle addExtension --extensions={}", e); | ||
}); | ||
} | ||
} | ||
} |
Oops, something went wrong.