gwt /
gwt /
13c52d1a8bcb9b5b73939edebe91f7fa76fa721e The currently implementation of resource generation is kind of borked. If you attempt to generate a file that exists on the public path, the generated file will "win" in the compiler output folder. However, the shell servlet will always serve the version off of the public path, creating an inconsistency. Another problem with the current system is that files from a previous compilation sitting in the output folder will actually prevent a generator from creating new files.
This patch implements the following proposal:
1) Attempting to generate a resource that's already on the public path fails (null return from tryCreateResource) with a warning.
2) The first generator that attempts to generate a resource during a given compilation will have the opportunity to do so. Any subsequent attempts to generate that resource fail (null return from tryCreateResource) with no warning.
3) A generated file clobbers a file sitting in the output folder.
Notes:
- I added the list of "files generated during this compilation" to CacheManager, since it maintains persistent state and gets a notice when a new compilation is starting.
- I needed a way to pass information about the public files available in the module, so I created a PublicOracle, implemented by ModuleDef, and pass that into the rebind system.
- StandardGeneratorContext would be a cleaner diff if I hadn't renamed the "name" parameter to "partialPath" for consistency with other usages.
- StandardGeneratorContextTest: two of the tests were no longer valid.
Suggested by: jat, bruce
Review by: mmendez
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1628 8db76d5a-ed1c-0410-87a9-c151d255dfc7
8 files changed