X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=src%2Forg%2Fargeo%2Fbuild%2FMake.java;h=af624060d66eb9d95d1f26cd518e44442584843d;hb=fcb10e7247b6eb7cbd2dbd9b49e029596ba5436a;hp=9c57abe15c47e604005e70752c6c0e23c76ac7ed;hpb=c3db42061f64ac832ef7b9a86b01b6f1b04c2601;p=cc0%2Fargeo-build.git diff --git a/src/org/argeo/build/Make.java b/src/org/argeo/build/Make.java index 9c57abe..af62406 100644 --- a/src/org/argeo/build/Make.java +++ b/src/org/argeo/build/Make.java @@ -3,6 +3,7 @@ package org.argeo.build; import static java.lang.System.Logger.Level.DEBUG; import static java.lang.System.Logger.Level.ERROR; import static java.lang.System.Logger.Level.INFO; +import static java.lang.System.Logger.Level.TRACE; import static java.lang.System.Logger.Level.WARNING; import java.io.File; @@ -226,7 +227,8 @@ public class Make { } // sources - for (String bundle : bundles) { + boolean atLeastOneBundleToCompile = false; + bundles: for (String bundle : bundles) { StringBuilder sb = new StringBuilder(); Path bundlePath = execDirectory.resolve(bundle); if (!Files.exists(bundlePath)) { @@ -237,15 +239,24 @@ public class Make { } else throw new IllegalArgumentException("Bundle " + bundle + " not found in " + execDirectory); } - sb.append(bundlePath.resolve("src")); + Path bundleSrc = bundlePath.resolve("src"); + if (!Files.exists(bundleSrc)) { + logger.log(TRACE, bundleSrc + " does not exist, skipping it, as this is not a Java bundle"); + continue bundles; + } + sb.append(bundleSrc); sb.append("[-d"); compilerArgs.add(sb.toString()); sb = new StringBuilder(); sb.append(buildBase.resolve(bundle).resolve("bin")); sb.append("]"); compilerArgs.add(sb.toString()); + atLeastOneBundleToCompile = true; } + if (!atLeastOneBundleToCompile) + return; + if (logger.isLoggable(INFO)) compilerArgs.add("-time"); @@ -508,15 +519,20 @@ public class Make { // Add all resources from src/ Files.walkFileTree(srcP, new SimpleFileVisitor() { + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { + // skip directories ending with .js + // TODO find something more robust? + if (dir.getFileName().toString().endsWith(".js")) + return FileVisitResult.SKIP_SUBTREE; + return super.preVisitDirectory(dir, attrs); + } + @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (file.getFileName().toString().endsWith(".java") || file.getFileName().toString().endsWith(".class")) return FileVisitResult.CONTINUE; - // skip directories ending with .js - // TODO find something more robust? - if (Files.isDirectory(file) && file.getFileName().endsWith(".js")) - return FileVisitResult.SKIP_SUBTREE; jarOut.putNextEntry(new JarEntry(srcP.relativize(file).toString())); if (!Files.isDirectory(file)) Files.copy(file, jarOut);