cheers!
jesse
On 1/6/06, Jens Zastrow <[EMAIL PROTECTED]> wrote:
The same Problem with the javacc-plugin
-----Original Message-----
From: Jens Zastrow [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 06, 2006 4:25 PM
To: [email protected]; [email protected]
Subject: [mojo-dev] [sablecc] stale grammar detection does not work for
grammers in packages
My grammer resides in src/main/sablecc/a/b/c/X.grammar and will be
copied to the target/ directory for stale detection.
This will not work correctly because the "StaleSourceScanner" will try
to match src/main/sablecc/a/b/c/X.grammar with target/a/b/c/X.grammar
which does not exist, on the next call.
FIX: create the correct package-structure in /target
[SableCCMojo]
// must create the same package-structure as the grammar
FileUtils.copyFileToDirectory(grammar, new
File(timestampDirectory));
private Set computeStaleGrammars() throws MojoExecutionException
{
SuffixMapping mapping = new SuffixMapping( ".grammar", ".grammar"
);
SourceInclusionScanner scanner = new StaleSourceScanner(
staleMillis );
scanner.addSourceMapping ( mapping );
File outDir = new File( timestampDirectory );
Set staleSources = new HashSet();
File sourceDir = new File( sourceDirectory );
try
{
staleSources.addAll ( scanner.getIncludedSources( sourceDir,
outDir ) );
}
catch ( InclusionScanException e )
{
throw new MojoExecutionException( "Error scanning source root:
\'" + sourceDir + "\' for stale grammars to reprocess.", e );
}
return staleSources;
}
--
jesse mcconnell
jesseDOTmcconnellATgmailDOTcom
