#NEWLINE# def _create_template_data( self , build_file_path , targets ) : #NEWLINE# #INDENT# if ( ( len ( targets ) == 1 ) and self . is_local_src ( targets [ 0 ] ) ) : #NEWLINE# #INDENT# local_target = targets [ 0 ] #NEWLINE# data = self . _data ( target_type = ( 'go_binary' if self . is_binary ( local_target ) else 'go_library' ) , deps = [ d . address . reference ( ) for d in local_target . dependencies ] ) #NEWLINE# return self . TemplateResult . local_target ( build_file_path = build_file_path , data = data , import_paths = [ local_target . import_path ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if self . get_options ( ) . remote : #NEWLINE# #INDENT# fail_floating = self . get_options ( ) . fail_floating #NEWLINE# if ( ( len ( targets ) == 1 ) and ( not targets [ 0 ] . pkg ) ) : #NEWLINE# #INDENT# remote_lib = targets [ 0 ] #NEWLINE# rev = remote_lib . rev #NEWLINE# data = self . _data ( target_type = 'go_remote_library' , rev = rev ) #NEWLINE# import_paths = ( remote_lib . import_path , ) #NEWLINE# return self . TemplateResult . remote_target ( build_file_path = build_file_path , data = data , import_paths = import_paths , rev = rev , fail_floating = fail_floating ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# revs = { t . rev for t in targets if t . rev } #NEWLINE# if ( len ( revs ) > 1 ) : #NEWLINE# #INDENT# msg = 'Cannot create BUILD file {} for the following packages at remote root {}, they must all have the same version:\n\t{}' . format ( build_file_path , targets [ 0 ] . remote_root , '\n\t' . join ( ( '{} {}' . format ( t . pkg , t . rev ) for t in targets ) ) ) #NEWLINE# raise self . NonUniformRemoteRevsError ( msg ) #NEWLINE# #UNINDENT# rev = ( revs . pop ( ) if revs else None ) #NEWLINE# data = self . _data ( target_type = 'go_remote_libraries' , rev = rev , pkgs = sorted ( { t . pkg for t in targets } ) ) #NEWLINE# import_paths = tuple ( ( t . import_path for t in targets ) ) #NEWLINE# return self . TemplateResult . remote_target ( build_file_path = build_file_path , data = data , import_paths = import_paths , rev = rev , fail_floating = fail_floating ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return None