|
Links Home Mighty Automated Build (MAB) MAB Overview Setting Up Configure and Build Mighty Automated Deployment (MAD) MAD Overview For Developers For Administrators External links ArchStudio 3 xADL 2.0 Site Official xArch Site UCI Institute for Software Research |
Mighty Automated Build - Configuring and Building This section assumes that you have already done everything in the previous section. Now that you have the MAB stub script in Step 1: Choose a short name for your product. This is a one-word, all-lowercase designation
for your product that will be the name of its .zip file and top-level
directory. We will call our hypothetical product Step 2: Create a properties file. This is an ordinary text
file in Step 3: Write the Choose a full name for your project; this is the proper name
for the product you're building. In this case, we'll choose
project.longname= My Sample Java Product Step 4: Write the Here, we indicate the names of the top-level packages that will be
included in the build. These should be the names of subdirectories of
prod_dir/ | +-package1/ | | | +-subpackage2/ | | | | | +-SomeClass.java | | | +-SomeOtherClass.java | +-package2/ | +-SomeThirdClass.javaThen the top-level packages are "package1" and "package2". These are all specified in the property separated by colons ( :). If
you are following the Java package naming conventions, then these
will likely be things like edu and com. Of
course, almost nobody follows these conventions. So, we specify
the top-level packages property for our hypothetical project as follows:
project.toplevelpackages=package1:package2 Step 5: Write the This step is optional, but recommended. If you do not write an
output.directory=/home/edashofy/builds/ On Windows, it will be something like this (remember, double-backslashes!): output.directory=C:\\Builds\\Make sure you have a slash or backslash at the end of the pathname, as is appropriate for your platform. Step 6: Write a This step is optional, but recommended. The
project.description = This is a really cool Java \
project that you should download \
and use.
Step 7: Write a This step is optional. The
mab.javadoc.params=-author \
-footer "(C)2003 My Corporation. All Rights Reserved ." \
-package \
-link http://java.sun.com/j2se/1.4/docs/api/
Step 8: Write a This step is optional. If you want to include a
manifest file
in the .jar file that will be built, then you can specify its name here.
It should be placed in mab.jar.manifest=manifest.txt Step 9: Write a This step is optional. If your software requires third-party
libraries that ship as The An example of this property if your directory were called
mab.mixlibs=mixlibs Step 10: Write a This is a bit harder to explain. Recall from the previous section that the default output of MAB is a file structure that looks like this:
build_dir/
|
+-myproduct.zip
| (contains contents of myproduct directory,
| below)
|
+-myproduct/
|
+-doc/
| |
| +-(contains javadoc documentation)
|
+-lib/
| |
| +-myproduct.jar
| (contains .class files and resources)
|
+-src/
|
+-(contains source files)
We want to be able to include additional static files in the
build and also perhaps some new directories. Let's assume
we have written a shellscript called
prod_dir/
|
+-(other contents omitted for space)
|
+-mixin/
|
+-LICENSE.TXT
|
+-bin/
|
+-runmyproduct.sh
We then specify the name of the mixin directory in the
mab.mixin=mixin Step 11: Write This step is optional, and most users will not need these properties. These
properties allow you to specify the names of additional auxiliary Ant files with
default tasks to run at different points in the build process, namely right before
the class files are JARed, right after the class files are JARed, and after the
build is complete. This is useful for integrating
specialized tasks into the build process. For instance, you might create a
file called
<?xml version="1.0"?>
<project name="signjar" default="signit" basedir=".">
<target name="signit">
<signjar jar="${outroot}/lib/${project.name}.jar"
storepass="seekrit"
alias="keyalias"/>
</target>
</project>
This task digitally signs the JAR file and is run after the JAR file has
been created. So, the mab.task.postjar=signjar.xml Step 12: Save and check your properties file. This exhausts the currently supported properties in MAB. Additional properties may become available as MAB evolves and will be documented here. An example properties file for our hypothetical product might look like:
# Build properties for MyProduct
project.longname= My Sample Java Product
project.toplevelpackages=package1:package2
project.description = This is a really cool Java \
project that you should download \
and use.
output.directory=/home/edashofy/builds/
mab.jar.manifest=manifest.txt
mab.javadoc.params=-author \
-footer "(C)2003 My Corporation. All Rights Reserved ." \
-package \
-link http://java.sun.com/j2se/1.4/docs/api/
mab.task.postjar=signjar.xml
This completes the configuration of MAB. Now you can run it to build your product. Step 13: Run MAB and build. Since MAB is just an Ant script, running MAB really means running Ant.
Make sure that the If you have everything set up, open a command prompt and change directory
to ant -Dproject.name=product_short_name So, for our hypothetical product, we would run: ant -Dproject.name=myproduct Note that you must be connected to the Internet for this to work, because the MAB stub script does not actually do the building. Rather, it retrieves the actual MAB build script from this website using an HTTP GET request and then passes control to that script. This ensures that you always have the latest MAB build script, even if we add features or fix bugs in the script, without you specifically having to download it or have us notify you when the script changes. The build process should begin. Errors, warnings, etc. will
be output to standard output. If the build is successful, the
built software should appear in That's It! That's all there is to MAB. If you have questions or comments about MAB, please email Eric Dashofy. |