Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Running an ANT file with java
[ATL] Running an ANT file with java [message #58327] Fri, 17 August 2007 16:01 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, but I don't know how. 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: [ATL] Running an ANT file with java [message #58379 is a reply to message #58327] Fri, 17 August 2007 20:40 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello,

Examples of running ant scripts from Java code (more specifically from
an Eclipse plugin) are available in AM3. See the ActionAnt... classes in:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/AM3 /org.eclipse.am3.ui/src/org/eclipse/am3/ui/action/?root=Tech nology_Project

Note that this implementation has one flaw though: the ant console is
not displayed.


As far as I know, the AM3 ant tasks have not been adapted to work
outside of Eclipse yet.


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 have an ANT script (build.xml) that executes several ATL transformations.
> I want to run that build.xml file from java, but I don't know how. 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: [ATL] Running an ANT file with java [message #58801 is a reply to message #58379] Mon, 20 August 2007 19:42 Go to previous message
beaperez Mising name is currently offline beaperez Mising nameFriend
Messages: 81
Registered: July 2009
Member
Hi,
I have been looking the webpage but I don't know what variable correspond to
the ant script.
Could anybody tell me where I can find the ATL API? or help me with the java
code?
Thank you in advance
Bea

"Fr
Previous Topic:[ATL]Java Heap Space Error importing ECore Model
Next Topic:[ATL] New use case - Variability management in MDSPL
Goto Forum:
  


Current Time: Thu Jan 21 15:27:23 GMT 2021

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

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

Back to the top