This lesson shows you how to add an Ant script element to publish
the model.
- Because you use the Ant editor for this lesson, close the editor
that opened publish.xml when you created the file.
- In the Project Explorer view, double-click publish.xml. The file opens in the Ant editor, the newly assigned default editor.
- In the Ant editor window, type <pr. The element completion window opens.
- In the element completion window, double-click the <project> element.
- Position the cursor before the closing angle bracket (>)
in <project> and type a space, then default="MyTarget". The entry will look like this:
<project default="MyTarget"></project>
The
value that you assign to default is the name of the target
that you are going to create in the next step.
- Position the cursor before the closing </project> tag
and type <ta.
- In the element completion window, double-click <target>.
Enter MyTarget as the name for the Name attribute. The entry will look like this:
<target name="MyTarget"></target>
- Position the cursor before the closing </target> tag
and type <pu.
- In the element completion window, double-click <PublishModel>.
- Enter the fully qualified path name to SimpleUMLModel as
the value for the modelPath attribute. To find
the path:
- Right-click SimpleUMLModel in the Project Explorer
view, and then click Properties.
- Copy the value of Location and then click Cancel in
the Properties window.
- Paste the location as the value for modelPath.
- In Windows Explorer, create the folders C:\temp\antpub and C:\temp\antrpt. These folders are the output folders for the Ant script, and must exist
before you run the script.
- In the Ant editor, for the value of the outputFolder attribute,
type C:\temp\antpub.
- For the value of the outputFilename attribute,
type index.html.
- Leave the default values for the other attributes. and click to save
the changes.
You could run the Ant script at this point, but let's first define
another element, one for generating a report about the model.