Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Running ant task within Eclipse
Running ant task within Eclipse [message #327828] Mon, 05 May 2008 11:40 Go to next message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

Hi,

If I run an Ant task within Eclipse I sometimes have to manually refresh the
folders in Eclipse to get the desired result. Details on my problem below.

Is it possible in Eclipse to refresh a specific folder after a certain ant
task? This would be in the middle of the complete ant excecution.

Alternatively I can run ant outside Eclipse, which also solves my problem.

Best regards, Lars
----------------

Details:

I do an Xinclude of docbook files. As the source code which is included in
these XIncludes gets special delimiter signs I have to remove these via a
small Java program.
<target name="specialsign" depends="xinclude">

<java classname="removeStrings.RemoveSpecialSigns">

</java>

</target>

The coding is really simple:



public class RemoveSpecialSigns {


public static void main(String[] args) throws FileNotFoundException {


FileListing fileListing = new FileListing();

fileListing.setDir("./output.tmp");

List<File> files = fileListing.getFileListing();

MyFile workingFile = new MyFile();

for (File file : files) {

System.out.println(file);

String fileName = file.getAbsolutePath();

workingFile.copy(fileName);

workingFile.delete(fileName);

workingFile.move(fileName);

}

}

}



MyFile does replace the characters:



String newLine = line.replaceAll("&#13;", "") + "\n";
Re: Running ant task within Eclipse [message #327844 is a reply to message #327828] Mon, 05 May 2008 17:30 Go to previous messageGo to next message
Wayne Beaton is currently offline Wayne BeatonFriend
Messages: 555
Registered: December 2017
Senior Member
Do the options on the "Refresh" tab of the "Run As... > Ant Build..."
dialog help?

Wayne

On Mon, 2008-05-05 at 13:40 +0200, Lars Vogel wrote:
> Hi,
>
> If I run an Ant task within Eclipse I sometimes have to manually refresh the
> folders in Eclipse to get the desired result. Details on my problem below.
>
> Is it possible in Eclipse to refresh a specific folder after a certain ant
> task? This would be in the middle of the complete ant excecution.
>
> Alternatively I can run ant outside Eclipse, which also solves my problem.
>
> Best regards, Lars
> ----------------
>
> Details:
>
> I do an Xinclude of docbook files. As the source code which is included in
> these XIncludes gets special delimiter signs I have to remove these via a
> small Java program.
> <target name="specialsign" depends="xinclude">
>
> <java classname="removeStrings.RemoveSpecialSigns">
>
> </java>
>
> </target>
>
> The coding is really simple:
>
>
>
> public class RemoveSpecialSigns {
>
>
> public static void main(String[] args) throws FileNotFoundException {
>
>
> FileListing fileListing = new FileListing();
>
> fileListing.setDir("./output.tmp");
>
> List<File> files = fileListing.getFileListing();
>
> MyFile workingFile = new MyFile();
>
> for (File file : files) {
>
> System.out.println(file);
>
> String fileName = file.getAbsolutePath();
>
> workingFile.copy(fileName);
>
> workingFile.delete(fileName);
>
> workingFile.move(fileName);
>
> }
>
> }
>
> }
>
>
>
> MyFile does replace the characters:
>
>
>
> String newLine = line.replaceAll("&#13;", "") + "\n";
>
>
>
>
>
>
>
>
Re: Running ant task within Eclipse [message #327845 is a reply to message #327844] Mon, 05 May 2008 20:43 Go to previous messageGo to next message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

Hi Wayne,

thanks for the reply.

I assumed this would refresh the workspace / project after the ant script is
finished. I'm looking for a refreash after a certain ant task (before the
next is excecuted).

Is my assumption incorrect? Best regards, Lars


"Wayne Beaton" <wayne@eclipse.org> wrote in message
news:1210008656.6034.0.camel@BADWOLF...
> Do the options on the "Refresh" tab of the "Run As... > Ant Build..."
> dialog help?
>
> Wayne
>
> On Mon, 2008-05-05 at 13:40 +0200, Lars Vogel wrote:
>> Hi,
>>
>> If I run an Ant task within Eclipse I sometimes have to manually refresh
>> the
>> folders in Eclipse to get the desired result. Details on my problem
>> below.
>>
>> Is it possible in Eclipse to refresh a specific folder after a certain
>> ant
>> task? This would be in the middle of the complete ant excecution.
>>
>> Alternatively I can run ant outside Eclipse, which also solves my
>> problem.
>>
>> Best regards, Lars
>> ----------------
>>
>> Details:
>>
>> I do an Xinclude of docbook files. As the source code which is included
>> in
>> these XIncludes gets special delimiter signs I have to remove these via a
>> small Java program.
>> <target name="specialsign" depends="xinclude">
>>
>> <java classname="removeStrings.RemoveSpecialSigns">
>>
>> </java>
>>
>> </target>
>>
>> The coding is really simple:
>>
>>
>>
>> public class RemoveSpecialSigns {
>>
>>
>> public static void main(String[] args) throws FileNotFoundException {
>>
>>
>> FileListing fileListing = new FileListing();
>>
>> fileListing.setDir("./output.tmp");
>>
>> List<File> files = fileListing.getFileListing();
>>
>> MyFile workingFile = new MyFile();
>>
>> for (File file : files) {
>>
>> System.out.println(file);
>>
>> String fileName = file.getAbsolutePath();
>>
>> workingFile.copy(fileName);
>>
>> workingFile.delete(fileName);
>>
>> workingFile.move(fileName);
>>
>> }
>>
>> }
>>
>> }
>>
>>
>>
>> MyFile does replace the characters:
>>
>>
>>
>> String newLine = line.replaceAll("&#13;", "") + "\n";
>>
>>
>>
>>
>>
>>
>>
>>
>
Re: Running ant task within Eclipse [message #327846 is a reply to message #327845] Mon, 05 May 2008 21:29 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 237
Registered: July 2009
Senior Member
Hi Lars,

you can use the eclipse.refreshLocal ant task (see
http://help.eclipse.org/help33/topic/org.eclipse.platform.do c.isv/guide/ant.htm).

Be sure to let the ant build run in the same JRE as your eclipse runs in
(see Launch dialog of the ant launch configuration).

Greets
Benny

Lars Vogel wrote:
> Hi Wayne,
>
> thanks for the reply.
>
> I assumed this would refresh the workspace / project after the ant script is
> finished. I'm looking for a refreash after a certain ant task (before the
> next is excecuted).
>
> Is my assumption incorrect? Best regards, Lars
>
>
> "Wayne Beaton" <wayne@eclipse.org> wrote in message
> news:1210008656.6034.0.camel@BADWOLF...
>> Do the options on the "Refresh" tab of the "Run As... > Ant Build..."
>> dialog help?
>>
>> Wayne
>>
>> On Mon, 2008-05-05 at 13:40 +0200, Lars Vogel wrote:
>>> Hi,
>>>
>>> If I run an Ant task within Eclipse I sometimes have to manually refresh
>>> the
>>> folders in Eclipse to get the desired result. Details on my problem
>>> below.
>>>
>>> Is it possible in Eclipse to refresh a specific folder after a certain
>>> ant
>>> task? This would be in the middle of the complete ant excecution.
>>>
>>> Alternatively I can run ant outside Eclipse, which also solves my
>>> problem.
>>>
>>> Best regards, Lars
>>> ----------------
>>>
>>> Details:
>>>
>>> I do an Xinclude of docbook files. As the source code which is included
>>> in
>>> these XIncludes gets special delimiter signs I have to remove these via a
>>> small Java program.
>>> <target name="specialsign" depends="xinclude">
>>>
>>> <java classname="removeStrings.RemoveSpecialSigns">
>>>
>>> </java>
>>>
>>> </target>
>>>
>>> The coding is really simple:
>>>
>>>
>>>
>>> public class RemoveSpecialSigns {
>>>
>>>
>>> public static void main(String[] args) throws FileNotFoundException {
>>>
>>>
>>> FileListing fileListing = new FileListing();
>>>
>>> fileListing.setDir("./output.tmp");
>>>
>>> List<File> files = fileListing.getFileListing();
>>>
>>> MyFile workingFile = new MyFile();
>>>
>>> for (File file : files) {
>>>
>>> System.out.println(file);
>>>
>>> String fileName = file.getAbsolutePath();
>>>
>>> workingFile.copy(fileName);
>>>
>>> workingFile.delete(fileName);
>>>
>>> workingFile.move(fileName);
>>>
>>> }
>>>
>>> }
>>>
>>> }
>>>
>>>
>>>
>>> MyFile does replace the characters:
>>>
>>>
>>>
>>> String newLine = line.replaceAll("&#13;", "") + "\n";
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>
>
Re: Running ant task within Eclipse [message #327898 is a reply to message #327846] Wed, 07 May 2008 20:48 Go to previous message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

Hi Benny,

thank you, cool tip!

Best regards, Lars

"Benjamin Muskalla" <bmuskalla@innoopract.com> wrote in message
news:fvnu76$h51$1@build.eclipse.org...
> Hi Lars,
>
> you can use the eclipse.refreshLocal ant task (see
> http://help.eclipse.org/help33/topic/org.eclipse.platform.do c.isv/guide/ant.htm).
>
> Be sure to let the ant build run in the same JRE as your eclipse runs in
> (see Launch dialog of the ant launch configuration).
>
> Greets
> Benny
>
> Lars Vogel wrote:
>> Hi Wayne,
>>
>> thanks for the reply.
>>
>> I assumed this would refresh the workspace / project after the ant script
>> is finished. I'm looking for a refreash after a certain ant task (before
>> the next is excecuted).
>>
>> Is my assumption incorrect? Best regards, Lars
>>
>>
>> "Wayne Beaton" <wayne@eclipse.org> wrote in message
>> news:1210008656.6034.0.camel@BADWOLF...
>>> Do the options on the "Refresh" tab of the "Run As... > Ant Build..."
>>> dialog help?
>>>
>>> Wayne
>>>
>>> On Mon, 2008-05-05 at 13:40 +0200, Lars Vogel wrote:
>>>> Hi,
>>>>
>>>> If I run an Ant task within Eclipse I sometimes have to manually
>>>> refresh the
>>>> folders in Eclipse to get the desired result. Details on my problem
>>>> below.
>>>>
>>>> Is it possible in Eclipse to refresh a specific folder after a certain
>>>> ant
>>>> task? This would be in the middle of the complete ant excecution.
>>>>
>>>> Alternatively I can run ant outside Eclipse, which also solves my
>>>> problem.
>>>>
>>>> Best regards, Lars
>>>> ----------------
>>>>
>>>> Details:
>>>>
>>>> I do an Xinclude of docbook files. As the source code which is included
>>>> in
>>>> these XIncludes gets special delimiter signs I have to remove these via
>>>> a
>>>> small Java program.
>>>> <target name="specialsign" depends="xinclude">
>>>>
>>>> <java classname="removeStrings.RemoveSpecialSigns">
>>>>
>>>> </java>
>>>>
>>>> </target>
>>>>
>>>> The coding is really simple:
>>>>
>>>>
>>>>
>>>> public class RemoveSpecialSigns {
>>>>
>>>>
>>>> public static void main(String[] args) throws FileNotFoundException {
>>>>
>>>>
>>>> FileListing fileListing = new FileListing();
>>>>
>>>> fileListing.setDir("./output.tmp");
>>>>
>>>> List<File> files = fileListing.getFileListing();
>>>>
>>>> MyFile workingFile = new MyFile();
>>>>
>>>> for (File file : files) {
>>>>
>>>> System.out.println(file);
>>>>
>>>> String fileName = file.getAbsolutePath();
>>>>
>>>> workingFile.copy(fileName);
>>>>
>>>> workingFile.delete(fileName);
>>>>
>>>> workingFile.move(fileName);
>>>>
>>>> }
>>>>
>>>> }
>>>>
>>>> }
>>>>
>>>>
>>>>
>>>> MyFile does replace the characters:
>>>>
>>>>
>>>>
>>>> String newLine = line.replaceAll("&#13;", "") + "\n";
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>
Previous Topic:ProjectAnnotation not persisted?
Next Topic:Ganymede IHandler2/AbstractHandler execute() method not recognized in @Override
Goto Forum:
  


Current Time: Sun Dec 22 06:07:27 GMT 2024

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

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

Back to the top