|
Re: [ATL]Problem running an ant file [message #69666 is a reply to message #68462] |
Thu, 13 December 2007 21:35 |
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
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03406 seconds