Author: tchemit Date: 2010-01-24 22:31:26 +0100 (Sun, 24 Jan 2010) New Revision: 1683 Modified: trunk/src/main/java/org/nuiton/license/plugin/UpdateHeaderMojo.java Log: Anomalie #267: can not configure compileSourceRoots on update-header goal Modified: trunk/src/main/java/org/nuiton/license/plugin/UpdateHeaderMojo.java =================================================================== --- trunk/src/main/java/org/nuiton/license/plugin/UpdateHeaderMojo.java 2010-01-21 12:54:10 UTC (rev 1682) +++ trunk/src/main/java/org/nuiton/license/plugin/UpdateHeaderMojo.java 2010-01-24 21:31:26 UTC (rev 1683) @@ -138,21 +138,52 @@ */ protected String excludes; /** - * Repertoires des fichiers sources a traiter. + * Compile source directory roots to inspect. * + * Can use it a a comma separated string : + * + * <pre><compileSourceRoots>src/site,src.target/extra-site</compileSourceRoots> </pre> + * + * or a list : + * + * <pre> + * <compileSourceRoots> + * <root>src/site</root> </pre> + * <root>src/target/extra-site</root> </pre> + * </compileSourceRoots> + * </pre> + * + * <b>Note:</b> If not set, will use the build compile roots. + * * @parameter expression="${license.compileSourceRoots}" default-value="${project.compileSourceRoots}" * @required * @since 1.0.0 */ protected List<String> compileSourceRoots; /** - * Repertoires des fichiers sources de test a traiter. + * Test source directory roots to inspect. * - * @parameter expression="${license.testCompileSourceRoots}" default-value="${project.testCompileSourceRoots}" + * Can use it a a comma separated string : + * + * <pre><testSourceRoots>src/test1,src/test2</testSourceRoots> </pre> + * + * or a list : + * + * <pre> + * <testSourceRoots> + * <root>src/site</root> </pre> + * <root>src/target/extra-site</root> </pre> + * </testSourceRoots> + * </pre> + * + * <b>Note:</b> If not set, will use the build test roots. + * + * + * @parameter expression="${license.testSourceRoots}" default-value="${project.testCompileSourceRoots}" * @required * @since 1.0.0 */ - protected List<String> testCompileSourceRoots; + protected List<String> testSourceRoots; /** * Un resolver externe * @@ -259,6 +290,24 @@ return true; } + public void setCompileSourceRoots(String root) { + String[] roots = PluginHelper.splitAndTrim(root, ","); + setCompileSourceRoots(Arrays.asList(roots)); + } + + public void setCompileSourceRoots(List<String> compileSourceRoots) { + this.compileSourceRoots = compileSourceRoots; + } + + public void setTestSourceRoots(String root) { + String[] roots = PluginHelper.splitAndTrim(root, ","); + setTestSourceRoots(Arrays.asList(roots)); + } + + public void setTestSourceRoots(List<String> testSourceRoots) { + this.testSourceRoots = testSourceRoots; + } + @Override protected boolean checkSkip() { if (skipUpdateHeader) { @@ -289,6 +338,16 @@ Entry<String, HeaderGenerator> next = stringHeaderGeneratorEntry; getLog().info("config - available generator : " + next.getKey()); } + if (compileSourceRoots!=null) { + for (String root : compileSourceRoots) { + getLog().info("config - compile source root : " + root); + } + } + if (testSourceRoots!=null) { + for (String root : testSourceRoots) { + getLog().info("config - test source root : " + root); + } + } } if (!_generators.containsKey(generatorName.trim())) { @@ -302,9 +361,12 @@ String[] in = includes.split(","); String[] ex = excludes == null ? null : excludes.split(","); getFilesToTreateForRoots(in, ex, compileSourceRoots, filesToTreate, null); - getFilesToTreateForRoots(in, ex, testCompileSourceRoots, filesToTreate, null); + getFilesToTreateForRoots(in, ex, testSourceRoots, filesToTreate, null); if (filesToTreate.isEmpty()) { + if (verbose) { + getLog().info("No file to treate"); + } return; }
participants (1)
-
tchemit@users.nuiton.org