antlets/ruperDepend/src xbuild.xml,NONE,1.1 getdepend.xsl,NONE,1.1
| Newsgroups | gmane.comp.krysalis.metamorphosis.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/metamorphosis/antlets/ruperDepend/src
In directory sc8-pr-cvs1:/tmp/cvs-serv18224/ruperDepend/src
Added Files:
xbuild.xml getdepend.xsl
Log Message:
Initial import for ruperDepend.
--- NEW FILE: xbuild.xml ---
<?xml version="1.0"?>
<!-- $Header: /cvsroot/metamorphosis/antlets/ruperDepend/src/xbuild.xml,v 1.1 2003/12/23 00:40:29 chalko Exp $ -->
<project default="compile" name="ruperDependantlet">
<!-- Antlet Specific Properties -->
<!-- =================================================================== -->
<!-- Download libraries and set lib.classpath -->
<!-- =================================================================== -->
<style basedir="."
out="${temp.dir}/${module.name}.getdepend.xml"
in="module.xml"
style="${core.antlib.dir}/getdepend.xsl">
<param name="projectName" expression="${project.name}"/>
</style>
<import file="${temp.dir}/${module.name}.getdepend.xml"/>
</project>
--- NEW FILE: getdepend.xsl ---
<?xml version="1.0"?>
<!--$Header: /cvsroot/metamorphosis/antlets/ruperDepend/src/getdepend.xsl,v 1.1 2003/12/23 00:40:29 chalko Exp $ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="projectName">
</xsl:param>
<xsl:output method = "xml" indent="yes" encoding="UTF-8" />
<xsl:template match="/">
<project default="getcorelibs" basedir="." >
<xsl:attribute name="name"><xsl:value-of select="$projectName"/>-getcorelibs</xsl:attribute>
<description>Autogenerated Ant build file that downloads
dependencies for the project.</description>
<xsl:apply-templates select="module/jars"/>
<urilist id="supplied.repo" >
<uri >
<xsl:attribute name="url">
<xsl:text>${lib.dir}</xsl:text>
</xsl:attribute>
</uri>
</urilist>
<xsl:apply-templates select="module/project[@name=$projectName]"/>
<property name="lib.export.manifest.classpath" >
<xsl:attribute name="value">${lib.<xsl:value-of select="$projectName"/>.export.manifest.classpath}</xsl:attribute>
</property>
<target >
<xsl:attribute name="name">copy-exported-jars</xsl:attribute>
<mkdir>
<xsl:attribute name="dir">${java.antlib.dist.bin.dir}/lib</xsl:attribute>
</mkdir>
<copy flatten="true">
<xsl:attribute name="toDir">${java.antlib.dist.bin.dir}/lib</xsl:attribute>
<fileset >
<xsl:attribute name="refid">lib.${project.name}.fileset.export.jars</xsl:attribute>
</fileset>
<fileset >
<xsl:attribute name="refid">lib.${project.name}.fileset.export.supplied</xsl:attribute>
</fileset>
<fileset >
<xsl:attribute name="refid">lib.${project.name}.jars</xsl:attribute>
</fileset>
</copy>
</target>
</project>
</xsl:template>
<xsl:template match="/module/project">
<!-- the jars for this project -->
<!-- TODO use the gump jar tag -->
<fileset>
<xsl:attribute name="dir">${build.dir}/</xsl:attribute>
<xsl:attribute name="id">lib.<xsl:value-of select="@name"/>.jars</xsl:attribute>
<include >
<xsl:attribute name="name"><xsl:value-of select="@name"/>/<xsl:value-of select="@name"/>*.jar</xsl:attribute>
</include>
</fileset>
<ruperDepend >
<xsl:attribute name="basename">
<xsl:text>lib.</xsl:text><xsl:value-of select="@name"/>
</xsl:attribute>
<xsl:apply-templates select="depend[not(@project=/module/project/@name)]"/>
</ruperDepend>
<path>
<xsl:attribute name="id"><xsl:value-of select="@name"/>.classpath</xsl:attribute>
<path>
<xsl:attribute name="refid">lib.<xsl:value-of select="@name"/>.classpath</xsl:attribute>
</path>
<fileset dir=".">
<include >
<xsl:attribute name="name">${lib.dir}/**/*.jar</xsl:attribute>
</include>
</fileset>
<xsl:for-each select="depend[@project=/module/project/@name]">
<path >
<xsl:attribute name="location"><xsl:text>${build.dir}</xsl:text>/<xsl:value-of select="@project"/>/classes</xsl:attribute>
</path>
</xsl:for-each>
</path>
</xsl:template>
<xsl:template match="/module/project/depend">
<depend >
<xsl:attribute name="project">
<xsl:value-of select="@project"/>
</xsl:attribute>
<xsl:attribute name="version">
<xsl:value-of select="@version"/>
</xsl:attribute>
<xsl:attribute name="export">
<xsl:value-of select="@export"/>
</xsl:attribute>
<xsl:attribute name="repository">
<xsl:choose>
<xsl:when test="@version='supplied'">supplied.repo</xsl:when>
<xsl:when test="@repository">
<xsl:value-of select="@repository"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/module/jars[1]/@repository"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</depend>
</xsl:template>
<xsl:template match="/module/jars">
<urilist >
<xsl:attribute name="id">
<xsl:value-of select="@repository"/>
</xsl:attribute>
<uri>
<xsl:attribute name="url">
<xsl:value-of select="@url"/>
</xsl:attribute>
</uri>
<uri>
<xsl:attribute name="url"><xsl:value-of select="@url"/>/%{name}/jars</xsl:attribute>
</uri>
<uri>
<xsl:attribute name="url"><xsl:value-of select="@url"/>/%{name}</xsl:attribute>
</uri>
</urilist>
</xsl:template>
</xsl:stylesheet>
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click