Database Reference
In-Depth Information
Trying Your First Build
To try out the build, all you need to do is click on the Build Now link in the left-hand
side list of links, A progress bar will appear under the Build History heading, and a few
seconds later, the build will be complete and a link to the finished build will appear in
the history. If you click on the link, and then click on Console Output link on the next
page, you can see what happened under the covers.
Started by user anonymous
[BuggyWhipBuild] $ cvs -Q -z0 -d /usr/local/CVS co -P \
-d workspace -D "Monday, July 11, 2011 12:40:39 AM UTC" buggywhipchat
$ no changes detected
Finished: SUCCESS
Since all the job did was to check the sources out of CVS, there wasn't much excitement
to be seen. If you look in your home directory, you will see a hidden directory
called .hudson . Walking down the directories to .hudson/jobs/BuggyWhipBuild/work-
space , you'll see a copy of your project checked out and waiting for you to build it. So
now we're set to actually start playing with Xcode and making some apps!
Creating an Ant Build File
As has been previously mentioned, Hudson prefers to use Ant as the build tool to build
projects. That's not to say that this is your only choice: you could almost as easily use
GnuMake or any other tool that can be executed from the command line. But really,
there's no reason not to use Ant, unless you're violently opposed to it for some reason.
As opposed to gmake, which tends to be finicky on random characters in the file and
can be a bit arcane to understand, Ant uses XML files that can be edited and validated
in any standard XML editor. It will also make all your Java friends happy, because Ant
is the build tool of choice for Java.
Ant build files can get quite complex, but they don't need to. All you really need is a
single file called build.xml , and that's the file we're about to create. Example 3-1 shows
a very simple build.xml file that does absolutely nothing.
Example 3-1. A simple build file
<?xml version="1.0" encoding="utf-8"?>
<project name="Buggy Whip Builder" default="debugbuild" basedir=".">
<target name="debugbuild">
<echo message="Debug Build Will Go Here"/>
</target>
</project>
Let's break the file down line by line. The first line is a standard XML header. The next
line, which uses the project tag, defines the name of the project that is associated with
this build file, the default target ( debugbuild ) that the file builds if given no arguments,
and the base directory that all commands will be executed relative to.
 
Search WWH ::




Custom Search