Changeset 5405


Ignore:
Timestamp:
06/20/09 04:45:53 (3 years ago)
Author:
waxhead
Message:

Started working on win32 support. Slight issue with colons breaking the NYTProf environment variable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre-Plugin-NYTProf/lib/Padre/Plugin/NYTProf/ProfilingTask.pm

    r5238 r5405  
    5656#   $self->print( "Env: $nytprof_env_vars\n" ); 
    5757    #$self->task_print( "\nEnv: $nytprof_env_vars\n" . join(' ', @cmd) . "\n\n" ); 
    58     my $cmd = "NYTPROF=$nytprof_env_vars; export NYTPROF; " . $self->{prof_settings}->{perl} . ' -d:NYTProf ' . $self->{prof_settings}->{doc_path}; 
    59     $self->task_print("$cmd\n\n"); 
    60     #system("NYTPROF=$nytprof_env_vars; " . join(' ', @cmd) ); 
    61     system($cmd); 
     58     
     59    my $cmd = ''; 
     60    if( $^O eq "MSWin32" ) { 
     61        print "Running on windows\n"; 
     62        $cmd = "set NYTPROF=$nytprof_env_vars && "; 
     63         
     64    } 
     65    elsif( $^O eq "darwin" ) { 
     66        print "Running on Darwin\n"; 
     67         
     68         
     69    } 
     70    elsif( $^O eq "linux" ) { 
     71        print "running on linux\n"; 
     72        $cmd = "NYTPROF=$nytprof_env_vars; export NYTPROF; "; # . $self->{prof_settings}->{perl} . ' -d:NYTProf ' . $self->{prof_settings}->{doc_path}; 
     73    } 
     74     
     75    # run the command if we can 
     76    if( $cmd ne '' ) { 
     77        # append the rest of the command here 
     78        $cmd .= $self->{prof_settings}->{perl} . ' -d:NYTProf ' . $self->{prof_settings}->{doc_path}; 
     79        $self->task_print("$cmd\n\n"); 
     80        system($cmd); 
     81    } 
     82    else { 
     83        print "Unable to determine your OS\n"; 
     84    } 
     85     
    6286    return 1; 
    6387} 
Note: See TracChangeset for help on using the changeset viewer.