Antlion
Welcome
License
 
How-To Guides
Getting Started
Libraries
Artifacts
Subprojects
Repositories
Policy Strategies
Format Strings
Extending Antlion
FAQ
 
Tutorials
First Tutorial: Simple
 
Ant Tasks
<artifact>
<libraryDef>
<library>
<library-policy>
inner processors
inner repositories
<library-type>
<library-repository>
<library-urlrepository>
<library-mavenrepository>
<library-repositoryset>
<create-artifact>
<subprojects>
<run-subproject>
<replace-target>
 
Optional Tasks
About optional tasks
RegexpTokenFormatter
 
Prev   Next  
Describing What You Export

For multi-project builds, a common technique allows for importing build file pieces that reference what each project builds, called "artifacts:"

File: artifact.xml

<project name="project-artifact">
  <artifact id="art.project.jar" target="jar"
      name="project.jar" artifact="exports/myproject.jar"
      policyRef="policy">
    <src>
      <include name="src/java/**" />
      <exclude name="src/java/**/package.html" />
    </src>
    <depends name="build">
        <library refid="lib.log4j.1.2.7" />
        <library id="lib.project-jar.xalan" org="apache">
            <lib-entry group="xerces" name="xmlParserApis"
                version="2.6.2" />
            <lib-entry group="xalan" name="xalan"
                version="2.5.0" />
        </library>
    </depends>
    <depends name="test">
        <library refid="lib.log4j.1.2.7" />
        <library refid="lib.junit.3.8.1" />
        <library refid="lib.project-jar.xalan" />
        <lib-entry org="apache" group="xerces" name="xercesImpl"
            version="2.6.2" />
    </depends>
  </artifact>
</project>

File: build.xml

<project name="project">
  <import file="artifact.xml" />
  :
  <target name="jar" depends="compile">
    <jar destfile="${artifact.project.jar}" basedir="work/classes" />
  </target>
  
  <target name="compile">
    <mkdir dir="work/classes" />
    <javac destdir="work/classes">
      <srcpath>
        <fileset refid="fileset.artifact.project.jar" />
      </srcpath>
      <classpath refid="path.art.project.jar.build" />
    </javac>
  </target>
</project>


Depending On An Artifact

Artifacts help the project describe what it generates, but it also tells other projects how it gets generated, and where to find that generated file.

This topic is fully covered in the Subprojects discussion.


Prev   Next  
Document version $Revision: 1.4 $ $Date: 2005/09/24 03:57:57 $

SourceForge Logo
Copyright © 2004-2006, The Antlion Project