[
https://jira.codehaus.org/browse/MOJO-1785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=287995#comment-287995
]
Marcel Overdijk commented on MOJO-1785:
---------------------------------------
Did some testing as this only works for changes in top-level LESS files,
meaning if a import is changed no compilation will happen.
I think this is what Christopher was warning for.
I wasn't aware that the following code:
{code}
protected String[] getIncludedFiles()
{
Scanner scanner = buildContext.newScanner( sourceDirectory );
scanner.setIncludes( includes );
scanner.setExcludes( excludes );
scanner.scan();
return scanner.getIncludedFiles();
}
{code}
only returns the changed files (but off course makes sense).
This means that when an imported file is changed the scanner will only return
that one but it's not the includes list as only top-level LESS source are in
the includes.
I changed the code to:
{code}
protected String[] getIncludedFiles()
{
Scanner scanner = buildContext.newScanner( sourceDirectory, true );
..
}
{code}
which ignores the delta flag (true parameter) which causes the scanner to
return all top-level LESS sources instead.
The LESS Compiler is smart enough to find out if there are any changes so
performance wise I don't think there is an issue,
but I would like to hear your opinion.
Besides that I have also added
{code}
buildContext.addMessage( input, 0, 0, "Error compiling LESS source",
BuildContext.SEVERITY_ERROR, e);
{code}
In case of exceptions when compiling.
> lesscss-maven-plugin: provide m2e lifecycle-mapping
> ---------------------------------------------------
>
> Key: MOJO-1785
> URL: https://jira.codehaus.org/browse/MOJO-1785
> Project: Mojo
> Issue Type: New Feature
> Components: _General
> Environment: Eclipse
> Reporter: Alexis Li
> Assignee: Marcel Overdijk
> Attachments: lesscss-maven-plugin.zip, mojo1785-1.patch,
> mojo1785-2.patch, mojo1785.patch
>
>
> I use m2e to use Maven within Eclipse. This requires a little special support
> from plugins so that incremental build works properly. I'd like the
> lesscss-maven-plugin to add this support.
> The necessary changes are best documented here:
> http://wiki.eclipse.org/M2E_compatible_maven_plugins
> In short, META-INF/m2e/lifecycle-mapping-metadata.xml needs to be added and
> the plexus-build-api BuildContext used.
> I've attached some modifications which should get most of the way there,
> however I can't figure out how to fix the Mockito or integration tests sorry.
> Eclipse complains that "when( buildContext.newScanner( sourceDirectory )
> ).thenReturn( ... )" is ambiguous and it's not clear how to fix it. I tried
> some of the PowerMock extensions but they didn't work.
> If I ignore tests (and comment out the IT maven-invoker-plugin section) I can
> build a JAR but then when I try to use it my <execution> element complains
> with this error:
> Execution default of goal org.codehaus.mojo:lesscss-maven-plugin:
> 1.0-act-SNAPSHOT:compile failed. (org.codehaus.mojo:lesscss-
> maven-plugin:1.0-act-SNAPSHOT:compile:default:prepare-
> package)
> I don't know if this is relevant but generate-resources might be a more
> appropriate phase.
> To be clear, this feature is to add m2e support to lesscss-maven-plugin; the
> issues I describe above are solely by way of apology for not finishing the
> job.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.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