Skip to content

Commit

Permalink
Merge pull request #97 from quarkiverse/dev-block-deps
Browse files Browse the repository at this point in the history
Dev block deps
  • Loading branch information
ia3andy authored Oct 12, 2023
2 parents b764cc8 + c2f3dee commit 8557e96
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 27 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
fail-fast: false
matrix:
# os: [windows-latest, macos-latest, ubuntu-latest]
os: [ubuntu-latest]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Prepare git
Expand All @@ -56,4 +56,5 @@ jobs:
run: mvn -B clean install -Dno-format

- name: Build with Maven (Native)
run: mvn -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip
run: mvn -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip
if: ${{ !startsWith(matrix.os, 'windows') }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.quarkiverse.web.bundler.deployment;

import java.io.File;
import static io.quarkiverse.web.bundler.deployment.util.PathUtils.toUnixPath;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.charset.Charset;
Expand Down Expand Up @@ -88,7 +89,7 @@ private void scanProject(Scanner scanner,
// a wrong directory bundleName on case-insensitive file systems
try {
final Path dirPath = rootDir.resolve(scanner.dir());
if (Files.isDirectory(dirPath) && dirPath.toString().endsWith(scanner.dir())) {
if (Files.isDirectory(dirPath) && toUnixPath(dirPath.toString()).endsWith(scanner.dir())) {
scan(rootDir, dirPath, scanner.pathMatcher(), scanner.charset, webAssetConsumer, true);
break;
}
Expand Down Expand Up @@ -118,14 +119,14 @@ private void scan(
&& filePath.getRoot() != null) {
filePath = filePath.getRoot().relativize(filePath);
}
final Path relativePath = directory.relativize(filePath);
final Path relativePath = toScan.relativize(filePath);
final PathMatcher assetsPathMatcher = relativePath.getFileSystem()
.getPathMatcher(pathMatcher);
final boolean isAsset = assetsPathMatcher.matches(relativePath);
if (isAsset) {
String assetPath = root.relativize(filePath).normalize().toString();
if (File.separatorChar != '/') {
assetPath = assetPath.replace(File.separatorChar, '/');
if (assetPath.contains("\\")) {
assetPath = toUnixPath(assetPath);
}
if (!assetPath.isEmpty()) {
webAssetConsumer.accept(toWebAsset(assetPath,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.quarkiverse.web.bundler.deployment;

import static io.quarkiverse.web.bundler.deployment.util.ConfiguredPaths.addTrailingSlash;
import static io.quarkiverse.web.bundler.deployment.util.PathUtils.addTrailingSlash;

import java.io.IOException;
import java.nio.file.Files;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.quarkiverse.web.bundler.deployment;

import static io.quarkiverse.web.bundler.deployment.util.ConfiguredPaths.addTrailingSlash;
import static io.quarkiverse.web.bundler.deployment.util.ConfiguredPaths.removeLeadingSlash;
import static io.quarkiverse.web.bundler.deployment.util.PathUtils.addTrailingSlash;
import static io.quarkiverse.web.bundler.deployment.util.PathUtils.removeLeadingSlash;
import static java.util.function.Predicate.not;

import java.nio.charset.Charset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import static io.quarkiverse.web.bundler.deployment.ProjectResourcesScanner.readTemplateContent;
import static io.quarkiverse.web.bundler.deployment.items.BundleWebAsset.BundleType.MANUAL;
import static io.quarkiverse.web.bundler.deployment.util.ConfiguredPaths.prefixWithSlash;
import static io.quarkiverse.web.bundler.deployment.util.ConfiguredPaths.surroundWithSlashes;
import static io.quarkiverse.web.bundler.deployment.util.PathUtils.prefixWithSlash;
import static io.quarkiverse.web.bundler.deployment.util.PathUtils.surroundWithSlashes;
import static io.quarkiverse.web.bundler.runtime.qute.WebBundlerQuteContextRecorder.WEB_BUNDLER_ID_PREFIX;
import static io.quarkus.deployment.annotations.ExecutionTime.STATIC_INIT;
import static java.util.Map.entry;
Expand Down Expand Up @@ -58,7 +58,6 @@
import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
import io.quarkus.arc.deployment.SyntheticBeanBuildItem;
import io.quarkus.builder.BuildException;
import io.quarkus.deployment.IsNormal;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.Record;
Expand Down Expand Up @@ -372,7 +371,7 @@ void initBundler(
additionalBeans.produce(new AdditionalBeanBuildItem(Bundle.class));
}

@BuildStep(onlyIf = IsNormal.class)
@BuildStep
@Record(STATIC_INIT)
void webDepBlocker(WebBundlerConfig config, BuildProducer<RouteBuildItem> routes, WebDependenciesBlockerRecorder recorder) {
if (!config.dependencies().serve()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import java.util.List;
import java.util.Set;

import org.jboss.logging.Logger;

import io.quarkus.bootstrap.workspace.ArtifactSources;
import io.quarkus.bootstrap.workspace.SourceDir;
import io.quarkus.deployment.annotations.BuildProducer;
Expand All @@ -26,6 +28,7 @@
import io.quarkus.vertx.http.deployment.spi.AdditionalStaticResourceBuildItem;

public class GeneratedStaticResourcesProcessor {
private static final Logger LOGGER = Logger.getLogger(GeneratedStaticResourcesProcessor.class);

@BuildStep
public void processStaticFiles(
Expand Down Expand Up @@ -106,6 +109,11 @@ public static File getBuildDirectory(CurateOutcomeBuildItem curateOutcomeBuildIt
// pick the first resources output dir
Path resourcesOutputDir = srcDirs.iterator().next().getOutputDir();
buildDir = resourcesOutputDir.toFile();
if (srcDirs.size() > 1) {
LOGGER.warnf("Multiple resources directories found, using the first one in the list: %s",
resourcesOutputDir);
}

}
}
if (buildDir == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package io.quarkiverse.web.bundler.deployment.util;

public final class ConfiguredPaths {
public final class PathUtils {

public static String toUnixPath(String path) {
return path.replaceAll("\\\\", "/");
}

public static String prefixWithSlash(String path) {
return path.startsWith("/") ? path : "/" + path;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.quarkiverse.web.bundler.deployment.util;

import static io.quarkiverse.web.bundler.deployment.util.ConfiguredPaths.addTrailingSlash;
import static io.quarkiverse.web.bundler.deployment.util.ConfiguredPaths.prefixWithSlash;
import static io.quarkiverse.web.bundler.deployment.util.ConfiguredPaths.removeLeadingSlash;
import static io.quarkiverse.web.bundler.deployment.util.ConfiguredPaths.removeTrailingSlash;
import static io.quarkiverse.web.bundler.deployment.util.PathUtils.addTrailingSlash;
import static io.quarkiverse.web.bundler.deployment.util.PathUtils.prefixWithSlash;
import static io.quarkiverse.web.bundler.deployment.util.PathUtils.removeLeadingSlash;
import static io.quarkiverse.web.bundler.deployment.util.PathUtils.removeTrailingSlash;
import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkiverse.quinoa</groupId>
<artifactId>quarkus-quinoa-testing</artifactId>
<version>2.1.0</version>
<groupId>io.quarkiverse.playwright</groupId>
<artifactId>quarkus-playwright</artifactId>
<version>0.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
import com.microsoft.playwright.Response;
import com.microsoft.playwright.assertions.PlaywrightAssertions;

import io.quarkiverse.quinoa.testing.QuarkusPlaywrightManager;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkiverse.playwright.InjectPlaywright;
import io.quarkiverse.playwright.WithPlaywright;
import io.quarkus.test.common.http.TestHTTPResource;
import io.quarkus.test.junit.QuarkusTest;

@QuarkusTest
@QuarkusTestResource(QuarkusPlaywrightManager.class)
@WithPlaywright
public class WebTest {
@QuarkusPlaywrightManager.InjectPlaywright
@InjectPlaywright
BrowserContext context;

@TestHTTPResource("/")
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.version>3.1.3.Final</quarkus.version>

<esbuild-java.version>1.0.4</esbuild-java.version>
<esbuild-java.version>1.0.5</esbuild-java.version>
<scrimage-core.version>4.1.1</scrimage-core.version>
<yuicompressor.version>2.4.8</yuicompressor.version>
</properties>
Expand Down

0 comments on commit 8557e96

Please sign in to comment.