<?xml version="1.0" ?>
<!--
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="log4net-samples" default="compile" xmlnds="http://tempuri.org/nant-vs.xsd">
    <!-- Include configuration file -->
    <include buildfile="nant.config" />
    <!-- Include log4net helpers -->
    <include buildfile="${log4net.basedir}/log4net.include" />
    <!-- Targets that should always be executed -->
    <call target="set-build-configuration" />
    <call target="set-${project.runtime.config}-${project.runtime.version}-runtime-configuration" />
    <!-- Target for compiling the example -->
    <target name="compile" description="Builds the example" depends="check-current-bin-dir, check-current-build-defines, check-current-build-config, check-current-build-debug, check-log4net-assembly">
        <!-- make sure the binaries directory for the WebApp exists and is cleaned -->
        <delete dir="src/bin" if="${directory::exists('src/bin')}" />
        <mkdir dir="src/bin" />
        <!-- copy log4net build output -->
        <copy todir="src/bin">
            <fileset basedir="${log4net.output.dir}">
                <include name="*.*" />
            </fileset>
        </copy>
        <!-- build SharedModule assembly -->
        <nant buildfile="../../../Repository/SharedModule/cs/nant.build" target="compile" inheritall="true" />
        <!-- build SimpleModule assembly -->
        <nant buildfile="../../../Repository/SimpleModule/cs/nant.build" target="compile" inheritall="true" />
        <!-- copy SharedModule build output -->
        <copy todir="src/bin">
            <fileset basedir="../../../Repository/SharedModule/cs/${current.bin.dir}">
                <include name="*.*" />
            </fileset>
        </copy>
        <!-- copy SimpleModule build output -->
        <copy todir="src/bin">
            <fileset basedir="../../../Repository/SimpleModule/cs/${current.bin.dir}">
                <include name="*.*" />
            </fileset>
        </copy>
        <!-- compile the example -->
        <csc noconfig="true" target="library" warnaserror="true" debug="${current.build.debug}" define="${current.build.defines.csc}" output="src/bin/WebApp.dll">
            <sources>
                <include name="src/**/*.cs" />
            </sources>
            <references>
                <include name="src/bin/SharedModule.dll" />
                <include name="src/bin/SimpleModule.dll" />
                <include name="src/bin/log4net.dll" />
                <include name="System.dll" />
                <include name="System.Data.dll" />
                <include name="System.Drawing.dll" />
                <include name="System.Web.dll" />
            </references>
        </csc>
    </target>
    <!-- Target for updating the AssemblyVersionInfo -->
    <target name="update-version-info" depends="check-log4net-basedir">
        <copy file="${log4net.basedir}/src/AssemblyVersionInfo.cs" todir="src" overwrite="true" />
    </target>
</project>
