Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Use Less4jProcessor & enable non m2eclipse incremental build support #1

Merged
merged 2 commits into from
Sep 23, 2013

Conversation

alexo
Copy link
Contributor

@alexo alexo commented Sep 23, 2013

No description provided.

@ArloL
Copy link
Owner

ArloL commented Sep 23, 2013

Thanks for the PR, alexo.

But I am having a hard time understanding why you took the time to do it. This is just a demo project for jbosstools/m2e-wro4j#17.

Or should I understand the PR as a "this is how you should do it"?

@alexo
Copy link
Contributor Author

alexo commented Sep 23, 2013

You mentioned in one of the issue description that plugin takes "forever". I just have changed the LessCss processor with Less4jProcessor to make it run faster and enabled a new feature which you could benefit from. Hopefully this will solve your problem. But I need some feeback.

Also, I have tried using ConfigurableWroManagerFactory in a separate branch but have found an issue which will be fixed in next release.

@ArloL
Copy link
Owner

ArloL commented Sep 23, 2013

I have switched to the Less4j processor which runs perfectly now. Thanks a million!!

I have not noticed any further differences when using incrementalBuildEnabled. I will start using it when I notice unnecessary builds being executed.

I am not a big fan of ConfigurableWroManagerFactory for two reasons:

If I understand correctly I would have to introduce a wro4j dependency into my webapp for de.evosec.wro4j.spi.DefaultConfigurableProvider.
I currently use a separate artifact for the factory and strategy where wro4j dependencies are marked as optional. I know I could use scope provided in my webapp but I think it's cleaner with a separate artifact.

Also I would have to use two additional property files which I believe to be unnecessary.

Speaking of unnecessary files: I would love to get rid of wro.xml and just use a configuration in my pom.

Thanks a million for your help and keep up the great work!

ArloL added a commit that referenced this pull request Sep 23, 2013
Use Less4jProcessor & enable non m2eclipse incremental build support
@ArloL ArloL merged commit 2b9e8ef into ArloL:master Sep 23, 2013
@alexo
Copy link
Contributor Author

alexo commented Sep 23, 2013

The incrementalBuildEnabled is useful when invoking maven plugin from the console. As result, the plugin won't process anything on subsequent execution unless the content is changed.

I prefer and recommend using ConfigurableWroManagerFactory because it allows you to configure wro4j in a non invasive way. All you have to do, is to update the configuration file (wro.properties) with aliases of various implementation to be considered during execution. The aliases are picked up dynamically from the classpath, so it is easy to create and use custom implementations of processors, locators, models, namingStrategy, cacheStrategy, etc... The custom ConfigurableProvider doesn't have to be inside the webapp. It can be part of the jar holding other wro4j customizations (processors, namingStrategy, etc). Also, you don't need two additional property files, but only one (wro.properties).
The only problem is that there is a bug (I have already fixed locally) which prevent custom provider to be loaded. After all, if you don't like the ConfigurableWroManagerFactory, you can use other existing one or create a custom one which loads processors, models or anything else in a way which is more suitable for your project. If you have any suggestions regarding how the customization could be improved, please let me know and we could make it available for the next release.

Getting rid of wro.xml is possible. It is being loaded by XmlModelFactory which is used as default WroModelFactory. To load model from a custom location or from a custom DSL, extend WroModelFactory and configure wro4j to use your custom model.

Thanks for your feedback,
Alex

@ArloL
Copy link
Owner

ArloL commented Sep 27, 2013

Actually incrementalBuildEnabled also affects my Eclipse. When I delete the created css file and add a newline to the less file no new css file is created. If I set incrementalBuildEnabled to false this works.

I will look into using the ConfigurableWroManagerFactory when the bug fix is released. This actually does sound very interesting!

Thanks for the hints. I might look into this.

@alexo
Copy link
Contributor Author

alexo commented Sep 27, 2013

Could you open an issue and describe the reproduction path?

@ArloL
Copy link
Owner

ArloL commented Sep 30, 2013

Yes, of course.

@ArloL
Copy link
Owner

ArloL commented Sep 30, 2013

I have created an issue: alexo/wro4j#153

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants