Information Technology Reference
In-Depth Information
The last build activity shown in Figure 4-2 is for deployment. List-
ing 4-6 illustrates the use of a NAnt task for a simple deployment to an
FTP server.
LISTING 4-6
Deployment Using FTP and NAnt
<target name="deploy">
<connection id="staging"
server="devqa.ib.com"
username="helloworld"
password="myftppwd" />
<ftp connection="staging"
remotedir="incoming"
localdir="c:\dev\project\acme">
<put type="bin">
<include name="${build.dir}\bin\${config}\${project}.dll" />
</put>
</ftp>
</target>
If a build script is executed by a developer without any feedback,
she will not know whether the build succeeded or failed. A very simple
example of a failure notification is included in Listing 4-4. If any test
run by the nunit2 task fails, then the entire build is considered a fail-
ure. In fact, NAnt will end the build with a glaring BUILD FAILED mes-
sage so there won't be any doubts.
This is by no means an exhaustive example of a build script. The
benefits of a build script that fully enables the Integrate button would
need to incorporate many more processes and paths. 3
Separate Build Scripts from Your IDE
You should avoid coupling your build scripts with an IDE. An IDE
may be dependent on a build script, but a build script shouldn't be
dependent on your IDE. Figure 4-3 illustrates the proper dependency.
This dependency is sometimes more subtle than you may think. For
3. For more on this topic, see the topic's companion Web site:
www.integratebutton.com/.
 
Search WWH ::




Custom Search