PERL INCLUDE PATH automatically from Java Code

E

eser

Hi all!
I have a big problem..

I developed an eclipse plugin who creates projects of "perl nature"
with a particular path: I must modify the perl build path but I don't
know what I have to do...In particular if I create the perl nature
project now as now, it is created with the original perl build path
and if I want to modify it I have to do right click on perl project
that is create starting the plugin, then "Properties" and then "Perl
Include Path", but I don't have to do this with my hands from the perl
project view. The plugin must be done in a way that the perl project
created must have the classpath already setted. If I don't modify this
path from the java code, a module (file.pm, is a mine particular
module who requires a particular path because call different USE in
his package) that is loaded at the same time of the perl project
returns errors because of some USE in file.pm .... who are not able to
find the right path

My java code now is:

IWorkspace work=ResourcesPlugin.getWorkspace();

IWorkspaceRoot workRoot=ResourcesPlugin.getWorkspace().getRoot();

IProject newProject=workRoot.getProject(name);

IProjectDescription
newProjectDescription=work.newProjectDescription(name);

String[] natureId=new String[1];

natureId[0]="org.epic.perleditor.perlnature"; //PERL NATURE

newProjectDescription.setNatureIds(natureId);

...............
//Here I think is the place where I have to modify the perl path of
the project the plugin is goig to create
.........................
newProject.create(newProjectDescription,null); //creazione progetto

Can you give me an idea or a little piece of source code to resolve
this problem?
I browse a lot in the web but I didn't find any idea to continue...

Is it possible to look throught perl path from java code?
Thanks very much! I need some helps ..!


Dani
 
K

Klaus

On Sep 7, 3:59 pm, (e-mail address removed) wrote:

[ snip ]
...creates projects of "perl nature"
with a particular path: I must modify the perl build path but I don't
know what I have to do...

[ snip ]
a module (file.pm, is a mine particular
module who requires a particular path because call different USE in
his package) that is loaded at the same time of the perl project
returns errors because of some USE in file.pm .... who are not able to
find the right path

My java code now is:

[ snip java ]

I don't know anything about Eclipse or Java, but as far as Perl is
concerned, you could read about "@INC" in "perldoc perlvar":

=======================
@INC
The array @INC contains the list of places that the do EXPR, require,
or use constructs look for their library files. It initially consists
of the arguments to any -I command-line switches, followed by the
default Perl library, probably /usr/local/lib/perl, followed by ``.'',
to represent the current directory. (``.'' will not be appended if
taint checks are enabled, either by -T or by -t.) If you need to
modify this at runtime, you should use the use lib pragma to get the
machine-dependent library properly loaded also:

use lib '/mypath/libdir/';
use SomeMod;

You can also insert hooks into the file inclusion system by putting
Perl code directly into @INC. Those hooks may be subroutine
references, array references or blessed objects. See require in the
perlfunc manpage for details.
=======================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top