[
http://jira.codehaus.org/browse/MJAVACC-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_110871
]
Benjamin Bentmann commented on MJAVACC-30:
------------------------------------------
Oh, I see, that might as well be the reason why the timestamp directory was
introduced in the first place ...
Nevertheless, I still consider checking timestamps against the generated java
files a useful feature (not to mention that this was the default behavior of
the corresponding Ant task). For the moment, all that seems to be needed is
some hint for the plugin which usage scenario applies. What about a simple
boolean configuration parameter that would do the switch, i.e. tell the plugin
that the directory structure for the grammar files matches the final package
structure and enable it to use the java files for timestamp checking?
In theory, there should also be a way to avoid both the timestamp directory and
some additional parameter like sketched above. The plugin knows fairly well
where javacc stores the output files so telling the location of an output file
for a given grammar file is no magic. All that causes troubles is the
combination of StaleSourceScanner and SuffixMapping that is not quite up the
job. Maybe we can just use a customized SourceMapping and all would be fine. I
will investigate this possibility.
> Use generated Java files themselves for stale source detection
> --------------------------------------------------------------
>
> Key: MJAVACC-30
> URL: http://jira.codehaus.org/browse/MJAVACC-30
> Project: Maven 2.x JavaCC Plugin
> Issue Type: Improvement
> Affects Versions: 2.2
> Environment: Maven 2.0.7, JDK 1.5.0_12, WinXP
> Reporter: Benjamin Bentmann
> Priority: Minor
>
> If I understand the StaleSourceScanner correctly, the parameter
> timestampDirectory should be unnecessary. The same effect of output
> generation only upon modified/updated grammar files could be achieved by
> comparing the timestamps of the grammar files against the timestamps of the
> java files (and not copies of the grammar files). The required code changes
> should be minimal, i.e. simply change lines like {code}SuffixMapping mapping
> = new SuffixMapping( ".jj", ".jj" );{code} to {code}SuffixMapping mapping =
> new SuffixMapping( ".jj", ".java" );{code} and pass the (base) output
> directory rather than the timestamp directory into computeStaleGrammars().
> The proposed change should yield the same conditional output generation for
> the use case where the output directory is set to something under
> ${basedir}/target. However, it should perform better for such use cases where
> the java files are generated into a non-temporary/version-controlled
> directory like ${basedir}/src/main/java. Currently, a "mvn clean
> generate-sources" will always trigger the generation of output regardless
> whether necessary or not because the timestamp files do not exist (any more).
> Taking the output files for the timestamp test should avoid this unwanted
> effect.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email