Skip to content

Commit

Permalink
Merge pull request #18920 from gsmet/2.1.0.Final-backports-3
Browse files Browse the repository at this point in the history
2.1.0.final backports 3
  • Loading branch information
gsmet authored Jul 22, 2021
2 parents 14595e5 + 6b01498 commit 3b922d3
Show file tree
Hide file tree
Showing 211 changed files with 3,743 additions and 764 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci-actions-incremental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,11 @@ jobs:
maven_opts: "-Xmx2g -XX:MaxMetaspaceSize=1g",
os-name: "ubuntu-latest"
}
# all the jdk.compiler ones are for Kotlin Kapt
- {
name: "16",
java-version: 16,
maven_args: "$JVM_TEST_MAVEN_ARGS -pl '!devtools/gradle'",
maven_opts: "-Xmx2g -XX:MaxMetaspaceSize=1g --add-opens java.base/java.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
maven_opts: "-Xmx2g -XX:MaxMetaspaceSize=1g",
os-name: "ubuntu-latest"
}
- {
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/jdk-early-access-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ jobs:
if: "github.repository == 'quarkusio/quarkus' || github.event_name == 'workflow_dispatch'"
timeout-minutes: 360
env:
# "--add-opens ..." to work around https://youtrack.jetbrains.com/issue/KT-43704
# all the jdk.compiler ones are for Kotlin Kapt
MAVEN_OPTS: -Xmx2048m -XX:MaxMetaspaceSize=1000m --add-opens java.base/java.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
MAVEN_OPTS: -Xmx2048m -XX:MaxMetaspaceSize=1000m
steps:

- name: Set up JDK
Expand Down
16 changes: 8 additions & 8 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<opentracing-jdbc.version>0.2.4</opentracing-jdbc.version>
<opentracing-kafka.version>0.1.15</opentracing-kafka.version>
<opentracing-mongo.version>0.1.5</opentracing-mongo.version>
<opentelemetry.version>1.3.0</opentelemetry.version>
<opentelemetry-alpha.version>1.3.0-alpha</opentelemetry-alpha.version>
<opentelemetry.version>1.4.1</opentelemetry.version>
<opentelemetry-alpha.version>1.4.1-alpha</opentelemetry-alpha.version>
<jaeger.version>1.4.0</jaeger.version>
<quarkus-http.version>4.1.1</quarkus-http.version>
<jboss-servlet-api_4.0_spec.version>1.0.0.Final</jboss-servlet-api_4.0_spec.version>
Expand All @@ -53,8 +53,8 @@
<smallrye-context-propagation.version>1.2.0</smallrye-context-propagation.version>
<smallrye-reactive-streams-operators.version>1.0.13</smallrye-reactive-streams-operators.version>
<smallrye-reactive-types-converter.version>2.6.0</smallrye-reactive-types-converter.version>
<smallrye-mutiny-vertx-binding.version>2.9.0</smallrye-mutiny-vertx-binding.version>
<smallrye-reactive-messaging.version>3.6.0</smallrye-reactive-messaging.version>
<smallrye-mutiny-vertx-binding.version>2.11.0</smallrye-mutiny-vertx-binding.version>
<smallrye-reactive-messaging.version>3.7.1</smallrye-reactive-messaging.version>
<jakarta.activation.version>1.2.1</jakarta.activation.version>
<jakarta.annotation-api.version>1.3.5</jakarta.annotation-api.version>
<jakarta.el-impl.version>3.0.3</jakarta.el-impl.version>
Expand Down Expand Up @@ -90,7 +90,7 @@
<commons-lang3.version>3.12.0</commons-lang3.version>
<commons-codec.version>1.15</commons-codec.version>
<classmate.version>1.5.1</classmate.version>
<hibernate-orm.version>5.5.3.Final</hibernate-orm.version>
<hibernate-orm.version>5.5.4.Final</hibernate-orm.version>
<hibernate-reactive.version>1.0.0.CR8</hibernate-reactive.version>
<hibernate-validator.version>6.2.0.Final</hibernate-validator.version>
<hibernate-search.version>6.0.5.Final</hibernate-search.version>
Expand All @@ -109,7 +109,7 @@
<wildfly-elytron.version>1.16.0.Final</wildfly-elytron.version>
<jboss-modules.version>1.8.7.Final</jboss-modules.version>
<jboss-threads.version>3.4.0.Final</jboss-threads.version>
<vertx.version>4.1.1</vertx.version>
<vertx.version>4.1.2</vertx.version>
<httpclient.version>4.5.13</httpclient.version>
<httpcore.version>4.4.14</httpcore.version>
<httpasync.version>4.1.4</httpasync.version>
Expand Down Expand Up @@ -150,7 +150,7 @@
<azure-functions-java-library.version>1.4.2</azure-functions-java-library.version>
<kotlin.version>1.5.21</kotlin.version>
<kotlin.coroutine.version>1.5.0</kotlin.coroutine.version>
<dekorate.version>2.2.2</dekorate.version>
<dekorate.version>2.3.0</dekorate.version>
<maven-artifact-transfer.version>0.10.0</maven-artifact-transfer.version>
<maven-invoker.version>3.0.1</maven-invoker.version>
<awaitility.version>4.1.0</awaitility.version>
Expand All @@ -169,7 +169,7 @@
<okhttp.version>3.14.9</okhttp.version>
<sentry.version>5.0.1</sentry.version>
<hibernate-quarkus-local-cache.version>0.1.0</hibernate-quarkus-local-cache.version>
<kubernetes-client.version>5.5.0</kubernetes-client.version>
<kubernetes-client.version>5.6.0</kubernetes-client.version>
<flapdoodle.mongo.version>2.2.0</flapdoodle.mongo.version>
<quarkus-spring-api.version>5.2.SP4</quarkus-spring-api.version>
<quarkus-spring-data-api.version>2.1.SP2</quarkus-spring-data-api.version>
Expand Down
12 changes: 8 additions & 4 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<wagon-provider-api.version>3.4.3</wagon-provider-api.version>

<!-- The image to use for tests that run Keycloak -->
<!-- IMPORTANT: If this is changed you must also update bom/application/pom.xml to match the version -->
<!-- IMPORTANT: If this is changed you must also update bom/application/pom.xml and KeycloakBuildTimeConfig/DevServicesConfig in quarkus-oidc/deployment to match the version -->
<keycloak.docker.image>quay.io/keycloak/keycloak:14.0.0</keycloak.docker.image>

<unboundid-ldap.version>4.0.13</unboundid-ldap.version>
Expand Down Expand Up @@ -339,7 +339,9 @@
<maven.home>${maven.home}</maven.home>
<maven.repo.local>${settings.localRepository}</maven.repo.local>
<maven.settings>${session.request.userSettingsFile.path}</maven.settings>
<project.version>${project.version}</project.version> <!-- some dev tools tests need this -->
<!-- some dev tools tests need the following properties -->
<project.version>${project.version}</project.version>
<project.groupId>${project.groupId}</project.groupId>
</systemPropertyVariables>
<!-- limit the amount of memory surefire can use, 1500m should be plenty-->
<!-- set tmpdir as early as possible because surefire sets it too late for JDK16 -->
Expand All @@ -358,7 +360,9 @@
<maven.home>${maven.home}</maven.home>
<maven.repo.local>${settings.localRepository}</maven.repo.local>
<maven.settings>${session.request.userSettingsFile.path}</maven.settings>
<project.version>${project.version}</project.version> <!-- some dev tools tests need this -->
<!-- some dev tools tests need the following properties -->
<project.version>${project.version}</project.version>
<project.groupId>${project.groupId}</project.groupId>
</systemPropertyVariables>
<!-- set tmpdir as early as possible because failsafe sets it too late for JDK16 -->
<argLine>-Djava.io.tmpdir="${project.build.directory}"</argLine>
Expand Down Expand Up @@ -820,7 +824,7 @@
<property>
<name>dokka</name>
</property>
<jdk>[,16)</jdk>
<jdk>(,16)</jdk>
<file>
<exists>src/main/kotlin</exists>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ public class PlatformConfig {
/**
* groupId of the platform to use
*/
@ConfigItem(defaultValue = "io.quarkus")
@ConfigItem(defaultValue = "io.quarkus.platform")
String groupId;

/**
* artifactId of the platform to use
*/
@ConfigItem(defaultValue = "quarkus-universe-bom")
@ConfigItem(defaultValue = "quarkus-bom")
String artifactId;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ void installBuiltins(DevModeType devModeType) {
? toLevel(((LogManager) LogManager.getLogManager()).getLogger("").getLevel()).toString()
: currentLevel.toString())),
ConsoleStateManager.this::toggleLogLevel));
commands.add(new ConsoleCommand((char) 13, null, null, 10001, null, this::printBlankLine));
commands.add(new ConsoleCommand('h', "Shows this help", "for more options", 10000, null, this::printHelp));
commands.add(new ConsoleCommand('q', "Quits the application", null, this::exitQuarkus));
context.reset(commands.toArray(new ConsoleCommand[0]));
Expand Down Expand Up @@ -175,6 +176,10 @@ public void run() {
}
}

