Permalink
Fetching contributors…
Cannot retrieve contributors at this time
291 lines (261 sloc) 10.7 KB
<?xml version="1.0"?>
<project default="build-all" xmlns="http://nant.sf.net/release/0.92/nant.xsd" name="SpotiFire">
<loadtasks assembly="${nant::get-base-directory()}/../../nantcontrib/NAnt.Contrib.Tasks.dll" />
<loadtasks assembly="${nant::get-base-directory()}/../../nant.nuget/NAnt.NuGet.Tasks.dll" />
<property name="project.config" value="debug" unless="${property::exists('project.config')}" />
<property name="basedir" value="${project::get-base-directory()}" />
<property name="name" value="${project::get-name()}" />
<property name="cl.options" value="" />
<property name="csc.optimize" value="false" />
<property name="publish" value="true" />
<target name="init">
<call target="${project.config}" cascade="false" />
</target>
<target name="post-build">
<property name="post-target" value="post-${project.config}" />
<call target="${post-target}" if="${target::exists(post-target)}" cascade="false" />
</target>
<target name="debug">
<property name="project.config" value="debug" />
<property name="build.debug" value="true" />
<property name="basedir.suffix" value="-debug" />
<property name="cl.options" value="/GS /Zi" />
<version buildtype="NoIncrement" revisiontype="Increment" prefix="build.number" />
</target>
<target name="post-debug" depends="nuget-pack">
<nuget-publish if="${publish}">
<packages>
<include name="${nuget.package}" />
</packages>
<feeds>
<local-feed path="C:\.nuget\.local\.feed" />
</feeds>
</nuget-publish>
</target>
<target name="release">
<property name="project.config" value="release" />
<property name="build.debug" value="true" />
<property name="basedir.suffix" value="" />
<property name="cl.options" value="/Ox" />
<property name="csc.optimize" value="true" />
<version buildtype="Increment" revisiontype="Increment" prefix="build.number" />
</target>
<target name="post-release" depends="nuget-pack">
<nuget-publish if="${publish}">
<packages>
<include name="${nuget.package}" />
</packages>
<feeds>
<local-feed path="C:\.nuget\.local\.feed" />
<server-feed apikey-file="C:\.nuget\api.key" />
</feeds>
</nuget-publish>
</target>
<target name="nuget-pack">
<nuget-pack id="SpotiFire"
version="${build.number.version}${basedir.suffix}"
title="SpotiFire"
url="https://github.com/Alxandr/SpotiFire"
authors="alxandr"
owners="alxandr"
outdir="${build.dir}/.nuget"
property="nuget.package"
description="Use libspotify in your .NET application">
<content type="lib" framework="net45" basedir="${build.dir}">
<include name="SpotiFire.*" />
<exclude name="*.pdb" />
</content>
<content type="content" basedir="${build.dir}">
<include name="libspotify.dll" />
</content>
<content type="tools" basedir="${basedir}/nuget">
<include name="install.ps1" />
<include name="nudoc.xml" />
</content>
<framework-assemblies>
<assembly name="System" />
<assembly name="Microsoft.CSharp" />
<assembly name="System.Core" />
<assembly name="System.Data" />
<assembly name="System.Data.DataSetExtensions" />
<assembly name="System.Drawing" />
<assembly name="System.Xml" />
<assembly name="System.Xml.Linq" />
</framework-assemblies>
<dependencies refid="nuget.dependencies" />
<symbols>
<sources type="src" basedir="${basedir}">
<include name="SpotiFire.SpotifyLib/**/*.cs" />
<include name="SpotiFire.LibSpotify/*.h" />
<include name="SpotiFire.LibSpotify/*.cpp" />
<exclude name="**/obj/**" />
</sources>
<sources type="lib" framework="net45" basedir="${build.dir}">
<include name="SpotiFire.dll" />
<include name="SpotiFire.xml" />
<include name="SpotiFire.pdb" />
</sources>
</symbols>
</nuget-pack>
</target>
<target name="build" depends="init">
<nuget-get-dependencies solution-dir="${basedir}" project-dir="${basedir}/SpotiFire.SpotifyLib" id="nuget.dependencies" allow-newer="true" />
<nuget-get-files solution-dir="${basedir}" files-property="nuget.files" references-property="nuget.references" framework="net45">
<dependencies refid="nuget.dependencies" />
</nuget-get-files>
<assemblyfileset id="all_refs" basedir="packages">
<patternset refid="nuget.references" />
<!--<include name="System.Drawing.dll" />-->
</assemblyfileset>
<property name="sp.build.dir" value="${basedir}/bin/${name}_${build.number.version}${basedir.suffix}" readonly="true" />
<property name="sp.build.obj" value="${basedir}/obj/${name}_${build.number.version}${basedir.suffix}" readonly="true" />
<property name="build.dir" value="${sp.build.dir}/SpotiFire" />
<property name="build.obj" value="${sp.build.obj}/SpotiFire" />
<property name="main.build.dir" value="${build.dir}" readonly="true" />
<mkdir dir="${build.dir}" />
<mkdir dir="${build.obj}" />
<property name="tmp.cpp" value="${build.obj}/tmp.cpp" />
<delete file="${tmp.cpp}" />
<foreach item="File" property="filename">
<in>
<items basedir="${basedir}/SpotiFire.LibSpotify">
<include name="**.h" />
</items>
</in>
<do>
<echo message="#include &quot;${filename}&quot;&#10;" append="true" file="${tmp.cpp}" />
</do>
</foreach>
<echo message="&#10;&#10;[assembly:System::CLSCompliantAttribute(true)];&#10;" append="true" file="${tmp.cpp}" />
<foreach item="File" property="filename">
<in>
<items basedir="${basedir}/SpotiFire.LibSpotify">
<include name="*.cpp" />
<include name="${tmp.cpp}" asis="true" />
<exclude name="AssemblyInfo.cpp" />
</items>
</in>
<do>
<property name="doc" value="${build.obj}/${path::get-file-name-without-extension(filename)}.xdc" />
<cl outputdir="${build.obj}" options="/clr /LN /doc&quot;${doc}&quot; /EHa /MP ${cl.options} /D _UNICODE /D UNICODE /D INTEGRATED" verbose="false">
<sources>
<include name="${filename}" asis="true" />
</sources>
<forcedusingfiles refid="all_refs" />
</cl>
</do>
</foreach>
<property name="tmp.cs" value="${build.obj}/tmp-assembly-info.cs" />
<asminfo output="${tmp.cs}" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.CompilerServices" />
<import namespace="System.Runtime.InteropServices" />
<import namespace="System.Security.Permissions" />
</imports>
<attributes>
<attribute type="AssemblyTitleAttribute" value="SpotiFire" />
<attribute type="AssemblyVersionAttribute" value="${build.number.version}" />
<attribute type="AssemblyDescriptionAttribute" value="" />
<attribute type="AssemblyCopyrightAttribute" value="" />
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="CLSCompliantAttribute" value="true" />
<attribute type="SecurityPermissionAttribute" value="SecurityAction.RequestMinimum, UnmanagedCode = true" asis="true" />
</attributes>
</asminfo>
<csc target="module" output="${build.obj}/SpotiFire.netmodule" doc="${build.obj}/managed.xml" optimize="${csc.optimize}">
<modules basedir="${build.obj}">
<include name="tmp.obj" />
</modules>
<references refid="all_refs" />
<sources basedir="${basedir}/SpotiFire.SpotifyLib">
<include name="**.cs" />
<include name="${tmp.cs}" />
<exclude name="Properties/AssemblyInfo.cs" />
</sources>
<nowarn>
<warning number="1684" /> <!-- do not report warnings for extern members not found -->
<warning number="1591" /> <!-- do not report warnings for missing XML comments -->
</nowarn>
</csc>
<link output="${build.obj}/${name}.dll" options="/LTCG /FIXED:NO /CLRIMAGETYPE:IJW /NOENTRY /DLL /ignore:4248">
<sources basedir="${build.obj}">
<include name="*.obj" />
<include name="*.netmodule" />
<include name="${basedir}/libspotify.lib" asis="true" />
</sources>
<arg value="/DEBUG" if="${build.debug == 'true'}" />
</link>
<exec program="xdcmake.exe" workingdir="${build.obj}">
<arg value="/nologo" />
<arg>
<path>
<pathelement path="${build.obj}\*.xdc" />
</path>
</arg>
<arg value="/assembly:${name}.dll" />
<arg value="/out:${name}.xml" />
</exec>
<!--<xmlstrip file="${build.obj}/${name}.xml" xpath="/doc/members/member[starts-with(@name, 'M:UTF8') or starts-with(@name, 'M:sp_') or starts-with(@name, 'T:sp_') or starts-with(@name, 'F:sp_') or starts-with(@name, 'D:sp_') or starts-with(@name, 'D:inboxpost_') or starts-with(@name, 'D:toplistbrowse_') or starts-with(@name, 'D:search_') or starts-with(@name, 'D:image_') or starts-with(@name, 'D:artistbrowse_') or starts-with(@name, 'D:albumbrowse_')]" />-->
<xmlstrip file="${build.obj}/${name}.xml" xpath="/doc/members/member[not(contains(@name, 'SpotiFire'))]" />
<xmlmerge file="${build.obj}/${name}.xml" xpath="/doc/members" other="${build.obj}/managed.xml" />
<copy todir="${build.dir}" flatten="true">
<fileset basedir="${build.obj}">
<include name="${name}.dll" />
<include name="${name}.pdb" />
<include name="${name}.xml" />
</fileset>
</copy>
<copy todir="${build.dir}" flatten="true">
<fileset basedir="packages">
<patternset refid="nuget.files" />
</fileset>
</copy>
<copy todir="${build.dir}" flatten="true">
<fileset basedir="${basedir}">
<include name="*.dll" />
<include name="*.xml" />
</fileset>
</copy>
<zip zipfile="${sp.build.dir}/SpotiFire-${build.number.version}.zip">
<fileset basedir="${build.dir}" prefix="SpotiFire">
<include name="**/*" />
</fileset>
</zip>
<call target="post-build" />
</target>
<target name="build-extras" depends="build">
<foreach item="File" property="buildfile">
<in>
<items basedir="${basedir}">
<include name="*/*.build" />
</items>
</in>
<do>
<property name="build.name" value="${path::get-file-name-without-extension(buildfile)}" />
<property name="build.dir" value="${sp.build.dir}/${build.name}" />
<property name="build.obj" value="${sp.build.obj}/${build.name}" />
<property name="project.dir" value="${path::get-directory-name(buildfile)}" />
<mkdir dir="${build.dir}" />
<mkdir dir="${build.obj}" />
<copy todir="${build.dir}">
<fileset basedir="${main.build.dir}">
<include name="*" />
</fileset>
</copy>
<nant buildfile="${buildfile}" />
<zip zipfile="${sp.build.dir}/${build.name}-${build.number.version}.zip">
<fileset basedir="${build.dir}" prefix="${build.name}">
<include name="**/*" />
</fileset>
</zip>
</do>
</foreach>
</target>
<target name="build-all" depends="build build-extras" />
<target name="clean">
<delete dir="${basedir}/bin" />
<delete dir="${basedir}/obj" />
</target>
</project>