#NEWLINE# def compile_scripts( self ) : #NEWLINE# #INDENT# '\n        Compile .java files\n        ' #NEWLINE# self . log . debug ( 'Compiling .java files started' ) #NEWLINE# java_files = [ ] #NEWLINE# for dir_entry in os . walk ( self . working_dir ) : #NEWLINE# #INDENT# if dir_entry [ 2 ] : #NEWLINE# #INDENT# for test_file in dir_entry [ 2 ] : #NEWLINE# #INDENT# if ( os . path . splitext ( test_file ) [ 1 ] . lower ( ) == '.java' ) : #NEWLINE# #INDENT# java_files . append ( os . path . join ( compile_cl [ 0 ] , test_file ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# compile_cl = [ 'javac' , '-source' , self . target_java , '-target' , self . target_java ] #NEWLINE# compile_cl . extend ( [ '-cp' , os . pathsep . join ( self . base_class_path ) ] ) #NEWLINE# compile_cl . extend ( java_files ) #NEWLINE# with open ( os . path . join ( self . artifacts_dir , 'javac.out' ) , 'ab' ) as javac_out : #NEWLINE# #INDENT# with open ( os . path . join ( self . artifacts_dir , 'javac.err' ) , 'ab' ) as javac_err : #NEWLINE# #INDENT# self . log . debug ( 'running javac: %s' , compile_cl ) #NEWLINE# self . process = shell_exec ( compile_cl , cwd = self . working_dir , stdout = javac_out , stderr = javac_err ) #NEWLINE# ret_code = self . process . poll ( ) #NEWLINE# while ( ret_code is None ) : #NEWLINE# #INDENT# self . log . debug ( 'Compiling .java files...' ) #NEWLINE# time . sleep ( 1 ) #NEWLINE# ret_code = self . process . poll ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( ret_code != 0 ) : #NEWLINE# #INDENT# self . log . debug ( 'javac exit code: %s' , ret_code ) #NEWLINE# with open ( javac_err . name ) as err_file : #NEWLINE# #INDENT# out = err_file . read ( ) #NEWLINE# #UNINDENT# raise RuntimeError ( ( 'Javac exited with error:\n %s' % out . strip ( ) ) ) #NEWLINE# #UNINDENT# self . log . info ( 'Compiling .java files completed' ) #NEWLINE# self . make_jar ( )