From: <jbo...@li...> - 2005-12-06 21:22:51
|
Author: rl...@jb... Date: 2005-12-06 16:22:46 -0500 (Tue, 06 Dec 2005) New Revision: 1717 Modified: trunk/labs/jbossbuild/projects/maven-plugins/javacc-maven-plugin/src/main/java/org/codehaus/mojo/javacc/JavaCCMojo.java Log: fixed the additional source directory being added Modified: trunk/labs/jbossbuild/projects/maven-plugins/javacc-maven-plugin/src/main/java/org/codehaus/mojo/javacc/JavaCCMojo.java =================================================================== --- trunk/labs/jbossbuild/projects/maven-plugins/javacc-maven-plugin/src/main/java/org/codehaus/mojo/javacc/JavaCCMojo.java 2005-12-06 20:03:01 UTC (rev 1716) +++ trunk/labs/jbossbuild/projects/maven-plugins/javacc-maven-plugin/src/main/java/org/codehaus/mojo/javacc/JavaCCMojo.java 2005-12-06 21:22:46 UTC (rev 1717) @@ -50,6 +50,11 @@ */ private Integer lookAhead; + /** + * @parameter expression="${ccFile}" + */ + private String ccFile; + /** * @parameter expression="${choiceAmbiguityCheck}" */ @@ -251,7 +256,6 @@ if ( project != null ) { project.addCompileSourceRoot( outputDirectory.getAbsolutePath() ); - project.addCompileSourceRoot( "C:\\projects\\maven-jboss-head\\jboss-head\\server\\target\\gensrc" ); } } @@ -383,6 +387,18 @@ private Set computeStaleGrammars() throws MojoExecutionException { + File outDir = new File( timestampDirectory ); + + Set staleSources = new HashSet(); + + File sourceDir = sourceDirectory ; + + if (ccFile != null) { + this.getLog().info("Generating java for single file: " + ccFile); + File grammarFile = new File(sourceDirectory + "/" + ccFile); + staleSources.add(grammarFile); + } else { + SuffixMapping mapping = new SuffixMapping( ".jj", ".jj" ); SuffixMapping mappingCAP = new SuffixMapping( ".JJ", ".JJ" ); @@ -391,12 +407,7 @@ scanner.addSourceMapping( mapping ); scanner.addSourceMapping( mappingCAP); - File outDir = new File( timestampDirectory ); - Set staleSources = new HashSet(); - - File sourceDir = sourceDirectory ; - try { staleSources.addAll( scanner.getIncludedSources( sourceDir, outDir ) ); @@ -405,10 +416,16 @@ { throw new MojoExecutionException( "Error scanning source root: \'" + sourceDir + "\' for stale grammars to reprocess.", e ); } - + } return staleSources; } + /** + * @return Returns the ccFile. + */ + public String getCcFile() { + return ccFile; + } } |