<s> """<STR_LIT>""" <EOL> import gyp . common <EOL> import gyp . ninja_syntax as ninja_syntax <EOL> import json <EOL> import os <EOL> import posixpath <EOL> import sys <EOL> debug = False <EOL> found_dependency_string = '<STR_LIT>' <EOL> no_dependency_string = '<STR_LIT>' <EOL> all_changed_string = '<STR_LIT>' <EOL> MATCH_STATUS_MATCHES = <NUM_LIT:1> <EOL> MATCH_STATUS_MATCHES_BY_DEPENDENCY = <NUM_LIT:2> <EOL> MATCH_STATUS_DOESNT_MATCH = <NUM_LIT:3> <EOL> MATCH_STATUS_TBD = <NUM_LIT:4> <EOL> generator_supports_multiple_toolsets = gyp . common . CrossCompileRequested ( ) <EOL> generator_wants_static_library_dependencies_adjusted = False <EOL> generator_default_variables = { <EOL> } <EOL> for dirname in [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ] : <EOL> generator_default_variables [ dirname ] = '<STR_LIT>' <EOL> for unused in [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ] : <EOL> generator_default_variables [ unused ] = '<STR_LIT>' <EOL> def _ToGypPath ( path ) : <EOL> """<STR_LIT>""" <EOL> if os . sep == '<STR_LIT:\\>' and os . altsep == '<STR_LIT:/>' : <EOL> return path . replace ( '<STR_LIT:\\>' , '<STR_LIT:/>' ) <EOL> return path <EOL> def _ResolveParent ( path , base_path_components ) : <EOL> """<STR_LIT>""" <EOL> depth = <NUM_LIT:0> <EOL> while path . startswith ( '<STR_LIT>' ) : <EOL> depth += <NUM_LIT:1> <EOL> path = path [ <NUM_LIT:3> : ] <EOL> if depth > len ( base_path_components ) : <EOL> return '<STR_LIT>' <EOL> if depth == len ( base_path_components ) : <EOL> return path <EOL> return '<STR_LIT:/>' . join ( base_path_components [ <NUM_LIT:0> : len ( base_path_components ) - depth ] ) + '<STR_LIT:/>' + path <EOL> def _AddSources ( sources , base_path , base_path_components , result ) : <EOL> """<STR_LIT>""" <EOL> for source in sources : <EOL> if not len ( source ) or source . startswith ( '<STR_LIT>' ) or source . startswith ( '<STR_LIT:$>' ) : <EOL> continue <EOL> org_source = source <EOL> source = source [ <NUM_LIT:0> ] + source [ <NUM_LIT:1> : ] . replace ( '<STR_LIT>' , '<STR_LIT:/>' ) <EOL> if source . startswith ( '<STR_LIT>' ) : <EOL> source = _ResolveParent ( source , base_path_components ) <EOL> if len ( source ) : <EOL> result . append ( source ) <EOL> continue <EOL> result . append ( base_path + source ) <EOL> if debug : <EOL> print '<STR_LIT>' , org_source , result [ len ( result ) - <NUM_LIT:1> ] <EOL> def _ExtractSourcesFromAction ( action , base_path , base_path_components , <EOL> results ) : <EOL> if '<STR_LIT>' in action : <EOL> _AddSources ( action [ '<STR_LIT>' ] , base_path , base_path_components , results ) <EOL> def _ToLocalPath ( toplevel_dir , path ) : <EOL> """<STR_LIT>""" <EOL> if path == toplevel_dir : <EOL> return '<STR_LIT>' <EOL> if path . startswith ( toplevel_dir + '<STR_LIT:/>' ) : <EOL> return path [ len ( toplevel_dir ) + len ( '<STR_LIT:/>' ) : ] <EOL> return path <EOL> def _ExtractSources ( target , target_dict , toplevel_dir ) : <EOL> base_path = posixpath . dirname ( _ToLocalPath ( toplevel_dir , _ToGypPath ( target ) ) ) <EOL> base_path_components = base_path . split ( '<STR_LIT:/>' ) <EOL> if len ( base_path ) : <EOL> base_path += '<STR_LIT:/>' <EOL> if debug : <EOL> print '<STR_LIT>' , target , base_path <EOL> results = [ ] <EOL> if '<STR_LIT>' in target_dict : <EOL> _AddSources ( target_dict [ '<STR_LIT>' ] , base_path , base_path_components , <EOL> results ) <EOL> if '<STR_LIT>' in target_dict : <EOL> for action in target_dict [ '<STR_LIT>' ] : <EOL> _ExtractSourcesFromAction ( action , base_path , base_path_components , <EOL> results ) <EOL> if '<STR_LIT>' in target_dict : <EOL> for rule in target_dict [ '<STR_LIT>' ] : <EOL> _ExtractSourcesFromAction ( rule , base_path , base_path_components , results ) <EOL> return results <EOL> class Target ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , name ) : <EOL> self . deps = set ( ) <EOL> self . match_status = MATCH_STATUS_TBD <EOL> self . back_deps = set ( ) <EOL> self . name = name <EOL> self . visited = False <EOL> self . requires_build = False <EOL> self . added_to_compile_targets = False <EOL> self . in_roots = False <EOL> self . is_executable = False <EOL> self . is_static_library = False <EOL> self . is_or_has_linked_ancestor = False <EOL> class Config ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . files = [ ] <EOL> self . targets = set ( ) <EOL> self . additional_compile_target_names = set ( ) <EOL> self . test_target_names = set ( ) <EOL> def Init ( self , params ) : <EOL> """<STR_LIT>""" <EOL> generator_flags = params . get ( '<STR_LIT>' , { } ) <EOL> config_path = generator_flags . get ( '<STR_LIT>' , None ) <EOL> if not config_path : <EOL> return <EOL> try : <EOL> f = open ( config_path , '<STR_LIT:r>' ) <EOL> config = json . load ( f ) <EOL> f . close ( ) <EOL> except IOError : <EOL> raise Exception ( '<STR_LIT>' + config_path ) <EOL> except ValueError as e : <EOL> raise Exception ( '<STR_LIT>' + config_path + str ( e ) ) <EOL> if not isinstance ( config , dict ) : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> self . files = config . get ( '<STR_LIT>' , [ ] ) <EOL> self . additional_compile_target_names = set ( <EOL> config . get ( '<STR_LIT>' , [ ] ) ) <EOL> self . test_target_names = set ( config . get ( '<STR_LIT>' , [ ] ) ) <EOL> def _WasBuildFileModified ( build_file , data , files , toplevel_dir ) : <EOL> """<STR_LIT>""" <EOL> if _ToLocalPath ( toplevel_dir , _ToGypPath ( build_file ) ) in files : <EOL> if debug : <EOL> print '<STR_LIT>' , build_file <EOL> return True <EOL> if len ( data [ build_file ] [ '<STR_LIT>' ] ) <= <NUM_LIT:1> : <EOL> return False <EOL> for include_file in data [ build_file ] [ '<STR_LIT>' ] [ <NUM_LIT:1> : ] : <EOL> rel_include_file = _ToGypPath ( gyp . common . UnrelativePath ( include_file , build_file ) ) <EOL> if _ToLocalPath ( toplevel_dir , rel_include_file ) in files : <EOL> if debug : <EOL> print '<STR_LIT>' , build_file , '<STR_LIT>' , rel_include_file <EOL> return True <EOL> return False <EOL> def _GetOrCreateTargetByName ( targets , target_name ) : <EOL> """<STR_LIT>""" <EOL> if target_name in targets : <EOL> return False , targets [ target_name ] <EOL> target = Target ( target_name ) <EOL> targets [ target_name ] = target <EOL> return True , target <EOL> def _DoesTargetTypeRequireBuild ( target_dict ) : <EOL> """<STR_LIT>""" <EOL> return bool ( target_dict [ '<STR_LIT:type>' ] != '<STR_LIT:none>' or <EOL> target_dict . get ( '<STR_LIT>' ) or target_dict . get ( '<STR_LIT>' ) ) <EOL> def _GenerateTargets ( data , target_list , target_dicts , toplevel_dir , files , <EOL> build_files ) : <EOL> """<STR_LIT>""" <EOL> name_to_target = { } <EOL> matching_targets = [ ] <EOL> targets_to_visit = target_list [ : ] <EOL> build_file_in_files = { } <EOL> roots = set ( ) <EOL> build_file_targets = set ( ) <EOL> while len ( targets_to_visit ) > <NUM_LIT:0> : <EOL> target_name = targets_to_visit . pop ( ) <EOL> created_target , target = _GetOrCreateTargetByName ( name_to_target , <EOL> target_name ) <EOL> if created_target : <EOL> roots . add ( target ) <EOL> elif target . visited : <EOL> continue <EOL> target . visited = True <EOL> target . requires_build = _DoesTargetTypeRequireBuild ( <EOL> target_dicts [ target_name ] ) <EOL> target_type = target_dicts [ target_name ] [ '<STR_LIT:type>' ] <EOL> target . is_executable = target_type == '<STR_LIT>' <EOL> target . is_static_library = target_type == '<STR_LIT>' <EOL> target . is_or_has_linked_ancestor = ( target_type == '<STR_LIT>' or <EOL> target_type == '<STR_LIT>' ) <EOL> build_file = gyp . common . ParseQualifiedTarget ( target_name ) [ <NUM_LIT:0> ] <EOL> if not build_file in build_file_in_files : <EOL> build_file_in_files [ build_file ] = _WasBuildFileModified ( build_file , data , files , toplevel_dir ) <EOL> if build_file in build_files : <EOL> build_file_targets . add ( target ) <EOL> if build_file_in_files [ build_file ] : <EOL> print '<STR_LIT>' , target_name <EOL> target . match_status = MATCH_STATUS_MATCHES <EOL> matching_targets . append ( target ) <EOL> else : <EOL> sources = _ExtractSources ( target_name , target_dicts [ target_name ] , <EOL> toplevel_dir ) <EOL> for source in sources : <EOL> if _ToGypPath ( os . path . normpath ( source ) ) in files : <EOL> print '<STR_LIT:target>' , target_name , '<STR_LIT>' , source <EOL> target . match_status = MATCH_STATUS_MATCHES <EOL> matching_targets . append ( target ) <EOL> break <EOL> for dep in target_dicts [ target_name ] . get ( '<STR_LIT>' , [ ] ) : <EOL> targets_to_visit . append ( dep ) <EOL> created_dep_target , dep_target = _GetOrCreateTargetByName ( name_to_target , <EOL> dep ) <EOL> if not created_dep_target : <EOL> roots . discard ( dep_target ) <EOL> target . deps . add ( dep_target ) <EOL> dep_target . back_deps . add ( target ) <EOL> return name_to_target , matching_targets , roots & build_file_targets <EOL> def _GetUnqualifiedToTargetMapping ( all_targets , to_find ) : <EOL> """<STR_LIT>""" <EOL> result = { } <EOL> if not to_find : <EOL> return { } , [ ] <EOL> to_find = set ( to_find ) <EOL> for target_name in all_targets . keys ( ) : <EOL> extracted = gyp . common . ParseQualifiedTarget ( target_name ) <EOL> if len ( extracted ) > <NUM_LIT:1> and extracted [ <NUM_LIT:1> ] in to_find : <EOL> to_find . remove ( extracted [ <NUM_LIT:1> ] ) <EOL> result [ extracted [ <NUM_LIT:1> ] ] = all_targets [ target_name ] <EOL> if not to_find : <EOL> return result , [ ] <EOL> return result , [ x for x in to_find ] <EOL> def _DoesTargetDependOnMatchingTargets ( target ) : <EOL> """<STR_LIT>""" <EOL> if target . match_status == MATCH_STATUS_DOESNT_MATCH : <EOL> return False <EOL> if target . match_status == MATCH_STATUS_MATCHES or target . match_status == MATCH_STATUS_MATCHES_BY_DEPENDENCY : <EOL> return True <EOL> for dep in target . deps : <EOL> if _DoesTargetDependOnMatchingTargets ( dep ) : <EOL> target . match_status = MATCH_STATUS_MATCHES_BY_DEPENDENCY <EOL> print '<STR_LIT:\t>' , target . name , '<STR_LIT>' , dep . name <EOL> return True <EOL> target . match_status = MATCH_STATUS_DOESNT_MATCH <EOL> return False <EOL> def _GetTargetsDependingOnMatchingTargets ( possible_targets ) : <EOL> """<STR_LIT>""" <EOL> found = [ ] <EOL> print '<STR_LIT>' <EOL> for target in possible_targets : <EOL> if _DoesTargetDependOnMatchingTargets ( target ) : <EOL> found . append ( target ) <EOL> return found <EOL> def _AddCompileTargets ( target , roots , add_if_no_ancestor , result ) : <EOL> """<STR_LIT>""" <EOL> if target . visited : <EOL> return <EOL> target . visited = True <EOL> target . in_roots = target in roots <EOL> for back_dep_target in target . back_deps : <EOL> _AddCompileTargets ( back_dep_target , roots , False , result ) <EOL> target . added_to_compile_targets |= back_dep_target . added_to_compile_targets <EOL> target . in_roots |= back_dep_target . in_roots <EOL> target . is_or_has_linked_ancestor |= ( <EOL> back_dep_target . is_or_has_linked_ancestor ) <EOL> if target . in_roots and ( target . is_executable or <EOL> ( not target . added_to_compile_targets and <EOL> ( add_if_no_ancestor or target . requires_build ) ) or <EOL> ( target . is_static_library and add_if_no_ancestor and <EOL> not target . is_or_has_linked_ancestor ) ) : <EOL> print '<STR_LIT>' , target . name , '<STR_LIT>' , target . is_executable , '<STR_LIT>' , target . added_to_compile_targets , '<STR_LIT>' , add_if_no_ancestor , '<STR_LIT>' , target . requires_build , '<STR_LIT>' , target . is_static_library , '<STR_LIT>' , target . is_or_has_linked_ancestor <EOL> result . add ( target ) <EOL> target . added_to_compile_targets = True <EOL> def _GetCompileTargets ( matching_targets , supplied_targets ) : <EOL> """<STR_LIT>""" <EOL> result = set ( ) <EOL> for target in matching_targets : <EOL> print '<STR_LIT>' , target . name <EOL> _AddCompileTargets ( target , supplied_targets , True , result ) <EOL> return result <EOL> def _WriteOutput ( params , ** values ) : <EOL> """<STR_LIT>""" <EOL> if '<STR_LIT:error>' in values : <EOL> print '<STR_LIT>' , values [ '<STR_LIT:error>' ] <EOL> if '<STR_LIT:status>' in values : <EOL> print values [ '<STR_LIT:status>' ] <EOL> if '<STR_LIT>' in values : <EOL> values [ '<STR_LIT>' ] . sort ( ) <EOL> print '<STR_LIT>' <EOL> for target in values [ '<STR_LIT>' ] : <EOL> print '<STR_LIT:\t>' , target <EOL> if '<STR_LIT>' in values : <EOL> values [ '<STR_LIT>' ] . sort ( ) <EOL> print '<STR_LIT>' <EOL> for target in values [ '<STR_LIT>' ] : <EOL> print '<STR_LIT:\t>' , target <EOL> if '<STR_LIT>' in values : <EOL> values [ '<STR_LIT>' ] . sort ( ) <EOL> print '<STR_LIT>' <EOL> for target in values [ '<STR_LIT>' ] : <EOL> print '<STR_LIT:\t>' , target <EOL> if '<STR_LIT>' in values : <EOL> values [ '<STR_LIT>' ] . sort ( ) <EOL> print '<STR_LIT>' <EOL> for target in values [ '<STR_LIT>' ] : <EOL> print '<STR_LIT:\t>' , target <EOL> if '<STR_LIT>' in values : <EOL> values [ '<STR_LIT>' ] . sort ( ) <EOL> print '<STR_LIT>' <EOL> for target in values [ '<STR_LIT>' ] : <EOL> print '<STR_LIT:\t>' , target <EOL> output_path = params . get ( '<STR_LIT>' , { } ) . get ( <EOL> '<STR_LIT>' , None ) <EOL> if not output_path : <EOL> print json . dumps ( values ) <EOL> return <EOL> try : <EOL> f = open ( output_path , '<STR_LIT:w>' ) <EOL> f . write ( json . dumps ( values ) + '<STR_LIT:\n>' ) <EOL> f . close ( ) <EOL> except IOError as e : <EOL> print '<STR_LIT>' , output_path , str ( e ) <EOL> def _WasGypIncludeFileModified ( params , files ) : <EOL> """<STR_LIT>""" <EOL> if params [ '<STR_LIT>' ] . includes : <EOL> for include in params [ '<STR_LIT>' ] . includes : <EOL> if _ToGypPath ( os . path . normpath ( include ) ) in files : <EOL> print '<STR_LIT>' , include <EOL> return True <EOL> return False <EOL> def _NamesNotIn ( names , mapping ) : <EOL> """<STR_LIT>""" <EOL> return [ name for name in names if name not in mapping ] <EOL> def _LookupTargets ( names , mapping ) : <EOL> """<STR_LIT>""" <EOL> return [ mapping [ name ] for name in names if name in mapping ] <EOL> def CalculateVariables ( default_variables , params ) : <EOL> """<STR_LIT>""" <EOL> flavor = gyp . common . GetFlavor ( params ) <EOL> if flavor == '<STR_LIT>' : <EOL> default_variables . setdefault ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> elif flavor == '<STR_LIT>' : <EOL> default_variables . setdefault ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> import gyp . generator . msvs as msvs_generator <EOL> generator_additional_non_configuration_keys = getattr ( msvs_generator , <EOL> '<STR_LIT>' , [ ] ) <EOL> generator_additional_path_sections = getattr ( msvs_generator , <EOL> '<STR_LIT>' , [ ] ) <EOL> gyp . msvs_emulation . CalculateCommonVariables ( default_variables , params ) <EOL> else : <EOL> operating_system = flavor <EOL> if flavor == '<STR_LIT>' : <EOL> operating_system = '<STR_LIT>' <EOL> default_variables . setdefault ( '<STR_LIT>' , operating_system ) <EOL> class TargetCalculator ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , files , additional_compile_target_names , test_target_names , <EOL> data , target_list , target_dicts , toplevel_dir , build_files ) : <EOL> self . _additional_compile_target_names = set ( additional_compile_target_names ) <EOL> self . _test_target_names = set ( test_target_names ) <EOL> self . _name_to_target , self . _changed_targets , self . _root_targets = ( <EOL> _GenerateTargets ( data , target_list , target_dicts , toplevel_dir , <EOL> frozenset ( files ) , build_files ) ) <EOL> self . _unqualified_mapping , self . invalid_targets = ( <EOL> _GetUnqualifiedToTargetMapping ( self . _name_to_target , <EOL> self . _supplied_target_names_no_all ( ) ) ) <EOL> def _supplied_target_names ( self ) : <EOL> return self . _additional_compile_target_names | self . _test_target_names <EOL> def _supplied_target_names_no_all ( self ) : <EOL> """<STR_LIT>""" <EOL> result = self . _supplied_target_names ( ) ; <EOL> result . discard ( '<STR_LIT:all>' ) <EOL> return result <EOL> def is_build_impacted ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _changed_targets <EOL> def find_matching_test_target_names ( self ) : <EOL> """<STR_LIT>""" <EOL> assert self . is_build_impacted ( ) <EOL> test_target_names_no_all = set ( self . _test_target_names ) <EOL> test_target_names_no_all . discard ( '<STR_LIT:all>' ) <EOL> test_targets_no_all = _LookupTargets ( test_target_names_no_all , <EOL> self . _unqualified_mapping ) <EOL> test_target_names_contains_all = '<STR_LIT:all>' in self . _test_target_names <EOL> if test_target_names_contains_all : <EOL> test_targets = [ x for x in ( set ( test_targets_no_all ) | <EOL> set ( self . _root_targets ) ) ] <EOL> else : <EOL> test_targets = [ x for x in test_targets_no_all ] <EOL> print '<STR_LIT>' <EOL> for target_name in self . _test_target_names : <EOL> print '<STR_LIT:\t>' , target_name <EOL> print '<STR_LIT>' <EOL> for target in test_targets : <EOL> print '<STR_LIT:\t>' , target . name <EOL> print '<STR_LIT>' <EOL> matching_test_targets = _GetTargetsDependingOnMatchingTargets ( test_targets ) <EOL> matching_test_targets_contains_all = ( test_target_names_contains_all and <EOL> set ( matching_test_targets ) & <EOL> set ( self . _root_targets ) ) <EOL> if matching_test_targets_contains_all : <EOL> matching_test_targets = [ x for x in ( set ( matching_test_targets ) & <EOL> set ( test_targets_no_all ) ) ] <EOL> print '<STR_LIT>' <EOL> for target in matching_test_targets : <EOL> print '<STR_LIT:\t>' , target . name <EOL> matching_target_names = [ gyp . common . ParseQualifiedTarget ( target . name ) [ <NUM_LIT:1> ] <EOL> for target in matching_test_targets ] <EOL> if matching_test_targets_contains_all : <EOL> matching_target_names . append ( '<STR_LIT:all>' ) <EOL> print '<STR_LIT>' <EOL> return matching_target_names <EOL> def find_matching_compile_target_names ( self ) : <EOL> """<STR_LIT>""" <EOL> assert self . is_build_impacted ( ) ; <EOL> for target in self . _name_to_target . itervalues ( ) : <EOL> target . visited = False <EOL> supplied_targets = _LookupTargets ( self . _supplied_target_names_no_all ( ) , <EOL> self . _unqualified_mapping ) <EOL> if '<STR_LIT:all>' in self . _supplied_target_names ( ) : <EOL> supplied_targets = [ x for x in ( set ( supplied_targets ) | <EOL> set ( self . _root_targets ) ) ] <EOL> print '<STR_LIT>' <EOL> for target in supplied_targets : <EOL> print '<STR_LIT:\t>' , target . name <EOL> print '<STR_LIT>' <EOL> compile_targets = _GetCompileTargets ( self . _changed_targets , <EOL> supplied_targets ) <EOL> return [ gyp . common . ParseQualifiedTarget ( target . name ) [ <NUM_LIT:1> ] <EOL> for target in compile_targets ] <EOL> def GenerateOutput ( target_list , target_dicts , data , params ) : <EOL> """<STR_LIT>""" <EOL> config = Config ( ) <EOL> try : <EOL> config . Init ( params ) <EOL> if not config . files : <EOL> raise Exception ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> toplevel_dir = _ToGypPath ( os . path . abspath ( params [ '<STR_LIT>' ] . toplevel_dir ) ) <EOL> if debug : <EOL> print '<STR_LIT>' , toplevel_dir <EOL> if _WasGypIncludeFileModified ( params , config . files ) : <EOL> result_dict = { '<STR_LIT:status>' : all_changed_string , <EOL> '<STR_LIT>' : list ( config . test_target_names ) , <EOL> '<STR_LIT>' : list ( <EOL> config . additional_compile_target_names | <EOL> config . test_target_names ) } <EOL> _WriteOutput ( params , ** result_dict ) <EOL> return <EOL> calculator = TargetCalculator ( config . files , <EOL> config . additional_compile_target_names , <EOL> config . test_target_names , data , <EOL> target_list , target_dicts , toplevel_dir , <EOL> params [ '<STR_LIT>' ] ) <EOL> if not calculator . is_build_impacted ( ) : <EOL> result_dict = { '<STR_LIT:status>' : no_dependency_string , <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : [ ] } <EOL> if calculator . invalid_targets : <EOL> result_dict [ '<STR_LIT>' ] = calculator . invalid_targets <EOL> _WriteOutput ( params , ** result_dict ) <EOL> return <EOL> test_target_names = calculator . find_matching_test_target_names ( ) <EOL> compile_target_names = calculator . find_matching_compile_target_names ( ) <EOL> found_at_least_one_target = compile_target_names or test_target_names <EOL> result_dict = { '<STR_LIT>' : test_target_names , <EOL> '<STR_LIT:status>' : found_dependency_string if <EOL> found_at_least_one_target else no_dependency_string , <EOL> '<STR_LIT>' : list ( <EOL> set ( compile_target_names ) | <EOL> set ( test_target_names ) ) } <EOL> if calculator . invalid_targets : <EOL> result_dict [ '<STR_LIT>' ] = calculator . invalid_targets <EOL> _WriteOutput ( params , ** result_dict ) <EOL> except Exception as e : <EOL> _WriteOutput ( params , error = str ( e ) ) </s>
