jberkel / android-plugin

An sbt plugin for Android development in Scala
https://groups.google.com/forum/#!forum/scala-on-android
Other
476 stars 113 forks source link

new layouts do not get noticed until sbt restart #100

Closed mlc closed 12 years ago

mlc commented 13 years ago

I'm using the TypedResources functionality in developing an application, and I noticed that while I leave an sbt console open, then the generate-typed-resources task (and tasks like compile that depend on it) will not notice new layout XML files. The workaround is to quit and restart sbt, but it actually took me some time to figure this out.

jberkel commented 12 years ago

any ideas @aslakjo ?

aslakjo commented 12 years ago

I am able to see the same issue on my project. Maybe we need to refresh some of the underlying structures. @mlc or any one, feel free to try out some solution if you like to. I hope to look into it over the christmas holidays.

aslakjo commented 12 years ago

It seems that both mainResPath and layoutPath was of type SettingKey which only is initialized at startup. I have changed both to TaskKey, which is updated for every use.

@mlc are you able to verify that my branch works for you? https://github.com/aslakjo/android-plugin/tree/fix_%23100

mlc commented 12 years ago

I'm far from being any sort of sbt expert, but @aslakjo's solution seems to work as far as I can tell.

Thanks!