Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Ant build after clean not triggering
Ant build after clean not triggering [message #760892] Mon, 05 December 2011 14:22 Go to next message
CG Mising name is currently offline CG Mising nameFriend
Messages: 8
Registered: December 2011
Junior Member
(Searched to see if anyone else has encountered and fixed this seemingly simple problem but cannot find anyone. Also posted on the "newcomers" forum about a week ago but did not get much in the way of replies.)

Using: Eclipse Version: 3.7.1, build id: M20110909-1335

I boiled down my scenario to the following:

I have a Java project called "dummy" with two files directly under it (i.e. NOT under "src"):

build.xml -- this is an Ant build file
testfile.txt -- a simple text file

Here is build.xml:
--------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<project name="dummy" basedir=".">

<!-- Clean up the directory -->
<target name="clean">
<echo message="Cleaning" />
<delete dir="./testfolder"></delete>
</target>

<!-- Make directory process -->
<target name="makeDir">
<echo message="Making" />
<mkdir dir="./testfolder" />
</target>

<!-- Copy file process -->
<target name="copy" depends="makeDir">
<echo message="Copying" />
<copy file="testfile.txt" tofile="./testfolder/testfile.txt" overwrite="true"/>
</target>

</project>
-----------------------------------------------

I've brought up the project properties and made a new Ant builder (called "New_Builder"). I experimented with putting New_Builder both before and after the default Java Builder, but my end results were the same in either case. New_Builder has these characteristics:

-- The "Main" tab has the "Buildfile" pointing to build.xml
-- The "Refresh" tab has the "Refresh resources upon completion" checked, with "The entire workspace" selected.
-- The "Targets" tab has the following settings:* After a "Clean": copy
* Manual Build: copy
* Auto Build: <nothing>
* During a "Clean": clean

My problem:
When I clean this project with "Build Automatically" enabled, the build step (i.e. "copy") does not automatically follow. I can clean all day, but nothing gets built until I perform a "Build Project" - then I see both my "makeDir" and "copy" targets being executed.

In Eclipse 3.6 and earlier, this worked fine: the clean would trigger the build (i.e. "makeDir" followed by "copy").

What's going on? Is this a bug / new behavior with Eclipse 3.7, or am I missing something?

Thanks
Re: Ant build after clean not triggering [message #761474 is a reply to message #760892] Tue, 06 December 2011 14:21 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
I think it has been fixed as part of https://bugs.eclipse.org/bugs/show_bug.cgi?id=114563. You can find the documentation for this at Workbench User Guide > Getting Started > Ant & external tools tutorial > Ant buildfiles as project builders > Project Builder Ant Targets
Re: Ant build after clean not triggering [message #761601 is a reply to message #761474] Tue, 06 December 2011 18:06 Go to previous messageGo to next message
Michael Rennie is currently offline Michael RennieFriend
Messages: 67
Registered: July 2009
Location: Canada
Member
I think you are right Satyam, it does sound like the problem when we were not correctly setting the build kind when configuring build triggers (part of the fix to https://bugs.eclipse.org/bugs/show_bug.cgi?id=114563)
Re: Ant build after clean not triggering [message #762134 is a reply to message #761601] Wed, 07 December 2011 15:44 Go to previous messageGo to next message
CG Mising name is currently offline CG Mising nameFriend
Messages: 8
Registered: December 2011
Junior Member
Thanks for your responses! Unfortunately, I'm still confused:

* The bug you link says that it was "verified fixed" in 3.7 M6. Does this mean my current version (3.7.1, build id: M20110909-1335) should contain the fix?

* From the user guide you reference:

//////////////////////
After a "Clean"
This build kind is executed after a project has been cleaned via the Project > Clean... command.
After a "Clean" will execute during the next build immediately following the clean regardless of your workspace auto-build settings. If you have workspace auto-build on this will execute automatically following the clean....
//////////////////////

I have the "Project", "Build Automatically" checkbox enabled, but this does not seem to trigger my build to "execute automatically following a clean". I do NOT have anything under the "Auto Build" target in my builder.... is this what you are suggesting I need? Because this option performs behavior that I really don't want (e.g. triggering my "copy" target everytime I touch the file, which is not my intent).

Again, thanks for your comments and any additional clarification you can give.
Re: Ant build after clean not triggering [message #762500 is a reply to message #762134] Thu, 08 December 2011 07:37 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3801
Registered: July 2009
Senior Member
On 07.12.2011 16:44, CG wrote:
> Thanks for your responses! Unfortunately, I'm still confused:
>
> * The bug you link says that it was "verified fixed" in 3.7 M6. Does
> this mean my current version (3.7.1, build id: M20110909-1335) should
> contain the fix?
Yes.

Dani
>
> * From the user guide you reference:
>
> //////////////////////
> After a "Clean"
> This build kind is executed after a project has been cleaned via the
> Project > Clean... command. After a "Clean" will execute during the
> next build immediately following the clean regardless of your
> workspace auto-build settings. If you have workspace auto-build on
> this will execute automatically following the clean....
> //////////////////////
>
> I have the "Project", "Build Automatically" checkbox enabled, but this
> does not seem to trigger my build to "execute automatically following
> a clean". I do NOT have anything under the "Auto Build" target in my
> builder.... is this what you are suggesting I need? Because this
> option performs behavior that I really don't want (e.g. triggering my
> "copy" target everytime I touch the file, which is not my intent).
>
> Again, thanks for your comments and any additional clarification you
> can give.
>
Re: Ant build after clean not triggering [message #768045 is a reply to message #762500] Mon, 19 December 2011 13:37 Go to previous messageGo to next message
CG Mising name is currently offline CG Mising nameFriend
Messages: 8
Registered: December 2011
Junior Member
Dani -- you say "Yes" (i.e. the problem should be fixed in the version I have), but I'm not seeing the behavior I expect (as I describe and you quote without comment in the bottom-most bullet).

Do I misunderstand what the behavior should be? This is definitely a change in behavior from pre-Eclipse-3.7 versions.
Re: Ant build after clean not triggering [message #768510 is a reply to message #768045] Tue, 20 December 2011 09:34 Go to previous message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
This behaviour got introduced in 3.7 along with the said bug. I agree that there is a confusion over what should really happen. https://bugs.eclipse.org/bugs/show_bug.cgi?id=352131 tracks this problem.
Previous Topic:short cut key to navigate to the starting of the loop or an if-else condition
Next Topic:Eclipse exe file publisher information
Goto Forum:
  


Current Time: Mon Jun 25 06:36:50 GMT 2018

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

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

Back to the top