<?xml version="1.0" encoding="UTF-8"?>
<!--
 ! Licensed to the Apache Software Foundation (ASF) under one
 ! or more contributor license agreements.  See the NOTICE file
 ! distributed with this work for additional information
 ! regarding copyright ownership. The ASF licenses this file
 ! to you under the Apache License, Version 2.0 (the
 ! "License"); you may not use this file except in compliance
 ! with the License. You may obtain a copy of the License at
 !
 !      http://www.apache.org/licenses/LICENSE-2.0
 !
 ! Unless required by applicable law or agreed to in writing, software
 ! distributed under the License is distributed on an "AS IS" BASIS,
 ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ! See the License for the specific language governing permissions and
 ! limitations under the License.
 !-->
<project name="hudson" basedir="."
    xmlns:as="antlib:org.codehaus.mojo.animal_sniffer" >

    <ant>
        <target name="get-dep-libs"/>
    </ant>
    
    <target name="verify" depends="river-runtime,verify-15-sun"
                                description="River-verify entry">
    </target>

    <target name="river-trunk" description="River-trunk entry">
        <ant>
            <target name="hudson-ci" />
        </ant>
    </target>

    <typedef uri="antlib:org.codehaus.mojo.animal_sniffer">
        <classpath>
            <fileset dir="dep-libs/animal-sniffer">
                <include name="**/*.jar"/>
            </fileset>
            <fileset dir="dep-libs/asm">
                <include name="**/*.jar"/>
            </fileset>
        </classpath>
    </typedef>

    <target name="river-runtime" >
        <ant>
            <target name="clean" />
        </ant>
        <ant>
            <target name="river-runtime" />
        </ant>
    </target>

    <macrodef name="verify-signature">
        <attribute name="signature" />
        <sequential>
            <as:check-signature signature="@{signature}" >
                <path path="dep-libs/asm/asm-tree-3.2.jar" />
                <path path="lib" />
                <path path="lib-dl" />
                <ignore className="org.apache.velocity.app.VelocityEngine"/>
                <ignore className="org.apache.velocity.VelocityContext"/>
                <ignore className="org.apache.velocity.Template"/>
            </as:check-signature>
        </sequential>
    </macrodef>

    <target name="verify-14">
        <!--
        <verify-signature signature="dep-libs/animal-sniffer/java14-1.0.signature" if="sig-java14-avail"/>
        -->
        <echo>
            Signature checking is disabled because the signature isn't present.
            It should be available in the next release.
        </echo>
    </target>

    <target name="verify-14-sun" >
        <!--
        <verify-signature signature="dep-libs/animal-sniffer/java14-sun-1.0.signature" />
        -->
        <echo>
            Signature checking is disabled because the signature isn't present.
            It should be available in the next release.
        </echo>
    </target>

    <target name="verify-15" >
        <!--
        <verify-signature signature="dep-libs/animal-sniffer/java15-1.0.signature" />
        -->
        <echo>
            Signature checking is disabled because the signature isn't present.
            It should be available in the next release.
        </echo>

    </target>

    <target name="verify-15-sun" >
        <!--
        <verify-signature signature="dep-libs/animal-sniffer/java15-sun-1.0.signature" />
        -->
        <echo>
            Signature checking is disabled because the signature isn't present.
            It should be available in the next release.
        </echo>
        
    </target>

    <target name="verify-15-ibm" >
        <!--
        <verify-signature signature="dep-libs/animal-sniffer/java15-ibm-1.0.signature" />
        -->
        <echo>
            Signature checking is disabled because the signature isn't present.
            It should be available in the next release.
        </echo>
        
    </target>

    <target name="qa-runtime" description="build QA runtime" >
        <ant dir="qa" inheritall="false">
            <target name="clean" />
            <target name="harness-runtime" />
        </ant>
        <delete file="harness-runtime.jar" />
        <jar destfile="harness-runtime.jar" index="false">
            <fileset dir=".">
                <include name="lib/**" />
                <include name="lib-dl/**"/>
                <include name="lib-ext/**"/>
                <include name="qa/lib/**" />
                <include name="qa/lib-ext/**"/>
            </fileset>
        </jar>
    </target>

    <target name="run-qa" description="execute QA test" >
        <property name="harness-runtime-src" value="https://hudson.apache.org/hudson/pview/job/River-QA-runtime/lastSuccessfulBuild/artifact/jtsk/trunk/harness-runtime.jar" />
        <property name="harness-runtime-dst" value="harness-runtime.jar" />
        
        <get src="${harness-runtime-src}" dest="${harness-runtime-dst}" />
        <unzip src="${harness-runtime-dst}" dest="." />
        <ant dir="qa" target="run-categories" inheritall="false">
            <property name="run.categories" value="id,loader,policyprovider,locatordiscovery,activation,config,discoverymanager,joinmanager,url,iiop,jrmp,reliability,thread,renewalmanager,constraint,export,lookupdiscovery,servicediscovery,io,security,lookupservice,renewalservice,eventmailbox,jeri,start,discoveryservice,discoveryproviders,javaspace,txnmanager"/>
        </ant>
    </target>



</project>
