alexo / wro4j

New project location is:https://github.com/wro4j/wro4j
442 stars 110 forks source link

wro4j:run does not execute even though css file is missing #153

Closed ArloL closed 11 years ago

ArloL commented 11 years ago

Steps to reproduce:

The output even says: Nothing to process (nothing configured or nothing changed since last build.

Expected result:

It should create a new css file even though there were no changes.

alexo commented 11 years ago

Question: why would you delete the css folder from target? What is your use-case? If you want to trigger the build and ignore any change check use:

mvn clean wro4j:run
ArloL commented 11 years ago

It's not a real day-to-day use-case. More an unexpected behaviour.

It happened to me when I wanted to take a look at the final CSS file. But because there were many files I deleted all of them and ran again. And to my surprise there was no new CSS file.

alexo commented 11 years ago

As mentioned earlier, for this use-case, run: mvn clean wro4j:run Assuming this is an expected behavior (I don't really agree, but we can discuss this), what would you expect to happen if you manually modify the content of the generated css? Also, how does m2-wro4j behave for the similar use-case?

ArloL commented 11 years ago

On the command line I can see using mvn clean wro4j:run for that.

I was actually using Eclipse in combination with m2e-wro4j. I deleted the CSS files in the project explorer and "touched" [1] a less file to trigger m2e-wro4j. Running mvn clean in Eclipse would trigger a complete rebuild of my application which in my scenario can take up to 30 seconds. "Just" to look at a CSS file.

It's up to you to decide whether this is expected. I just thought it wasn't expected. Therefore I reported it. I now know that I would just have to add a newline - and not remove it again - to trigger the new build. I also understand that this scenario has a lots of "ifs" and "buts".

Interesting question. One could expect wro4j to save the last modified/created timestamp of the generated files. But I personally don't.

1: I added a newline, removed it, and saved.

alexo commented 11 years ago

The incremental build support checks only for changes (actual changes, not last modified date) inside resources which are part of the model. In your use-case, you don't modify the resource, but the generated css in the target folder. In order to make it aware about this, additional checks are required.

Don't get me wrong, it would be really nice to implement every possible feature. But there is a trade-off between usefulness of a feature and time required to implement it. At this point, I'm not convinced it worth it, but wouldn't say no to a contribution ;)

ArloL commented 11 years ago

That's perfectly understandable.

Sadly, I don't have time to implement the feature at the moment. So I will just close the issue for now.