Bug 76104 - can't build distribution from within Eclipse
Summary: can't build distribution from within Eclipse
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.2.1 M1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.2.1   Edit
Assignee: George Harley CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-12 12:57 EDT by Mik Kersten CLA
Modified: 2004-10-21 04:31 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mik Kersten CLA 2004-10-12 12:57:57 EDT
I tend to rely on the automated build system, but when it was failing a couple 
of weeks ago noticed that I can no longer build AspectJ wrom within Eclipse.  
I can still build it from the command line.  Below is the failure message.  I 
spent a little time modifiying build-properties.xml and the other stuff having 
to do with the version check, but didn't succeed at fixing this.

I think that it is important for our build.xml file to work properly with no 
additional setup when all of AspectJ is checked out, both from within Eclipse 
and from the command line.

version-uptodate:
BUILD FAILED: C:\Dev\aspectj-workspace\build\build.xml:61: writing 
C:\Dev\aspectj-workspace\aj-build\temp\versionUptodate
BUILD FAILED: C:\Dev\aspectj-workspace\build\build.xml:358: Following error 
occured while executing this line
C:\Dev\aspectj-workspace\build\build.xml:61: writing C:\Dev\aspectj-
workspace\aj-build\temp\versionUptodate
Total time: 2 seconds
Comment 1 Andrew Clement CLA 2004-10-14 06:04:40 EDT
There seems to be a confusing situation in the build-properties.xml which
contains some of the ant tasks.

Here is the clean-directories target:

<target name="clean-directories" 
     depends="init-directories"
      unless="clean-directories.done" >
  <property name="clean-directories.done" value="done"/>
  <delete quiet="on" dir="${aj.build.dir}" /> <!-- warning if not deleted? -->
  <antcall target="init-directories"/>
  <!-- aj.results.dir is not cleaned -->
</target>

It aims to delete the aj.build.dir which usually points to blahblah/aj-build.
Now before it does the delete it depends on init-directories which creates
all the sub-directories under aj-build.  When init-directories finishes it
sets a property init-directories.done so that it doesn't do it again.  So prior
to the clean-directories target running we have created the aj-build/*
directories, we then delete all the directories under aj-build/* and call
init-directories again.  because init-directories already ran and set the
init-directories.done property, we don't rebuild them.  This causes us to fail
with the error Mik is seeing because it is trying to write the versionuptodate
file into the aj-build/temp directory which doesn't exist.

The fix seems straightforward.  Because init-directories is 'harmless' really,
it just does a bunch of mkdirs, I will take the guard off that says do it only
if init-directories.done is set.

In fact, with the fix in place *I* can build aspectj inside Eclipse, something
I've never ever ever been able to do.

Mik - can you try it and let me know if it works for you?
Comment 2 Mik Kersten CLA 2004-10-14 17:19:22 EDT
Yay, I can build!  I can build!
Comment 3 Adrian Colyer CLA 2004-10-21 04:31:53 EDT
Fix released as part of AspectJ 1.2.1