targets/targetdefs

On the main build there was a reference to the targets

  | <build id="JBossAS" 
  | ...
  |           targetdefs="targets">
  | 

This defines a list of targetdefs and what each should do on the different 
portions
of the build

main - the top level integration build
component - a component project
common - convenience type when main and component are the same
source - source targets, e.g. compilation
artifact - these are per artifact type so you actually see jar and api rather 
than
artifact

Take a simple example:

  |       <!-- Clean the output -->
  |       <targetdef target="clean" description="Clean">
  |          <common>
  |             <delete dir="@{output}"/>
  |          </common>
  |       </targetdef>
  | 

This says for top level and component builds we delete the output directory

More complicated

  | 
  |       <!-- Build the release -->
  |       <targetdef target="release">
  | 
  |          <!-- Copy the artifact into the release -->
  |          <artifact when="@{release}">
  |             <mkdir dir="@{release}"/>
  |             <copy todir="@{release}">
  |                <output/>
  |             </copy>
  |          </artifact>
  |       </targetdef>
  | 

For each artifact that has a release attribute, we copy it to that release 
location

Probably the most complicated?

  | 
  |       <!-- Build -->
  |       <targetdef target="build" description="Build">
  | 
  |          <!-- Build the main release -->
  |          <main>
  |             <mkdir dir="@{releaseDir}"/>
  |             <antCall target="release"/>
  |          </main>
  | 
  |          <!-- Build the component -->
  |          <component>
  |             <mkdir dir="@{output}"/>
  |          </component>
  | 
  |          <!-- Compile the source -->
  |          <source>
  |             <mkdir dir="@{output}"/>
  |             <depend srcdir="@{sourcePath}" destdir="@{output}">
  |                <classpath>
  |                   <pathelements/>
  |                </classpath>
  |             </depend>
  |             <javac srcdir="@{sourcePath}" destdir="@{output}">
  |                <classpath>
  |                   <pathelements/>
  |                </classpath>
  |             </javac>
  |          </source>
  | 
  |          <!-- Create a jar archive -->
  |          <jar>
  |             <mkdir dir="@{parentDir}"/>
  |             <jar destfile="@{output}">
  |                <filesets/>
  |             </jar>
  |          </jar>
  |       </targetdef>
  | 

On the top level build we create the release
The component level is trivial
The source level is just to compile it
The artifact level involves jaring the referenced source classes

The artifact definition

  |       <source id="main">
  |          <include input="test1.jar"/>
  |          <include input="jboss-common.jar"/>
  |       </source>
  |       <artifactdef artifact="test2.jar">
  |          <include input="main"/>
  |       </artifactdef>
  | 

The source has an id main which the jar includes as its input

The targetdef:

  |          <jar>
  |             <mkdir dir="@{parentDir}"/>
  |             <jar destfile="@{output}">
  |                <filesets/>
  |             </jar>
  |          </jar>
  | 

This says take all the files sets that are the input to a jar artifact
Each 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3860513#3860513

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3860513


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to