private void printBlankLine() {
System.out.println("");
}

private void printHelp() {
System.out.println("\nThe following commands are currently available:");
Set<ConsoleContext> contexts = new HashSet<>();
Expand All @@ -186,13 +191,15 @@ private void printHelp() {
.collect(Collectors.toList())) {
System.out.println("\n" + RED + "==" + RESET + " " + UNDERLINE + ctx.name + NO_UNDERLINE + "\n");
for (var i : ctx.internal) {
if (i.getHelpState() == null) {
System.out.println(helpOption(i.getKey(), i.getDescription()));
} else if (i.getHelpState().toggleState != null) {
System.out.println(helpOption(i.getKey(), i.getDescription(), i.getHelpState().toggleState.get()));
} else {
System.out.println(helpOption(i.getKey(), i.getDescription(), i.getHelpState().stateSupplier.get(),
i.getHelpState().colorSupplier.get()));
if (i.getDescription() != null) {
if (i.getHelpState() == null) {
System.out.println(helpOption(i.getKey(), i.getDescription()));
} else if (i.getHelpState().toggleState != null) {
System.out.println(helpOption(i.getKey(), i.getDescription(), i.getHelpState().toggleState.get()));
} else {
System.out.println(helpOption(i.getKey(), i.getDescription(), i.getHelpState().stateSupplier.get(),
i.getHelpState().colorSupplier.get()));
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.deployment.dev;

import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static java.util.stream.Collectors.groupingBy;
import static java.util.stream.Collectors.toList;

Expand All @@ -20,11 +22,11 @@
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
Expand Down Expand Up @@ -213,6 +215,7 @@ public void handleChanges(Collection<FileChangeEvent> changes) {
periodicTestCompile();
}
};
Set<Path> nonExistent = new HashSet<>();
for (DevModeContext.ModuleInfo module : context.getAllModules()) {
for (Path path : module.getMain().getSourcePaths()) {
testClassChangeWatcher.watchPath(path.toFile(), callback);
Expand All @@ -222,10 +225,41 @@ public void handleChanges(Collection<FileChangeEvent> changes) {
}
}
for (Path path : context.getApplicationRoot().getTest().get().getSourcePaths()) {
testClassChangeWatcher.watchPath(path.toFile(), callback);
if (!Files.isDirectory(path)) {
nonExistent.add(path);
} else {
testClassChangeWatcher.watchPath(path.toFile(), callback);
}
}
for (Path path : context.getApplicationRoot().getTest().get().getResourcePaths()) {
testClassChangeWatcher.watchPath(path.toFile(), callback);
if (!Files.isDirectory(path)) {
nonExistent.add(path);
} else {
testClassChangeWatcher.watchPath(path.toFile(), callback);
}
}
if (!nonExistent.isEmpty()) {
{
testClassChangeTimer = new Timer("Test Compile Timer", true);
testClassChangeTimer.schedule(new TimerTask() {
@Override
public void run() {
boolean added = false;
for (Iterator<Path> iterator = nonExistent.iterator(); iterator.hasNext();) {
Path i = iterator.next();
if (Files.isDirectory(i)) {
iterator.remove();
testClassChangeWatcher.watchPath(i.toFile(), callback);
added = true;
}

}
if (added) {
periodicTestCompile();
}
}
}, 1, 1000);
}
}
periodicTestCompile();
} else {
Expand All @@ -247,22 +281,25 @@ private void periodicTestCompile() {
try {
ClassScanResult changedTestClassResult = compileTestClasses();
ClassScanResult changedApp = checkForChangedClasses(compiler, DevModeContext.ModuleInfo::getMain, false, test);
Set<String> filesChanges = new HashSet<>(checkForFileChange(s -> s.getTest().get(), test));
if (changedApp.compilationHappened) {
if (compileProblem != null) {
testSupport.getTestRunner().testCompileFailed(compileProblem);
} else {
testSupport.getTestRunner().testCompileSucceeded();
}
}
Set<String> filesChanges = new HashSet<>(checkForFileChange(s -> s.getTest().orElse(null), test));
filesChanges.addAll(checkForFileChange(DevModeContext.ModuleInfo::getMain, test));
boolean configFileRestartNeeded = filesChanges.stream().map(test.watchedFilePaths::get)
.anyMatch(Boolean.TRUE::equals);

ClassScanResult merged = ClassScanResult.merge(changedTestClassResult, changedApp);
if (configFileRestartNeeded) {
if (compileProblem != null) {
testSupport.getTestRunner().testCompileFailed(compileProblem);
} else {
if (compileProblem == null) {
testSupport.getTestRunner().runTests(null);
}
} else if (merged.isChanged()) {
if (compileProblem != null) {
testSupport.getTestRunner().testCompileFailed(compileProblem);
} else {
if (compileProblem == null) {
testSupport.getTestRunner().runTests(merged);
}
}
Expand Down Expand Up @@ -625,7 +662,7 @@ && sourceFileWasRecentModified(p, ignoreFirstScanChanges, firstScan))
compileProblem = null;
} catch (Exception e) {
compileProblem = e;
return new ClassScanResult();
return classScanResult;
}
boolean timestampsChanged = false;
//check to make sure no changes have occurred while the compilation was
Expand Down Expand Up @@ -760,13 +797,17 @@ Set<String> checkForFileChange(Function<DevModeContext.ModuleInfo, DevModeContex
TimestampSet timestampSet) {
Set<String> ret = new HashSet<>();
for (DevModeContext.ModuleInfo module : context.getAllModules()) {
final Set<Path> moduleResources = correspondingResources.computeIfAbsent(cuf.apply(module),
DevModeContext.CompilationUnit compilationUnit = cuf.apply(module);
if (compilationUnit == null) {
continue;
}
final Set<Path> moduleResources = correspondingResources.computeIfAbsent(compilationUnit,
m -> Collections.newSetFromMap(new ConcurrentHashMap<>()));
boolean doCopy = true;
PathsCollection rootPaths = cuf.apply(module).getResourcePaths();
String outputPath = cuf.apply(module).getResourcesOutputPath();
PathsCollection rootPaths = compilationUnit.getResourcePaths();
String outputPath = compilationUnit.getResourcesOutputPath();
if (rootPaths.isEmpty()) {
String rootPath = cuf.apply(module).getClassesPath();
String rootPath = compilationUnit.getClassesPath();
if (rootPath != null) {
rootPaths = PathsCollection.of(Paths.get(rootPath));
}
Expand Down Expand Up @@ -945,10 +986,11 @@ public RuntimeUpdatesProcessor setDisableInstrumentationForIndexPredicate(

public RuntimeUpdatesProcessor setWatchedFilePaths(Map<String, Boolean> watchedFilePaths, boolean isTest) {
if (isTest) {
setWatchedFilePathsInternal(watchedFilePaths, test, s -> Arrays.asList(s.getTest().get(), s.getMain()));
setWatchedFilePathsInternal(watchedFilePaths, test,
s -> s.getTest().isPresent() ? asList(s.getTest().get(), s.getMain()) : singletonList(s.getMain()));
} else {
main.watchedFileTimestamps.clear();
setWatchedFilePathsInternal(watchedFilePaths, main, s -> Collections.singletonList(s.getMain()));
setWatchedFilePathsInternal(watchedFilePaths, main, s -> singletonList(s.getMain()));
}
return this;
}
Expand Down
Loading

0 comments on commit 3b922d3

Please sign in to comment.