Monday, August 09, 2004

Delays
I've been neglecting the blog over the last few days. Shouldn't bother anyone but me (it'll bother me when I come back later to figure out what I was doing on these days). The main reason for the lack of effort was my lack of progress to report on. The other reason was because Luc is on the verge of teething, and I'm suffering from a proportionate lack of sleep. :-)

Friday
Friday was spent trawling through code, and making few modifications. I did little bits and peices, mostly fixing obvious bugs and documentation, but nothing substantial. The majority of the time was spent reading the ItqlInterpreter class and working out just what it is doing with Constraint objects. All too often I've found that I've started coding before I was really ready, and I'm trying not to this time.

Monday
Monday was spent reviewing the same code. Constraints are badly in need of refactoring. Too many implementations of classes, which leads to some horrible workarounds for subclasses. It needs more interfaces, and the code which uses them needs to refer to these objects by interface references.

I also spent some time setting up Xcode. I'd been looking forward to using Xcode, but hadn't taken the time to set it up or work it out.

Xcode is fine for working with Java, but it doesn't really have full Ant integration. I followed a couple of pages which talk about using Ant, but really all they do is create a blank project, and then set the build command to call Ant instead. This didn't work all that well for Kowari, as it uses its own script called build.sh to launch Ant with a series of required parameters.

I resolved the problems by calling build.sh directly, and by modifying this script to suit my local system. I wouldn't normally want to modify a file in this way, but build.sh is very short, and mostly just manipulates environment variables. The first change was to tell it about my local JAVA_HOME when it's not already set. I do have it set in my bash environment, but it's not global where Quartz applications can pick it up. I've considered doing this with ANT_HOME as well, but since every other system is using the ant-1.6.1 jar in the lib directory of Kowari, I thought it might be safer to just go with that. Mac OSX comes with ant-1.5.3 as part of the J2EE packages, but I've since upgraded it to ant-1.6.2, which should be perfectly compatible with the Kowari version of Ant.

The other change was based on how the building script is called by Xcode. To do an ordinary build, the script is called with no arguments, and to do a "clean" then the script is called with a parameter of "clean". Since the ant script always needs a parameter I needed to test if none was passed to build.sh and if so then pass a parameter of "dist". While I could just change the default in the Ant build.xml file, the build.sh script is a much better place to change it. That's because this script almost never changes, while the build.xml file needs to be updated occasionally by myself and others. Keeping build.xml file untouched allows it to synchronize with CVS much better.

I then learned all about adding files into the project. I started by adding the files I needed manually, but these are so dispersed through the filesystem that I thought there must be a better way. I then found that by adding the directories out of "src" then it recursively picks up everything under it. Of course, if there'd been real Ant integration then it could have found all the files I needed, but this would be a huge amount of work on Apple's part.

I found that I couldn't go adn include to "org" directories which are two layers down from src, as these are not merged. As a result I ended up with several "org" directories with no indication of their contents. Using the directories like "store" is a little annoying, as there are sometimes files in the same package under different directories, and also because I have to go down through directories such as "store/java" to find "org".

At least it seems to know about CVS, as the CVS directories were not imported. Since that is the case I should look to see if I can do updates and commits from teh Xcode GUI.

I like the editing features I now have, particularly the persistent, named bookmarks. Finding files is pretty good too, once you get the hang of it. I'm sure that I'll learn more about the configuration later so I can make editing Kowari easier still. It will be a while before I'm proficient with Xcode though, as I'm still trying to unteach my fingers about vi.

Breakpoints, errors, and the like are unlikely to come naturally, as I think that Xcode is too far removed from the build system at the moment, but as I get more used to it I might see what kind of class path options I have, and whether or not I can tweak it into something more powerful than a fancy editor.

I've already downloaded Xcode 1.5, but I have not played with it yet. It seems to have better Ant support, but from what I understand this is so new projects can be built for Ant. I believe there is little support for importing existing Ant projects.

No comments: