Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Running an ant file from Java to execute some ATL transformations
Running an ant file from Java to execute some ATL transformations [message #67626] Thu, 29 November 2007 15:38 Go to next message
beaperez Mising name is currently offline beaperez Mising nameFriend
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 have an ANT script (build.xml) that executes several ATL transformations.
I want to run that build.xml file from java because I would like to create
an Eclipse plug-in which executes some ATL transformations. The problem is
tht I don't know how to do that. I have tried with:

Process proce = Runtime.getRuntime().exec("cmd /c
"+ant_home+"/bin/ant -buildfile
c:/eclipse3.3/runtime-New_configuration/Plugin/src/plugin/po pup/actions/build.xml ");




InputStream is = proce.getInputStream();

BufferedReader br = new BufferedReader (new InputStreamReader (is));


String aux = br.readLine();
while (aux!=null)
{
aux = br.readLine();
}
}catch(Exception e){
System.out.println("Error: "+e.getMessage());
}

The problem is that only the first sentence in the ANT file is executed, but
not all the script. Why?

Any idea?

Thank you very much in advance

Bea
Re: Running an ant file from Java to execute some ATL transformations [message #67652 is a reply to message #67626] Thu, 29 November 2007 16:07 Go to previous message
Eclipse UserFriend
Originally posted by: freddy.allilaire.univ-nantes.fr

Hi Bea,

Maybe you should take a look to "org.eclipse.ant.core.AntRunner" java
class. I think it will be more adapted to your use case.

HTH

Regards,
Freddy.

Bea a écrit :
> Hello everybody,
> I don't know if this newsgroup is the correct place to post my problem, but
> I will try.
> I have an ANT script (build.xml) that executes several ATL transformations.
> I want to run that build.xml file from java because I would like to create
> an Eclipse plug-in which executes some ATL transformations. The problem is
> tht I don't know how to do that. I have tried with:
>
> Process proce = Runtime.getRuntime().exec("cmd /c
> "+ant_home+"/bin/ant -buildfile
> c:/eclipse3.3/runtime-New_configuration/Plugin/src/plugin/po pup/actions/build.xml ");
>
>
>
>
> InputStream is = proce.getInputStream();
>
> BufferedReader br = new BufferedReader (new InputStreamReader (is));
>
>
> String aux = br.readLine();
> while (aux!=null)
> {
> aux = br.readLine();
> }
> }catch(Exception e){
> System.out.println("Error: "+e.getMessage());
> }
>
> The problem is that only the first sentence in the ANT file is executed, but
> not all the script. Why?
>
> Any idea?
>
> Thank you very much in advance
>
> Bea
>
>


--
Freddy Allilaire - ATLAS Group (INRIA & LINA)
http://www.sciences.univ-nantes.fr/lina/atl/contrib/allilair e
Previous Topic:[ATL] Insert elements in reference features
Next Topic:[ATL] Problem with UML-Reference
Goto Forum:
  


Current Time: Sun Apr 11 23:05:24 GMT 2021

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

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

Back to the top