Skip to content

Commit

Permalink
Merge branch 'main' into gradle-plugin-unavailable-services
Browse files Browse the repository at this point in the history
  • Loading branch information
snazy authored Nov 2, 2023
2 parents 6c895d0 + 389a663 commit d9e5e53
Show file tree
Hide file tree
Showing 137 changed files with 8,702 additions and 176 deletions.
4 changes: 2 additions & 2 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<smallrye-config.version>3.4.1</smallrye-config.version>
<smallrye-health.version>4.0.4</smallrye-health.version>
<smallrye-metrics.version>4.0.0</smallrye-metrics.version>
<smallrye-open-api.version>3.6.2</smallrye-open-api.version>
<smallrye-open-api.version>3.7.0</smallrye-open-api.version>
<smallrye-graphql.version>2.5.1</smallrye-graphql.version>
<smallrye-opentracing.version>3.0.3</smallrye-opentracing.version>
<smallrye-fault-tolerance.version>6.2.6</smallrye-fault-tolerance.version>
Expand Down Expand Up @@ -206,7 +206,7 @@
<log4j2-api.version>2.20.0</log4j2-api.version>
<log4j-jboss-logmanager.version>1.3.0.Final</log4j-jboss-logmanager.version>
<avro.version>1.11.3</avro.version>
<apicurio-registry.version>2.4.7.Final</apicurio-registry.version>
<apicurio-registry.version>2.4.14.Final</apicurio-registry.version>
<apicurio-common-rest-client.version>0.1.18.Final</apicurio-common-rest-client.version> <!-- must be the version Apicurio Registry uses -->
<testcontainers.version>1.19.1</testcontainers.version> <!-- Make sure to also update docker-java.version to match its needs -->
<docker-java.version>3.3.3</docker-java.version> <!-- must be the version Testcontainers use -->
Expand Down
104 changes: 104 additions & 0 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,110 @@
<scope>runtime</scope>
</dependency>

<!-- hpcc-js Wasm / Graphviz and dependencies -->
<dependency>
<groupId>org.mvnpm.at.hpcc-js</groupId>
<artifactId>wasm</artifactId>
<version>2.14.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>yargs</artifactId>
<version>17.7.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>cliui</artifactId>
<version>8.0.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>escalade</artifactId>
<version>3.1.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>get-caller-file</artifactId>
<version>2.0.5</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>require-directory</artifactId>
<version>2.1.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>string-width</artifactId>
<version>4.2.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>y18n</artifactId>
<version>5.0.8</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>yargs-parser</artifactId>
<version>21.1.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>strip-ansi</artifactId>
<version>6.0.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>wrap-ansi</artifactId>
<version>7.0.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>emoji-regex</artifactId>
<version>8.0.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>is-fullwidth-code-point</artifactId>
<version>3.0.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>ansi-regex</artifactId>
<version>5.0.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>ansi-styles</artifactId>
<version>4.3.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>color-convert</artifactId>
<version>2.0.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>color-name</artifactId>
<version>1.1.4</version>
<scope>runtime</scope>
</dependency>

