in reply to Setting environment-variables in Eclipse (EPIC)? [SOLVED]
What I do in Eclipse/EPIC is change the perl executable line.
/ActivePerl/bin/perl -I/Users/apriven/Dev/Source/Actium/trunk -MActium::Eclipse(Actium is the name of my project)
Then, whatever I want to do in Eclipse, but not when running otherwise, is done in the Actium::Eclipse module.
Here's my Actium::Eclipse module:
# Actium/Eclipse.pm # Originally, this did nothing of any use. However, requiring that thi +s file # be present was a cute way of figuring out whether the requiring # program is running under Eclipse or not. # Add -MActium::Eclipse to Eclipse's default perl comamnd line. # Then you can do: # if ($Actium::Eclipse::is_under_eclipse) { # do_something(); # } # else { # do_something_else; # } # Ta da. # Originally, I did that so that actium.pl could ask for a command lin +e if # none was provided. I later moved that routine to this module. So # Actium::Eclipse::get_command_line() gets the command line (using App +lescript... # slowly) from Eclipse. package Actium::Eclipse; use 5.010; use warnings; use strict; no warnings('redefine'); # without which, Eclipse complains because it sees this module twice w +hen # debugging this module our $is_under_eclipse = 1; sub get_command_line { my $history; if ( -f '/tmp/UnderEclipse.history' ) { open my $histfile, '<', '/tmp/UnderEclipse.history'; $history = readline($histfile); chomp $history; close $histfile; } else { $history = ""; } my $script = qq[osascript -e 'tell application "Eclipse" to get text return +ed of ( display dialog "$0\rCommand line:" default answer "$history" +buttons "OK" default button "OK" with title "Command line entry" ) '] +; my $newargs = `$script`; chomp $newargs; if ( $newargs ne $history ) { open my $histout, '>', '/tmp/UnderEclipse.history'; say $histout $newargs; close $histout; } return split( ' ', $newargs ); } ## <perltidy> end sub get_command_line 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Setting environment-variables in Eclipse (EPIC)? [SOLVED]
by locked_user sundialsvc4 (Abbot) on Mar 16, 2011 at 15:29 UTC |