blob: e37f67a84b5f06705a95e255e39026498520e3bd [file] [log] [blame]
<?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-examples" default="compile-all" xmlns="http://tempuri.org/nant-vs.xsd">
<!--
This buildfiles is there to compile all examples in log4net's
CI system to make we didn't break them, it will not create usable
executables.
-->
<property name="log4net.basedir" value="." readonly="false" />
<property name="project.build.config" value="debug" readonly="false" />
<property name="project.build.package" value="false" readonly="false" />
<property name="current.assembly" value=""/>
<!-- Include log4net helpers -->
<include buildfile="${log4net.basedir}/src/buildsupport/log4net.include" />
<include buildfile="${log4net.basedir}/src/buildsupport/multi-framework-compilation.include" />
<!-- Targets that should always be executed -->
<property name="bin.dir" value="${build.dir}/bin/examples/cs"/>
<call target="set-build-configuration" />
<call target="set-framework-configuration" />
<!-- Target for compiling the examples on all frameworks -->
<target name="compile-all"
description="Builds all log4net extamples"
depends="-compile-all"/>
<target name="-compile-for-one-framework" depends="check-log4net-basedir, clean-current-bin-dir, check-log4net-assembly">
<!-- this compiles .exes as .dlls because all that matters is it
compiles -->
<property name="current.bin.dir" value="${bin.dir}/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}"/>
<foreach item="String" delim=","
in="Layouts/SampleLayoutsApp,Tutorials/ConsoleApp,Performance/NotLogging,Remoting/RemotingClient,Remoting/RemotingServer,Repository/SharedModule,Repository/SimpleModule"
property="dir">
<do>
<property name="lastSlash"
value="${string::last-index-of(dir, '/')}" />
<property name="start"
value="${int::parse(lastSlash) + 1}"/>
<property name="len"
value="${string::get-length(dir) - int::parse(lastSlash) - 1}"/>
<property name="current.assembly"
value="${string::substring(dir, int::parse(start), len)}"/>
<property name="current.sources" value="examples/cs/${dir}"/>
<property name="current.keyfile" value="log4net.snk"/>
<property name="current.bin.subdir" value=""/>
<property name="warnaserror" value="false"/>
<property name="with.log4net" value="true"/>
<property name="with.assemblyversioninfo" value="true"/>
<call target="parameterized-compilation" />
</do>
</foreach>
<!-- the examples that need extra dependencies -->
<csc nostdlib="true" noconfig="true"
warnaserror="false"
target="library"
debug="true"
define="${current.build.defines.csc}"
output="${current.bin.dir}/SampleAppendersApp.dll"
doc="${current.bin.dir}/SampleAppendersApp.xml">
<sources basedir="${log4net.basedir}">
<include name="src/examples/cs/Appenders/SampleAppendersApp/**/*.cs" />
<include name="src/log4net/AssemblyVersionInfo.cs"/>
</sources>
<resources refid="nl-files"/>
<references>
<include name="mscorlib.dll"/>
<include name="System.dll" />
<include name="System.Core.dll" if="${current.build.has.systemcore}"/>
<include name="System.Data.dll" />
<include name="System.Web.dll" if="${current.build.has.systemweb}"/>
<include name="System.Xml.dll" />
<include name="System.Runtime.Remoting.dll" />
<include name="System.Configuration.dll" if="${current.build.has.systemconfiguration}"/>
<include name="${log4net.basedir}/lib/main/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/*.dll" />
<include name="${log4net.basedir}/lib/main/*.dll" />
<include name="${log4net.main.output.dir}/log4net-1.3.dll" frompath="false"/>
<include name="System.Windows.Forms.dll" />
<include name="System.Messaging.dll" />
</references>
</csc>
<csc nostdlib="true" noconfig="true"
warnaserror="false"
target="library"
debug="true"
define="${current.build.defines.csc}"
output="${current.bin.dir}/SimpleApp.dll"
doc="${current.bin.dir}/SimpleApp.xml">
<sources basedir="${log4net.basedir}">
<include name="src/examples/cs/Repository/SimpleApp/**/*.cs" />
<include name="src/log4net/AssemblyVersionInfo.cs"/>
</sources>
<resources refid="nl-files"/>
<references>
<include name="mscorlib.dll"/>
<include name="System.dll" />
<include name="System.Core.dll" if="${current.build.has.systemcore}"/>
<include name="System.Data.dll" />
<include name="System.Web.dll" if="${current.build.has.systemweb}"/>
<include name="System.Xml.dll" />
<include name="System.Runtime.Remoting.dll" />
<include name="System.Configuration.dll" if="${current.build.has.systemconfiguration}"/>
<include name="${log4net.basedir}/lib/main/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/*.dll" />
<include name="${log4net.basedir}/lib/main/*.dll" />
<include name="${log4net.main.output.dir}/log4net-1.3.dll" frompath="false"/>
<include name="${current.bin.dir}/SimpleModule.dll"/>
<include name="${current.bin.dir}/SharedModule.dll"/>
</references>
</csc>
<csc nostdlib="true" noconfig="true"
warnaserror="false"
target="library"
debug="true"
define="${current.build.defines.csc}"
output="${current.bin.dir}/WmiAppender.dll"
doc="${current.bin.dir}/WmiAppender.xml">
<sources basedir="${log4net.basedir}">
<include name="src/examples/cs/Appenders/WmiAppender/**/*.cs" />
<include name="src/log4net/AssemblyVersionInfo.cs"/>
</sources>
<resources refid="nl-files"/>
<references>
<include name="mscorlib.dll"/>
<include name="System.dll" />
<include name="System.Core.dll" if="${current.build.has.systemcore}"/>
<include name="System.Data.dll" />
<include name="System.Web.dll" if="${current.build.has.systemweb}"/>
<include name="System.Xml.dll" />
<include name="System.Runtime.Remoting.dll" />
<include name="System.Configuration.dll" if="${current.build.has.systemconfiguration}"/>
<include name="${log4net.basedir}/lib/main/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/*.dll" />
<include name="${log4net.basedir}/lib/main/*.dll" />
<include name="${log4net.main.output.dir}/log4net-1.3.dll" frompath="false"/>
<include name="System.Management.dll" />
<include name="System.Configuration.Install.dll" />
</references>
</csc>
<if test="${current.build.has.systemweb}">
<csc nostdlib="true" noconfig="true"
warnaserror="false"
target="library"
debug="true"
define="${current.build.defines.csc}"
output="${current.bin.dir}/WebServiceAppender.dll"
doc="${current.bin.dir}/WebServiceAppender.xml">
<sources basedir="${log4net.basedir}">
<include name="src/examples/cs/Appenders/WebServiceAppender/**/*.cs" />
<include name="src/log4net/AssemblyVersionInfo.cs"/>
</sources>
<resources refid="nl-files"/>
<references>
<include name="mscorlib.dll"/>
<include name="System.dll" />
<include name="System.Web.dll" />
<include name="System.Web.Services.dll" />
<include name="System.Xml.dll" />
<include name="System.Configuration.dll" if="${current.build.has.systemconfiguration}"/>
<include name="${log4net.basedir}/lib/main/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/*.dll" />
<include name="${log4net.basedir}/lib/main/*.dll" />
<include name="${log4net.main.output.dir}/log4net-1.3.dll" frompath="false"/>
</references>
</csc>
</if>
<csc nostdlib="true" noconfig="true"
warnaserror="false"
target="library"
debug="true"
define="${current.build.defines.csc}"
output="${current.bin.dir}/EventIDLogApp.dll"
doc="${current.bin.dir}/EventIDLogApp.xml">
<sources basedir="${log4net.basedir}">
<include name="src/examples/cs/Extensibility/EventIDLogApp/**/*.cs" />
<include name="src/log4net/AssemblyVersionInfo.cs"/>
</sources>
<resources refid="nl-files"/>
<references>
<include name="mscorlib.dll"/>
<include name="System.dll" />
<include name="System.Core.dll" if="${current.build.has.systemcore}"/>
<include name="System.Data.dll" />
<include name="System.Web.dll" if="${current.build.has.systemweb}"/>
<include name="System.Xml.dll" />
<include name="System.Runtime.Remoting.dll" />
<include name="System.Configuration.dll" if="${current.build.has.systemconfiguration}"/>
<include name="${log4net.basedir}/lib/main/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/*.dll" />
<include name="${log4net.basedir}/lib/main/*.dll" />
<include name="${log4net.main.output.dir}/log4net-1.3.dll" frompath="false"/>
<include name="${build.dir}/bin/log4net.Ext.EventID/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/${current.build.config}/log4net.Ext.EventID.dll" />
</references>
</csc>
<csc nostdlib="true" noconfig="true"
warnaserror="false"
target="library"
debug="true"
define="${current.build.defines.csc}"
output="${current.bin.dir}/WebApp.dll"
doc="${current.bin.dir}/WebApp.xml">
<sources basedir="${log4net.basedir}">
<include name="src/examples/cs/Tutorials/WebApp/**/*.cs" />
<include name="src/log4net/AssemblyVersionInfo.cs"/>
</sources>
<resources refid="nl-files"/>
<references>
<include name="mscorlib.dll"/>
<include name="System.dll" />
<include name="System.Core.dll" if="${current.build.has.systemcore}"/>
<include name="System.Data.dll" />
<include name="System.Web.dll" if="${current.build.has.systemweb}"/>
<include name="System.Xml.dll" />
<include name="System.Runtime.Remoting.dll" />
<include name="System.Configuration.dll" if="${current.build.has.systemconfiguration}"/>
<include name="${log4net.basedir}/lib/main/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/*.dll" />
<include name="${log4net.basedir}/lib/main/*.dll" />
<include name="${log4net.main.output.dir}/log4net-1.3.dll" frompath="false"/>
<include name="System.Drawing.dll" />
<include name="${current.bin.dir}/SimpleModule.dll"/>
<include name="${current.bin.dir}/SharedModule.dll"/>
</references>
</csc>
<call target="-compile-js-examples"/>
<call target="-compile-vb-examples"/>
<!-- reset so clean-current-bin-dir will not create strange
subdirs when compiling the next framework -->
<property name="current.assembly" value=""/>
<property name="bin.dir" value="${build.dir}/bin/examples/cs"/>
</target>
<target name="-compile-js-examples" if="${can.compile.js}">
<property name="current.assembly" value=""/>
<property name="bin.dir" value="${build.dir}/bin/examples/js"/>
<call target="-set-framework-configuration"/>
<call target="clean-current-bin-dir"/>
<jsc nostdlib="true" warnaserror="false" target="exe" debug="true"
define="${current.build.defines.jsc}"
output="${current.bin.dir}/ConsoleApp.exe">
<sources basedir="${log4net.basedir}">
<include name="src/examples/js/Tutorials/ConsoleApp/**/*.js" />
<include name="src/log4net/AssemblyVersionInfo.js"/>
</sources>
<references>
<include name="mscorlib.dll"/>
<include name="System.dll" />
<include name="System.Core.dll" if="${current.build.has.systemcore}"/>
<include name="System.Data.dll" />
<include name="System.Web.dll" if="${current.build.has.systemweb}"/>
<include name="System.Xml.dll" />
<include name="System.Runtime.Remoting.dll" />
<include name="System.Configuration.dll" if="${current.build.has.systemconfiguration}"/>
<include name="${log4net.basedir}/lib/main/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/*.dll" />
<include name="${log4net.basedir}/lib/main/*.dll" />
<include name="${log4net.main.output.dir}/log4net-1.3.dll" frompath="false"/>
<include name="System.Drawing.dll" />
</references>
</jsc>
<jsc nostdlib="true" warnaserror="false" target="library" debug="true"
define="${current.build.defines.jsc}"
output="${current.bin.dir}/SharedModule.dll">
<sources basedir="${log4net.basedir}">
<include name="src/examples/js/Repository/SharedModule/**/*.js" />
<include name="src/log4net/AssemblyVersionInfo.js"/>
</sources>
<references>
<include name="mscorlib.dll"/>
<include name="System.dll" />
<include name="System.Core.dll" if="${current.build.has.systemcore}"/>
<include name="System.Data.dll" />
<include name="System.Web.dll" if="${current.build.has.systemweb}"/>
<include name="System.Xml.dll" />
<include name="System.Runtime.Remoting.dll" />
<include name="System.Configuration.dll" if="${current.build.has.systemconfiguration}"/>
<include name="${log4net.basedir}/lib/main/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/*.dll" />
<include name="${log4net.basedir}/lib/main/*.dll" />
<include name="${log4net.main.output.dir}/log4net-1.3.dll" frompath="false"/>
</references>
</jsc>
<jsc nostdlib="true" warnaserror="false" target="library" debug="true"
define="${current.build.defines.jsc}"
output="${current.bin.dir}/SimpleModule.dll">
<sources basedir="${log4net.basedir}">
<include name="src/examples/js/Repository/SimpleModule/**/*.js" />
<include name="src/log4net/AssemblyVersionInfo.js"/>
</sources>
<references>
<include name="mscorlib.dll"/>
<include name="System.dll" />
<include name="System.Core.dll" if="${current.build.has.systemcore}"/>
<include name="System.Data.dll" />
<include name="System.Web.dll" if="${current.build.has.systemweb}"/>
<include name="System.Xml.dll" />
<include name="System.Runtime.Remoting.dll" />
<include name="System.Configuration.dll" if="${current.build.has.systemconfiguration}"/>
<include name="${log4net.basedir}/lib/main/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/*.dll" />
<include name="${log4net.basedir}/lib/main/*.dll" />
<include name="${log4net.main.output.dir}/log4net-1.3.dll" frompath="false"/>
</references>
</jsc>
<jsc nostdlib="true" warnaserror="false" target="exe" debug="true"
define="${current.build.defines.jsc}"
output="${current.bin.dir}/SimpleApp.exe">
<sources basedir="${log4net.basedir}">
<include name="src/examples/js/Repository/SimpleApp/**/*.js" />
<include name="src/log4net/AssemblyVersionInfo.js"/>
</sources>
<references>
<include name="mscorlib.dll"/>
<include name="System.dll" />
<include name="System.Core.dll" if="${current.build.has.systemcore}"/>
<include name="System.Data.dll" />
<include name="System.Web.dll" if="${current.build.has.systemweb}"/>
<include name="System.Xml.dll" />
<include name="System.Runtime.Remoting.dll" />
<include name="System.Configuration.dll" if="${current.build.has.systemconfiguration}"/>
<include name="${log4net.basedir}/lib/main/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/*.dll" />
<include name="${log4net.basedir}/lib/main/*.dll" />
<include name="${log4net.main.output.dir}/log4net-1.3.dll" frompath="false"/>
<include name="${current.bin.dir}/SimpleModule.dll"/>
<include name="${current.bin.dir}/SharedModule.dll"/>
</references>
</jsc>
</target>
<target name="-compile-vb-examples" if="${can.compile.vb}">
<property name="current.assembly" value=""/>
<property name="bin.dir" value="${build.dir}/bin/examples/vb"/>
<call target="-set-framework-configuration"/>
<call target="clean-current-bin-dir"/>
<foreach item="String" delim=","
in="Tutorials/ConsoleApp,Performance/NotLogging,Repository/SharedModule,Repository/SimpleModule"
property="dir">
<do>
<property name="lastSlash"
value="${string::last-index-of(dir, '/')}" />
<property name="start"
value="${int::parse(lastSlash) + 1}"/>
<property name="len"
value="${string::get-length(dir) - int::parse(lastSlash) - 1}"/>
<property name="loop.assembly"
value="${string::substring(dir, int::parse(start), len)}"/>
<vbc nostdlib="true"
warnaserror="false" target="library" debug="true"
define="${current.build.defines.vbc}"
output="${current.bin.dir}/${loop.assembly}.dll"
doc="${current.bin.dir}/${loop.assembly}.xml">
<sources basedir="${log4net.basedir}">
<include name="src/examples/vb/${dir}/**/*.vb" />
<include name="src/log4net/AssemblyVersionInfo.vb"/>
</sources>
<resources refid="nl-files"/>
<references>
<include name="mscorlib.dll"/>
<include name="System.dll" />
<include name="System.Core.dll" if="${current.build.has.systemcore}"/>
<include name="System.Data.dll" />
<include name="System.Web.dll" if="${current.build.has.systemweb}"/>
<include name="System.Xml.dll" />
<include name="System.Runtime.Remoting.dll" />
<include name="System.Configuration.dll" if="${current.build.has.systemconfiguration}"/>
<include name="${log4net.basedir}/lib/main/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/*.dll" />
<include name="${log4net.basedir}/lib/main/*.dll" />
<include name="${log4net.main.output.dir}/log4net-1.3.dll" frompath="false"/>
<include name="System.Drawing.dll" />
</references>
</vbc>
</do>
</foreach>
<vbc nostdlib="true"
warnaserror="false"
target="library"
debug="true"
define="${current.build.defines.vbc}"
output="${current.bin.dir}/SimpleApp.dll"
doc="${current.bin.dir}/SimpleApp.xml">
<sources basedir="${log4net.basedir}">
<include name="src/examples/vb/Repository/SimpleApp/**/*.vb" />
<include name="src/log4net/AssemblyVersionInfo.vb"/>
</sources>
<resources refid="nl-files"/>
<references>
<include name="mscorlib.dll"/>
<include name="System.dll" />
<include name="System.Core.dll" if="${current.build.has.systemcore}"/>
<include name="System.Data.dll" />
<include name="System.Web.dll" if="${current.build.has.systemweb}"/>
<include name="System.Xml.dll" />
<include name="System.Runtime.Remoting.dll" />
<include name="System.Configuration.dll" if="${current.build.has.systemconfiguration}"/>
<include name="${log4net.basedir}/lib/main/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/*.dll" />
<include name="${log4net.basedir}/lib/main/*.dll" />
<include name="${log4net.main.output.dir}/log4net-1.3.dll" frompath="false"/>
<include name="${current.bin.dir}/SimpleModule.dll"/>
<include name="${current.bin.dir}/SharedModule.dll"/>
</references>
</vbc>
<vbc nostdlib="true"
warnaserror="false"
target="library"
debug="true"
define="${current.build.defines.vbc}"
output="${current.bin.dir}/WebApp.dll"
doc="${current.bin.dir}/WebApp.xml">
<sources basedir="${log4net.basedir}">
<include name="src/examples/vb/Tutorials/WebApp/**/*.vb" />
<exclude name="src/examples/vb/Tutorials/WebApp/Global.asax.vb" />
<include name="src/log4net/AssemblyVersionInfo.vb"/>
</sources>
<resources refid="nl-files"/>
<references>
<include name="mscorlib.dll"/>
<include name="System.dll" />
<include name="System.Core.dll" if="${current.build.has.systemcore}"/>
<include name="System.Data.dll" />
<include name="System.Web.dll" if="${current.build.has.systemweb}"/>
<include name="System.Xml.dll" />
<include name="System.Runtime.Remoting.dll" />
<include name="System.Configuration.dll" if="${current.build.has.systemconfiguration}"/>
<include name="${log4net.basedir}/lib/main/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}/*.dll" />
<include name="${log4net.basedir}/lib/main/*.dll" />
<include name="${log4net.main.output.dir}/log4net-1.3.dll" frompath="false"/>
<include name="System.Drawing.dll" />
<include name="${current.bin.dir}/SimpleModule.dll"/>
<include name="${current.bin.dir}/SharedModule.dll"/>
</references>
</vbc>
</target>
</project>