<!-- Code editor -->
<dependency>
<groupId>org.mvnpm.at.vanillawc</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -139,21 +141,26 @@ List<URL> applicationPropsSources() {

static void configSourcesForApplicationProperties(Set<File> sourceDirectories, Consumer<URL> sourceUrls,
Consumer<ConfigSource> configSourceConsumer, int ordinal, String[] fileExtensions) {
URL[] resourceUrls = sourceDirectories.stream().map(File::toURI)
.map(u -> {
try {
return u.toURL();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
})
.toArray(URL[]::new);

for (URL resourceUrl : resourceUrls) {
URLClassLoader classLoader = new URLClassLoader(new URL[] { resourceUrl });
CombinedConfigSourceProvider configSourceProvider = new CombinedConfigSourceProvider(sourceUrls, ordinal,
fileExtensions);
configSourceProvider.getConfigSources(classLoader).forEach(configSourceConsumer);
for (var sourceDir : sourceDirectories) {
var sourceDirPath = sourceDir.toPath();
var locations = new ArrayList<String>();
for (String file : fileExtensions) {
Path resolved = sourceDirPath.resolve(file);
if (Files.exists(resolved)) {
locations.add(resolved.toUri().toString());
}
}
if (!locations.isEmpty()) {
URLClassLoader classLoader;
try {
classLoader = new URLClassLoader(new URL[] { sourceDir.toURI().toURL() });
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
CombinedConfigSourceProvider configSourceProvider = new CombinedConfigSourceProvider(sourceUrls, ordinal,
fileExtensions, locations);
configSourceProvider.getConfigSources(classLoader).forEach(configSourceConsumer);
}
}
}

Expand Down Expand Up @@ -204,11 +211,13 @@ static final class CombinedConfigSourceProvider extends AbstractLocationConfigSo
private final Consumer<URL> sourceUrls;
private final int ordinal;
private final String[] fileExtensions;
private final List<String> locations;

CombinedConfigSourceProvider(Consumer<URL> sourceUrls, int ordinal, String[] fileExtensions) {
CombinedConfigSourceProvider(Consumer<URL> sourceUrls, int ordinal, String[] fileExtensions, List<String> locations) {
this.sourceUrls = sourceUrls;
this.ordinal = ordinal;
this.fileExtensions = fileExtensions;
this.locations = locations;
}

@Override
Expand All @@ -225,8 +234,7 @@ protected ConfigSource loadConfigSource(final URL url, final int ordinal) throws

@Override
public List<ConfigSource> getConfigSources(final ClassLoader classLoader) {
// Note:
return loadConfigSources(getFileExtensions(), ordinal, classLoader);
return loadConfigSources(locations.toArray(new String[0]), ordinal, classLoader);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@
import org.gradle.api.GradleException;
import org.gradle.api.file.FileCollection;
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.provider.ListProperty;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputFiles;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.PathSensitive;
import org.gradle.api.tasks.PathSensitivity;
import org.gradle.api.tasks.SourceSet;
import org.gradle.api.tasks.SourceSetContainer;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.options.Option;

import io.quarkus.bootstrap.BootstrapException;
import io.quarkus.bootstrap.app.AugmentAction;
Expand All @@ -36,6 +39,7 @@
public abstract class QuarkusRun extends QuarkusBuildTask {
private final Property<File> workingDirectory;
private final SourceSet mainSourceSet;
private final ListProperty<String> jvmArgs;

@Inject
public QuarkusRun() {
Expand All @@ -50,6 +54,8 @@ public QuarkusRun(String description) {

workingDirectory = objectFactory.property(File.class);
workingDirectory.convention(getProject().provider(() -> QuarkusPluginExtension.getLastFile(getCompilationOutput())));

jvmArgs = objectFactory.listProperty(String.class);
}

/**
Expand All @@ -75,6 +81,22 @@ public void setWorkingDir(String workingDir) {
workingDirectory.set(getProject().file(workingDir));
}

@Input
public ListProperty<String> getJvmArguments() {
return jvmArgs;
}

@Internal
public List<String> getJvmArgs() {
return jvmArgs.get();
}

@SuppressWarnings("unused")
@Option(description = "Set JVM arguments", option = "jvm-args")
public void setJvmArgs(List<String> jvmArgs) {
this.jvmArgs.set(jvmArgs);
}

@TaskAction
public void runQuarkus() {
ApplicationModel appModel = resolveAppModelForBuild();
Expand Down Expand Up @@ -122,6 +144,10 @@ public void accept(Map<String, List> cmds) {
throw new RuntimeException("Should never reach this!");
}
List<String> args = (List<String>) cmd.get(0);
if (getJvmArguments().isPresent() && !getJvmArguments().get().isEmpty()) {
args.addAll(1, getJvmArgs());
}

getProject().getLogger().info("Executing \"" + String.join(" ", args) + "\"");
Path wd = (Path) cmd.get(1);
File wdir = wd != null ? wd.toFile() : workingDirectory.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
import static org.hamcrest.CoreMatchers.containsString;

@QuarkusTest
public class LambdaHandlerTest {

class LambdaHandlerTest {
@Test
public void testSimpleLambdaSuccess() throws Exception {
void testSimpleLambdaSuccess() throws Exception {
// you test your lambdas by invoking on http://localhost:8081
// this works in dev mode too

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
public class FunqyIT extends FunqyTest {
class FunqyIT extends FunqyTest {

// Run the same tests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import static org.hamcrest.CoreMatchers.containsString;

@QuarkusTest
public class FunqyTest {

class FunqyTest {
@Test
public void testFunqyLambda() throws Exception {
void testFunqyLambda() throws Exception {
// you test your lambdas by invoking on http://localhost:8081
// this works in dev mode too

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(value = FunctionType.FUNQY_CLOUD_EVENTS, functionName = "helloCloudEvent")
class GreetingFunctionsCloudEventsTest {
@Test
public void testHelloCloudEvent() {
void testHelloCloudEvent() {
given()
.body("{\n" +
" \"bucket\": \"MY_BUCKET\",\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(value = FunctionType.FUNQY_BACKGROUND, functionName = "helloPubSubWorld")
class GreetingFunctionsPubSubTest {
@Test
public void testHelloPubSubWorld() {
void testHelloPubSubWorld() {
given()
.body("{\"data\":{\"data\":\"world\"}}")
.when()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(value = FunctionType.FUNQY_BACKGROUND, functionName = "helloGCSWorld")
class GreetingFunctionsStorageTest {
@Test
public void testHelloGCSWorld() {
void testHelloGCSWorld() {
given()
.body("{\"data\":{\"name\":\"hello.txt\"}}")
.when()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
public class FunqyIT extends FunqyTest {
class FunqyIT extends FunqyTest {

// Run the same tests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
import static org.hamcrest.Matchers.notNullValue;

@QuarkusTest
public class FunqyTest {

class FunqyTest {
@Test
public void testCloudEvent() {
void testCloudEvent() {
RestAssured.given().contentType("application/json")
.header("ce-specversion", "1.0")
.header("ce-id", UUID.randomUUID().toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(FunctionType.BACKGROUND)
class HelloWorldBackgroundFunctionTest {
@Test
public void testAccept() {
void testAccept() {
given()
.body("{\"data\":{\"name\":\"hello.txt\"}}")
.when()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(FunctionType.CLOUD_EVENTS)
class HelloWorldCloudEventsFunctionTest {
@Test
public void testAccept() {
void testAccept() {
given()
.body("{\n" +
" \"bucket\": \"MY_BUCKET\",\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@WithFunction(FunctionType.HTTP)
class HelloWorldHttpFunctionTest {
@Test
public void testService() {
void testService() {
when()
.get()
.then()
Expand Down
Loading

0 comments on commit d9e5e53

Please sign in to comment.