Skip to content

Commit

Permalink
Merge pull request #43285 from gsmet/3.14.4-backports-1
Browse files Browse the repository at this point in the history
[3.14] 3.14.4 backports 1
  • Loading branch information
gsmet authored Sep 14, 2024
2 parents 8f048ef + 7e4d1cf commit 9799523
Show file tree
Hide file tree
Showing 72 changed files with 1,267 additions and 2,525 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci-actions-incremental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,12 @@ jobs:
CAPTURE_BUILD_SCAN: true
run: |
git clone --depth=1 -b ${{ steps.get-quickstarts-branch.outputs.result }} https://github.com/quarkusio/quarkus-quickstarts.git && cd quarkus-quickstarts
export LANG=en_US && ./mvnw -e -B -fae --settings .github/mvn-settings.xml clean verify -DskipTests
if [ "${{ steps.get-quickstarts-branch.outputs.result }}" != "development" ]; then
QUARKUS_VERSION_ARGS="-Dquarkus.platform.version=${{ steps.get-quickstarts-branch.outputs.result }}.999-SNAPSHOT"
else
QUARKUS_VERSION_ARGS=""
fi
export LANG=en_US && ./mvnw -e -B -fae --settings .github/mvn-settings.xml clean verify -DskipTests -Dquarkus.platform.group-id=io.quarkus $QUARKUS_VERSION_ARGS
- name: Prepare build reports archive
if: always()
run: |
Expand Down
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<httpasync.version>4.1.5</httpasync.version>
<cronutils.version>9.2.1</cronutils.version>
<quartz.version>2.3.2</quartz.version>
<h2.version>2.3.232</h2.version> <!-- When updating, needs to be matched in io.quarkus.hibernate.orm.runtime.config.DialectVersions
<h2.version>2.3.230</h2.version> <!-- When updating, needs to be matched in io.quarkus.hibernate.orm.runtime.config.DialectVersions
and the dependency jts-core needs to be updated in extensions/jdbc/jdbc-h2/runtime/pom.xml -->
<postgresql-jdbc.version>42.7.4</postgresql-jdbc.version>
<mariadb-jdbc.version>3.4.1</mariadb-jdbc.version>
Expand Down
2 changes: 1 addition & 1 deletion devtools/gradle/gradle-application-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
dependencies {
implementation(libs.smallrye.config.yaml)
implementation("io.quarkus:quarkus-analytics-common")
compileOnly(libs.kotlin.gradle.plugin.api)

testImplementation(libs.quarkus.project.core.extension.codestarts)
}

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import org.gradle.api.Action;
import org.gradle.api.Project;
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.file.FileCollection;
import org.gradle.api.file.RegularFile;
import org.gradle.api.plugins.JavaPlugin;
Expand Down Expand Up @@ -166,14 +165,6 @@ public Set<File> resourcesDir() {
return getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getResources().getSrcDirs();
}

public static FileCollection combinedOutputSourceDirs(Project project) {
ConfigurableFileCollection classesDirs = project.files();
SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class);
classesDirs.from(sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput().getClassesDirs());
classesDirs.from(sourceSets.getByName(SourceSet.TEST_SOURCE_SET_NAME).getOutput().getClassesDirs());
return classesDirs;
}

public Set<File> combinedOutputSourceDirs() {
Set<File> sourcesDirs = new LinkedHashSet<>();
SourceSetContainer sourceSets = getSourceSets();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public abstract class AbstractQuarkusExtension {
private static final String MANIFEST_SECTIONS_PROPERTY_PREFIX = "quarkus.package.jar.manifest.sections";
private static final String MANIFEST_ATTRIBUTES_PROPERTY_PREFIX = "quarkus.package.jar.manifest.attributes";

protected static final String QUARKUS_PROFILE = "quarkus.profile";
private static final String QUARKUS_PROFILE = "quarkus.profile";
protected final Project project;
protected final File projectDir;
protected final Property<String> finalName;
Expand Down Expand Up @@ -249,14 +249,14 @@ private void exportCustomManifestProperties(Map<String, Object> properties) {
}
}

protected static String toManifestAttributeKey(String key) {
private String toManifestAttributeKey(String key) {
if (key.contains("\"")) {
throw new GradleException("Manifest entry name " + key + " is invalid. \" characters are not allowed.");
}
return String.format("%s.\"%s\"", MANIFEST_ATTRIBUTES_PROPERTY_PREFIX, key);
}

protected static String toManifestSectionAttributeKey(String section, String key) {
private String toManifestSectionAttributeKey(String section, String key) {
if (section.contains("\"")) {
throw new GradleException("Manifest section name " + section + " is invalid. \" characters are not allowed.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void setImageBuilder(String imageBuilder) {

@Inject
public Deploy() {
super("Deploy", false);
super("Deploy");
}

@TaskAction
Expand Down
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()));
}
}

This file was deleted.

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);
});
}
}
}
Loading

0 comments on commit 9799523

Please sign in to comment.