Skip to main content

Source code file content

Revision: 64243 (of 64243)

setting clean revision
» Project Revision History

» Checkout URL

svn / tags / source-build-3.0.1 / build-taskdefs.xml

Size: 6070 bytes, 1 line
<?xml version="1.0" encoding="iso-8859-1"?>

<project name="Source build shared task definitions" basedir="." xmlns:artifact="urn:maven-artifact-ant" >

    <property file="${basedir}/build.properties"/>
    <import file="build.xml"/>

    <macrodef name="build.jar.from.srczip">
       <attribute name="jar"/>
       <attribute name="srczip"/>
       <attribute name="unzipdir"/>
       <attribute name="srcdir"/>
       <attribute name="cp" default=""/>
       <sequential>
            <mkdir dir="@{unzipdir}"/>
            <unzip src="@{srczip}" dest="@{unzipdir}/@{srcdir}"/>

            <property name="build.dir" value="@{unzipdir}/build"/>
            <mkdir dir="${build.dir}" />

            <mkdir dir="@{unzipdir}/@{srcdir}" />
            <javac srcdir="@{unzipdir}/@{srcdir}" debug="true" destdir="${build.dir}" source="1.5" target="1.5" classpath="@{cp}"/>

            <jar jarfile="@{jar}" compress="false">
                <fileset dir="${build.dir}" />
                <fileset dir="@{unzipdir}/@{srcdir}">
                    <patternset>
                        <include name="**/*.properties" />
                        <include name="**/*.rxm"/>
                        <include name="**/*.dtd"/>
                        <include name="**/*.rng"/>
                        <include name="**/*.mod"/>
                    </patternset>
                </fileset>
            </jar>
            <delete dir="${build.dir}" />
       </sequential>
    </macrodef>

    <macrodef name="mvn.publish.local">
       <attribute name="jar"/>
       <attribute name="mvngroup"/>
       <attribute name="mvnartid"/>
       <attribute name="mvnversion"/>
       <attribute name="mvnclassifier" default="" />
       <attribute name="extra-args" default="" />
       <attribute name="generatepom" default="true" />
       <sequential>
            <exec executable="mvn" failonerror="true" >
                <arg line="-Dmaven.repo.local=${maven.repo.local}" />
                <arg line="install:install-file" />
                <arg line="-Dfile=@{jar}" />
                <arg line="-DgroupId=@{mvngroup}" />
                <arg line="-DartifactId=@{mvnartid}" />
                <arg line="-Dpackaging=jar" />
                <arg line="-Dversion=@{mvnversion}" />
                <arg line="-Dclassifier=@{mvnclassifier}" />
                <arg line="-DgeneratePom=@{generatepom}" />
                <arg line="-DlocalRepositoryPath=${maven.repo.local}" />
                <arg line="@{extra-args}" />
            </exec>
       </sequential>
    </macrodef>

    <macrodef name="mvn.publish.remote">
       <attribute name="jar"/>
       <attribute name="mvngroup"/>
       <attribute name="mvnartid"/>
       <attribute name="mvnversion"/>
       <attribute name="mvnclassifier" default="" />
       <attribute name="extra-args" default="" />
       <sequential>
            <exec executable="mvn" failonerror="true" >
                <arg line="-Dmaven.repo.local=${maven.repo.local}" />
                <arg line="deploy:deploy-file" />
                <arg line="-Dfile=@{jar}" />
                <arg line="-Durl=${project.maven.repo} "/>
                <arg line="-DrepositoryId=${project.maven.repo.id}" />
                <arg line="-DgroupId=@{mvngroup}" />
                <arg line="-DartifactId=@{mvnartid}" />
                <arg line="-Dversion=@{mvnversion}" />
                <arg line="-Dclassifier=@{mvnclassifier}" />
                <arg line="-Dpackaging=jar" />
                <arg line="@{extra-args}" />
            </exec>
       </sequential>
    </macrodef>

    <macrodef name="cvs.checkout">
       <attribute name="tag" default="HEAD"/>
       <attribute name="repo"/>
       <attribute name="dest"/>
       <attribute name="module"/>
       <sequential>
            <echo message="checkout @{module} from @{repo}"/>
            <exec executable="cvs" dir="${external.dir}" failonerror="true" >
                <arg line="-q -d @{repo}" />
                <arg line="checkout" />
                <arg line="-r @{tag}" />
                <arg line="-d @{dest}" />
                <arg line="@{module}" />
            </exec>
       </sequential>
    </macrodef>

    <macrodef name="svn.checkout">
       <attribute name="tag"/>
       <attribute name="repo"/>
       <attribute name="dest"/>
       <sequential>
            <echo message="svn checkout from @{repo}"/>
            <exec executable="svn" dir="${external.dir}" failonerror="true" >
                <arg line="checkout" />
                <arg line="-r @{tag}" />
                <arg line="@{repo}" />
                <arg line="@{dest}" />
            </exec>
       </sequential>
    </macrodef>

    <macrodef name="hg.clone">
       <attribute name="tag"/>
       <attribute name="repo"/>
       <attribute name="dest"/>
       <sequential>
            <echo message="hg clone from @{repo} with tag @{tag}"/>
            <exec executable="hg" dir="${external.dir}" failonerror="false" >
                <arg line="clone" />
                <arg line="@{repo}" />
                <arg line="@{dest}" />
            </exec>
            <exec executable="hg" dir="${external.dir}/@{dest}" failonerror="true" >
                <arg line="pull"/>
            </exec>
            <exec executable="hg" dir="${external.dir}/@{dest}" failonerror="true" >
                <arg line="update" />
                <arg line="-r @{tag}" />
            </exec>
       </sequential>
    </macrodef>

    <target name="bnd.download" >
	<path id="maven-ant-tasks.classpath" path="${maven.ant.tasks.jar}" />
	<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
	<artifact:dependencies pathId="bnd.classpath">
	   <remoteRepository  id="bnd.repo" url="${bnd.repository}"/>
	   <localRepository  path="${maven.repo.local}" />
	   <dependency groupId="${bnd.groupid}" artifactId="${bnd.artifactid}" version="${bnd.version}" scope="compile"/>
	</artifact:dependencies>
    </target>

</project>
 
 
Close
loading
Please Confirm
Close