Skip to content

Commit

Permalink
Update esbuild-java
Browse files Browse the repository at this point in the history
  • Loading branch information
ia3andy committed Oct 12, 2023
1 parent 250bf4b commit c2f3dee
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
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 c2f3dee

Please sign in to comment.