#NEWLINE# def run_build( view , project_name , project_dir , config ) : #NEWLINE# #INDENT# global projects_being_built #NEWLINE# if ( project_name in projects_being_built ) : #NEWLINE# #INDENT# log ( ( "Not building '%s' because it is already being built" % project_name ) , log_warning ) #NEWLINE# show_status_message ( ( 'Already building %s' % project_name ) , is_ok = False , priority = 5 ) #NEWLINE# return #NEWLINE# #UNINDENT# projects_being_built . add ( project_name ) #NEWLINE# build_tool_name = get_setting_async ( 'haskell_build_tool' , 'stack' ) #NEWLINE# if ( ( build_tool_name == 'stack' ) and ( not is_stack_project ( project_dir ) ) ) : #NEWLINE# #INDENT# build_tool_name = 'cabal' #NEWLINE# #UNINDENT# tool = build_tool [ build_tool_name ] #NEWLINE# tool_title = tool [ 'name' ] #NEWLINE# action_title = config [ 'message' ] #NEWLINE# tool_name = tool [ 'command' ] #NEWLINE# tool_steps = config [ 'steps' ] [ build_tool_name ] #NEWLINE# commands = [ ( [ tool_name ] + step ) for step in tool_steps ] #NEWLINE# log ( 'running build commands: {0}' . format ( commands ) , log_trace ) #NEWLINE# def done_callback( ) : #NEWLINE# #INDENT# projects_being_built . remove ( project_name ) #NEWLINE# #UNINDENT# run_chain_build_thread ( view , project_dir , '{0} {1} with {2}' . format ( action_title , project_name , tool_title ) , commands , on_done = done_callback )