Skip to content

Commit

Permalink
config.kb support for extra_annotation_name compiler flag
Browse files Browse the repository at this point in the history
via extra_annotations yaml key
  • Loading branch information
kevmoo committed Jun 4, 2013
1 parent c0726b7 commit a710f08
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bin/kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_closure_roots(closure_path):
return [path.join(closure_path, p) for p in roots]


def get_compiler_flags(closure_path, debug=False, closure_entry_point=None, language_in=None):
def get_compiler_flags(closure_path, debug=False, closure_entry_point=None, language_in=None, extra_annotations=[]):
compilerflags = []
compilerflags += ["--compilation_level=ADVANCED_OPTIMIZATIONS"]
compilerflags += ["--summary_detail_level=3"]
Expand Down Expand Up @@ -82,6 +82,9 @@ def get_compiler_flags(closure_path, debug=False, closure_entry_point=None, lang
compilerflags += ['--closure_entry_point=%s' % closure_entry_point]
if language_in:
compilerflags += ['--language_in=%s' % language_in]
if any(extra_annotations):
for annotation in extra_annotations:
compilerflags += ['--extra_annotation_name=%s' % annotation]

# to eliminate errors about unfound closure dependencies
# http://groups.google.com/group/closure-compiler-discuss/msg/7d089cc101a2cf00?pli=1
Expand Down Expand Up @@ -170,12 +173,12 @@ def lint(fix_paths, fix_exclude_paths=[]):
return command


def compile(closure_path, js_paths, inputs, compile_path, externs=[], debug=False, closure_entry_point=None, language_in=None):
def compile(closure_path, js_paths, inputs, compile_path, externs=[], debug=False, closure_entry_point=None, language_in=None, extra_annotations=[]):
command = ['python', get_closurebuilder_path(closure_path)]
command += ['-o', 'compiled']
command += ['--compiler_jar', COMPILER_PATH]

for flag in get_compiler_flags(closure_path, debug, closure_entry_point, language_in):
for flag in get_compiler_flags(closure_path, debug, closure_entry_point, language_in, extra_annotations):
command += ['-f', flag]

for extern in externs:
Expand Down

0 comments on commit a710f08

Please sign in to comment.