Add js.py/strings.py as deps to JS modules.

If either python file changes, we may need to change the compiled JS
files. We'll take the conservative approach and always rebuild.
This commit is contained in:
Max Goodman
2012-10-29 19:20:54 -07:00
parent 261583095f
commit 4e24bff045
2 changed files with 7 additions and 1 deletions

View File

@@ -189,7 +189,7 @@ clean_css:
js: $(STATIC_BUILDSTAMP) $(JS_OUTPUTS)
define JS_MODULE_TEMPLATE
$(JS_MODULE_OUTPUTS_$(1)): $(JS_MODULE_DEPS_$(1))
$(JS_MODULE_OUTPUTS_$(1)): $(JS_MODULE_DEPS_$(1)) r2/lib/js.py
# remove mangled output symlinks, similar to above.
rm -f $(JS_MODULE_OUTPUTS_$(1))
paster run standalone r2/lib/js.py -c "build_module('$(1)')"

View File

@@ -36,6 +36,7 @@ try:
except ImportError:
STATIC_ROOT = None
else:
REDDIT_ROOT = config["pylons.paths"]["root"]
STATIC_ROOT = config["pylons.paths"]["static_files"]
# STATIC_ROOT will be None if pylons is uninitialized
@@ -285,6 +286,11 @@ class LocalizedModule(Module):
url = LocalizedModule.languagize_path(self.name, langs[0])
return script_tag.format(src=static(url))
@property
def dependencies(self):
return (super(LocalizedModule, self).dependencies
+ [os.path.join(REDDIT_ROOT, "lib/strings.py")])
@property
def outputs(self):
for lang, unused in iter_langs():