[
http://jira.codehaus.org/browse/MJAVACC-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_117403
]
Benjamin Bentmann commented on MJAVACC-30:
------------------------------------------
bq. Unfortunately, Plexus' SourceMapping does not offer a method like
getTargetFiles( File targetDir, File sourceDir, String source ) so my current
solution is not really pretty.
Some time ago I created a feature request for this (PLXCOMP-85).
> 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
> Attachments: stale-source-scanner.patch
>
>
> 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