def calculate_compile_sources(targets, is_thrift_target):
 basedirs = set()
 sources = set()
 def collect_sources(target):
  basedirs.add(target.target_base)
  sources.update(target.sources_relative_to_buildroot())
 for target in targets:
  target.walk(collect_sources, predicate=is_thrift_target)
 return (basedirs, sources)

def calculate_compile_sources ( targets , is_thrift_target ) : basedirs = set ( ) sources = set ( ) def collect_sources ( target ) : basedirs . add ( target . target_base ) sources . update ( target . sources_relative_to_buildroot ( ) ) for target in targets : target . walk ( collect_sources , predicate = is_thrift_target ) return ( basedirs , sources )
calculates the set of thrift source files that need to be compiled .