Author: tchemit Date: 2009-10-10 17:17:52 +0200 (Sat, 10 Oct 2009) New Revision: 1659 Modified: trunk/src/main/java/org/nuiton/license/plugin/UpdateHeaderPlugin.java Log: update documentation + improve plugin logs Modified: trunk/src/main/java/org/nuiton/license/plugin/UpdateHeaderPlugin.java =================================================================== --- trunk/src/main/java/org/nuiton/license/plugin/UpdateHeaderPlugin.java 2009-10-10 14:45:22 UTC (rev 1658) +++ trunk/src/main/java/org/nuiton/license/plugin/UpdateHeaderPlugin.java 2009-10-10 15:17:52 UTC (rev 1659) @@ -295,18 +295,15 @@ getFilesToTreateForRoots(in, ex, compileSourceRoots, filesToTreate, null); getFilesToTreateForRoots(in, ex, testCompileSourceRoots, filesToTreate, null); - boolean doGenerate = !filesToTreate.isEmpty(); + if (!filesToTreate.isEmpty()) { - - if (doGenerate) { - File templateFile = new File(template); // verifie que la template existe (dans le class-path ou en tant que fichier) checkResource(templateFile); // recuperation de la license a utiliser - LicenseRepository factory = LicenseRepositoryFactory.newLicenseRepository(true,true,licenseResolver); + LicenseRepository factory = LicenseRepositoryFactory.newLicenseRepository(true, true, licenseResolver); License license = factory.getLicense(licenseName); if (verbose) { @@ -319,13 +316,15 @@ // build the comment boxed header content boxedLicenseHeaderContent = generator.getHeader(licenseHeaderContent); - getLog().info("config - header to use\n" + boxedLicenseHeaderContent); + if (verbose) { + getLog().info("config - header to use\n" + boxedLicenseHeaderContent); + } } else { getLog().info("no file to treate."); } - return doGenerate; + return true; } @Override @@ -335,6 +334,11 @@ return; } + if (filesToTreate.isEmpty()) { + getLog().info("No file to treate."); + return; + } + // create a licence processor with given header LicenseProcessor p = new LicenseProcessor(licenseHeaderContent);