def tzjs_dump_dependencies(env, options, input_js): """ Lists all the dependencies of the .js file. We attempt to retain some kind of order with the leaves of the dependency tree at the top of the list. """ # The set of files to be injected injects = inject_js_from_options(options) LOG.info("files to inject:") _ = [ LOG.info(" - %s" % i) for i in injects ] # Do a full parse with a correct context, and extract the # javascript includes context = context_from_options(options, input_js[0]) deps = render_js_extract_includes(context, options, env_load_templates(env, input_js), injects) # TODO : Do we need this find_dependencies stage? It doesn't pick # up any javascript tags. for i in input_js: deps += find_dependencies(i, options.templatedirs, env) # Write dependency data # LOG.info("deps are: %s" % deps) output_dependency_info(options.dependency_file, options.output, deps) return 0
try: deps = find_dependencies(input_html[0], options.templatedirs, env, [ 'default' ]) except Exception, e: raise ToolsException("dependency error: %s" % str(e)) else: deps = [] # Collect js dependencies if necessary if options.mode in [ 'plugin-debug', 'canvas-debug' ]: deps += [ find_file_in_dirs(js, options.templatedirs) for js in input_js ] # Write dependency info output_dependency_info(outfile_name, options.output, deps) return 0 def html_generate(env, options, input_js, input_html): """ Generate html based on the templates and build mode. """ # - dev, canvas_dev: # render top-level js files into a temporary file # collect the .js files that need to be included # setup includes, startup code and the js render result into variables # render html template # # - release, canvas:
['default']) except Exception, e: raise ToolsException("dependency error: %s" % str(e)) else: deps = [] # Collect js dependencies if necessary if options.mode in ['plugin-debug', 'canvas-debug']: deps += [ find_file_in_dirs(js, options.templatedirs) for js in input_js ] # Write dependency info output_dependency_info(outfile_name, options.output, deps) return 0 def html_generate(env, options, input_js, input_html): """ Generate html based on the templates and build mode. """ # - dev, canvas_dev: # render top-level js files into a temporary file # collect the .js files that need to be included # setup includes, startup code and the js render result into variables # render html template #