X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=src%2Forg%2Fargeo%2Fbuild%2FMake.java;h=af624060d66eb9d95d1f26cd518e44442584843d;hb=fcb10e7247b6eb7cbd2dbd9b49e029596ba5436a;hp=8e872dcb61af818ea71946b4369197eaf6e7ddc4;hpb=199fe0d1ffe514f49629b64dd0c7669da752beae;p=cc0%2Fargeo-build.git diff --git a/src/org/argeo/build/Make.java b/src/org/argeo/build/Make.java index 8e872dc..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,6 +519,15 @@ 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") @@ -518,16 +538,6 @@ public class Make { Files.copy(file, jarOut); return FileVisitResult.CONTINUE; } - - @Override - public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { - // skip directories ending with .js - // TODO find something more robust? - if (dir.getFileName().endsWith(".js")) - return FileVisitResult.SKIP_SUBTREE; - return super.preVisitDirectory(dir, attrs); - } - }); // add legal notices and licenses