Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL]Problem running an ant file
[ATL]Problem running an ant file [message #68462] Mon, 10 December 2007 10:09 Go to next message
beaperez Mising name is currently offline beaperez Mising name
Messages: 81
Registered: July 2009
Member
Hello everybody,
I don't know if this newsgroup is the correct place to post my problem, but
I will try.
I am trying to develop an Eclipse plugin which, selecting a .uml file,
executes some ATL transformations from this .uml file. I have an ANT file
which executes those transformations. The problem is that I have to pass:
- the path in which the .uml file is
-its name,
- the path in which the newAction.java (which executes the code) is

but I don't know how to get that information. Does anyone know how to get
that information? Now I have the code:

AntRunner runner = new AntRunner();

String ant_home=
System.getProperty("user.dir")+"\\plugins\\org.apache.ant_1.7.0.v200706080842 ";


String currentDir=??


Vector arguments = new Vector();

String templatesDir=??

String fileName=??

arguments.add("-Darg1= "+templatesDir);

arguments.add("-Darg2= "+fileName);

String[] antArguments= (String[]) arguments.toArray(new String[0]);

runner.setAntHome(ant_home);

runner.setBuildFileLocation(currentDir+"build.xml");

runner.setArguments(antArguments);

try {

runner.run();

} catch (CoreException e) {

e.printStackTrace();

} catch (Exception e) {

e.printStackTrace();

}

Any idea?

Thank you very much in advance

Bea
Re: [ATL]Problem running an ant file [message #69666 is a reply to message #68462] Thu, 13 December 2007 21:35 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric Jouault
Messages: 572
Registered: July 2009
Senior Member
Hello,

What is currentDir supposed to be?
If it is a specific project, then you could hardcode its path.
If it is related to the current selection, then you should get it.

Filename is probably also related to selection.
As for templatesDir, you could put it somewhere where you can find it
(e.g., next to the ant script).


Regards,

Frédéric Jouault


Bea wrote:
> Hello everybody,
> I don't know if this newsgroup is the correct place to post my problem, but
> I will try.
> I am trying to develop an Eclipse plugin which, selecting a .uml file,
> executes some ATL transformations from this .uml file. I have an ANT file
> which executes those transformations. The problem is that I have to pass:
> - the path in which the .uml file is
> -its name,
> - the path in which the newAction.java (which executes the code) is
>
> but I don't know how to get that information. Does anyone know how to get
> that information? Now I have the code:
>
> AntRunner runner = new AntRunner();
>
> String ant_home=
> System.getProperty("user.dir")+"\\plugins\\org.apache.ant_1.7.0.v200706080842 ";
>
>
> String currentDir=??
>
>
> Vector arguments = new Vector();
>
> String templatesDir=??
>
> String fileName=??
>
> arguments.add("-Darg1= "+templatesDir);
>
> arguments.add("-Darg2= "+fileName);
>
> String[] antArguments= (String[]) arguments.toArray(new String[0]);
>
> runner.setAntHome(ant_home);
>
> runner.setBuildFileLocation(currentDir+"build.xml");
>
> runner.setArguments(antArguments);
>
> try {
>
> runner.run();
>
> } catch (CoreException e) {
>
> e.printStackTrace();
>
> } catch (Exception e) {
>
> e.printStackTrace();
>
> }
>
> Any idea?
>
> Thank you very much in advance
>
> Bea
>
>
Re: [ATL]Problem running an ant file [message #69785 is a reply to message #69666] Mon, 17 December 2007 15:58 Go to previous message
beaperez Mising name is currently offline beaperez Mising name
Messages: 81
Registered: July 2009
Member
Thanks Frederic, I finally found the code to get the path.

Bea




"Fr
Previous Topic:[ATL] Copy Ecore Files.launch does not exist
Next Topic:[ATL] Apply rules recursively to children
Goto Forum:
  


Current Time: Sat Oct 25 09:03:26 GMT 2014

Powered by FUDForum. Page generated in 0.01656 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software