cquiroz / sbt-tzdb

sbt plugin to create custom timezone db files
BSD 3-Clause "New" or "Revised" License
8 stars 13 forks source link

Cache results of tzdbCodeGen task #135

Closed povder closed 2 years ago

povder commented 2 years ago

Cache results of tzdbCodeGen task, the same way it's done in sbt-locales.

Technically the cache should be evicted if any of the settings change but I think it's good enough to require a clean when settings change (the same way as it works in sbt-locales).

I made this change because without it the code is generated for every compile and that slows down app reload when watching sources. Another problem was that when IntelliJ's "build automatically on file save" option for BSP integration is enabled, the IDE went into an infinite loop. That doesn't happen anymore with this change.

Note that I also changed includeTTBP and jsOptimized task keys to be setting keys so that their values can be used in the anonymous function used for cache, I think it makes sense for them to be settings.

cquiroz commented 2 years ago

Thanks a lot, this will be useful