The command line interface and bootstrapping

Introduction to the iwant cli and bootstrapping

Since a build system is so integral a part of a reproducible build, each project that uses iwant defines the exact version of iwant to use. To achieve this, the command line interface of iwant is a very shallow bootstrapper that only knows how to download and build the actual iwant engine and delegates the actual work to it.

The bootstrapper contains two command line interfaces: a bash script and an ant script. They both do the same thing: they compile and run the third part of the bootstrapper, a java class. This java class is the entry to iwant.

The entry class makes (if necessary, of course) an svn checkout of the requested version of iwant code and compiles and runs the next phase of bootstrapping, called entry2.

The entry2 phase compiles the full iwant system it itself is part of and runs the actual entry to the system, called entry3.

If in any of the bootstrapping phases some configuration is missing, the bootstrapper acts as a wizard that helps the user in creating the configuration.

In this tutorial we'll be mostly using the bash interface. The Ant cli chapter gives a short introduction to the ant command line interface.


Let's see how all this works in practice.

First we'll create a directory for our project workspace.

~ $ mkdir iwant-tutorial
~ $ cd iwant-tutorial

Then we acquire the iwant command line interface, or bootstrapper, by svn exporting it. In this tutorial we use revision 885, but you may want to use a newer revision or to omit the -r option to get the latest revision.

~/iwant-tutorial $ svn export -r 885 as-iwant-tutorial-developer
A as-iwant-tutorial-developer
A as-iwant-tutorial-developer/with
A as-iwant-tutorial-developer/with/java
A as-iwant-tutorial-developer/with/java/net
A as-iwant-tutorial-developer/with/java/net/sf
A as-iwant-tutorial-developer/with/java/net/sf/iwant
A as-iwant-tutorial-developer/with/java/net/sf/iwant/entry
A as-iwant-tutorial-developer/with/ant
A as-iwant-tutorial-developer/with/ant/iw
A as-iwant-tutorial-developer/with/bash
A as-iwant-tutorial-developer/with/bash/iwant
A as-iwant-tutorial-developer/with/java/net/sf/iwant/entry/
A as-iwant-tutorial-developer/with/ant/iw/build.xml
A as-iwant-tutorial-developer/with/bash/iwant/
Exported revision 885.
Output asserted

Choosing url for iwant to use as engine

Now we are ready to make our first wish. By using the code completion feature (tab) of bash, we see that the only wish available is 'help':

~/iwant-tutorial $ as-iwant-tutorial-developer/with/bash/iwant/
I created /home/hacker/iwant-tutorial/as-iwant-tutorial-developer/i-have/conf/iwant-from
Please edit it and rerun me.
Output asserted

Since we just started creating our workspace, the wizard starts helping us. We follow its advice by choosing a revision of iwant and asking for help again. Note: here it is not wise to leave the revision out.

~/iwant-tutorial $ $EDITOR "as-iwant-tutorial-developer/i-have/conf/iwant-from"
# uncomment and optionally change the revision:
~/iwant-tutorial $ as-iwant-tutorial-developer/with/bash/iwant/
I created /home/hacker/iwant-tutorial/as-iwant-tutorial-developer/i-have/conf/ws-info
Please edit it and rerun me.
Output asserted

We will continue defining the workspace in a separate chapter. The next chapter shows an alternative way of acquiring the bootstrapper using svn:externals, a handy mechanism for projects that use svn for version control.