anx.framework/build/ANX.Framework.build
Glatzemann 437741acef - DX11 shader generation warnings in sscg are removed
- Optimized build script: XNA and XNA Game Studio installations are now recognized and Samples which are using the XNA ContentPipeline are no longer builded if not possible. The build scripts now runs completly on Windows 8.
2015-03-15 01:12:11 +01:00

521 lines
20 KiB
Plaintext

<project name="ANX.Framework Build" default="build" basedir="./">
<property name="build.platform" value="Any CPU" />
<property name="build.solution_dir" value="../" />
<property name="build.dir" value="${path::get-full-path('../bin')}" />
<property name="build.dir.base" value="${build.dir}" />
<property name="build.dir.tools" value="${build.dir}/tools" />
<property name="project.anx.path" value="../ANX.Framework" />
<property name="project.anx.name" value="ANX.Framework" />
<property name="project.anx.extended" value="false" unless="${property::exists('project.anx.extended')}" />
<property name="project.anx.directives" value="" unless="${property::exists('project.anx.directives')}" />
<property name="project.anxcontent.path" value="../ANX.Framework.ContentPipeline" />
<property name="project.anxcontent.name" value="ANX.Framework.ContentPipeline" />
<!-- dont change the following flags... set 'em by calling the appropriate target -->
<property name="build.configuration" value="Release" />
<property name="project.anx.build_env" value="VS2010" />
<property name="project.anx.platform" value="Windows" />
<property name="project.anx.windows" value="true" />
<property name="project.anx.linux" value="false" />
<property name="project.anx.psvita" value="false" />
<property name="project.anx.metro" value="false" />
<property name="project.anx.winrt" value="false" />
<property name="xna.installed" value="false" />
<property name="xnasdk.installed" value="false" />
<target name="clean" description="Cleans all targets.">
<delete>
<fileset>
<include name="${build.dir}/**" />
<include name="${build.dir.base}/**" />
<include name="${build.dir.tools}/**" />
<include name="${build.solution_dir}/**/obj/**" />
<include name="${build.dir}/samples/**/**" />
<include name="${build.dir}/${build.configuration}/installer/**" />
<include name="${project.anx.path}/obj/**" />
<include name="${project.anxcontent.path}/obj/**" />
</fileset>
</delete>
</target>
<target name="debug">
<property name="build.configuration" value="Debug" />
</target>
<target name="VS2010">
<property name="project.anx.build_env" value="VS2010" />
</target>
<target name="VS2011">
<property name="project.anx.build_env" value="VS2011" />
</target>
<target name="windows">
<property name="project.anx.windows" value="true" />
<property name="project.anx.platform" value="Windows" />
</target>
<target name="linux">
<property name="project.anx.linux" value="true" />
<property name="project.anx.platform" value="Linux" />
<call target="generate_project_files" />
</target>
<target name="psvita">
<property name="project.anx.psvita" value="true" />
<property name="project.anx.platform" value="PS Vita" />
<call target="generate_project_files" />
</target>
<target name="metro">
<property name="project.anx.metro" value="true" />
<property name="project.anx.platform" value="Windows 8 / Metro" />
<property name="build.platform" value="x86" />
<property name="build.dir" value="${build.dir}/ModernUI" />
<property name="project.anx.directives" value="${project.anx.directives} WINDOWSMETRO" />
<call target="generate_project_files" />
</target>
<target name="winrt">
<property name="project.anx.metro" value="true" />
<property name="project.anx.winrt" value="true" />
<property name="project.anx.platform" value="Windows 8 / Metro / WinRT" />
<property name="build.platform" value="ARM" />
<property name="project.anx.directives" value="${project.anx.directives} WINDOWSMETRO ARM WINRT" />
<call target="generate_project_files" />
</target>
<target name="build" depends="check_xna">
<echo message="===================================================" />
<echo message="ANX.Framework build script" />
<echo message="===================================================" />
<echo message="" />
<echo message="Build environment : ${project.anx.build_env}" />
<echo message="Build configuration : ${build.configuration}" />
<echo message="Target platform : ${project.anx.platform}" />
<echo message="Target build dir : ${build.dir.base}" />
<echo message="" />
<echo message="XNA runtime installed : ${xna.installed}" />
<echo message="XNA game studio installed: ${xnasdk.installed}" />
<echo message="" />
<if test="${project.anx.extended}">
<property name="project.anx.directives" value="${project.anx.directives} XNAEXT" />
</if>
<echo message="Compiler directives: ${project.anx.directives}" />
<call target="tools" />
<call target="generate_stock_shaders" />
<call target="anx" />
<call target="content_pipeline" />
<call target="inputsystem" />
<call target="soundsystem" />
<call target="rendersystem" />
<call target="platformsystem" />
<call target="samples" />
</target>
<target name="check_xna" description="checks if the XNA framework is installed" unless="${target::has-executed('check_xna')}">
<property name="xna32" value="0" />
<property name="xna64" value="0" />
<property name="xnasdk32" value="0" />
<property name="xnasdk64" value="0" />
<readregistry property="xna32" key="Software\Microsoft\XNA\Framework\v4.0\Installed" hive="LocalMachine" failonerror="false" />
<readregistry property="xna64" key="Software\Wow6432Node\Microsoft\XNA\Framework\v4.0\Installed" hive="LocalMachine" failonerror="false" />
<if test="${int::parse(xna32) == 1 or int::parse(xna64) == 1}">
<property name="xna.installed" value="true" />
</if>
<readregistry property="xnasdk32" key="Software\Microsoft\XNA\Game Studio\v4.0\Installed" hive="LocalMachine" failonerror="false" />
<readregistry property="xnasdk64" key="Software\Wow6432Node\Microsoft\XNA\Game Studio\v4.0\Installed" hive="LocalMachine" failonerror="false" />
<if test="${int::parse(xnasdk32) == 1 or int::parse(xnasdk64) == 1}">
<property name="xnasdk.installed" value="true" />
</if>
</target>
<target name="anx" description="Build ANX.Framework core" unless="${target::has-executed('anx')}">
<echo message="building: ANX.Framework" />
<exec program="msbuild.exe" >
<arg value="/t:Build"/>
<arg value="/p:Configuration=${build.configuration}"/>
<arg value='/p:Platform="${build.platform}"'/>
<arg value="/p:OutputPath=${build.dir}/${build.configuration}" />
<arg value="/p:AllowUnsafeBlocks=true" />
<arg value="/p:SolutionDir=${build.solution_dir}" />
<arg value='/p:DefineConstants="${project.anx.directives}"' />
<arg value="/clp:ErrorsOnly" />
<arg value="/nologo" />
<arg value="${project.anx.path}/${project.anx.name}.csproj" />
</exec>
</target>
<target name="support" description="ANX.Framework supporting libraries" unless="${target::has-executed('support')}">
<fileset id="support_files" basedir="../Support/">
<include name="**/*.csproj" />
<exclude name="**/*PSVita*.csproj" />
<exclude name="**/*Metro*.csproj" />
<exclude name="**/*Linux*.csproj" />
</fileset>
<if test="${project.anx.linux}">
<fileset id="support_files" basedir="../Support/">
<include name="**/*_Linux.csproj" />
</fileset>
</if>
<if test="${project.anx.psvita}">
<fileset id="support_files" basedir="../Support/">
<include name="**/*.PSVITA*_PSVITA.csproj" />
</fileset>
</if>
<if test="${project.anx.metro}">
<fileset id="support_files" basedir="../Support/">
<include name="**/*.Metro*_WindowsMetro.csproj" />
</fileset>
</if>
<foreach item="File" property="projectFile">
<in>
<items refid="support_files" />
</in>
<do>
<echo message="building: ${path::get-file-name-without-extension(projectFile)}" />
<exec program="msbuild.exe" >
<arg value="/t:Build"/>
<arg value="/p:Configuration=${build.configuration}"/>
<arg value='/p:Platform="${build.platform}"'/>
<arg value="/p:OutputPath=${build.dir.base}/${build.configuration}" />
<arg value="/p:AllowUnsafeBlocks=true" />
<arg value="/p:SolutionDir=${build.solution_dir}" />
<arg value='/p:DefineConstants="${project.anx.directives}"' />
<arg value="/clp:ErrorsOnly" />
<arg value="/nologo" />
<arg value="${projectFile}" />
</exec>
</do>
</foreach>
</target>
<include buildfile="ANX.RenderSystem.build" />
<include buildfile="ANX.InputSystem.build" />
<include buildfile="ANX.SoundSystem.build" />
<target name="platformsystem" description="Build ANX.Framework PlatformSystems">
<!-- default windows fileset -->
<fileset id="platformsystem_files" basedir="../PlatformSystems/">
<include name="**/*.csproj" />
<exclude name="**/*PSVita*.csproj" />
<exclude name="**/*Metro*.csproj" />
<exclude name="**/*Linux*.csproj" />
</fileset>
<if test="${project.anx.linux}">
<fileset id="platformsystem_files" basedir="../PlatformSystems/">
<include name="**/*Linux*_Linux.csproj" />
</fileset>
</if>
<if test="${project.anx.psvita}">
<fileset id="platformsystem_files" basedir="../PlatformSystems/">
<include name="**/*PsVita*_PsVita.csproj" />
</fileset>
</if>
<if test="${project.anx.metro}">
<fileset id="platformsystem_files" basedir="../PlatformSystems/">
<include name="**/*Metro*_WindowsMetro.csproj" />
</fileset>
</if>
<foreach item="File" property="projectFile">
<in>
<items refid="platformsystem_files" />
</in>
<do>
<echo message="building: ${path::get-file-name-without-extension(projectFile)}" />
<exec program="msbuild.exe" >
<arg value="/t:Build"/>
<arg value="/p:Configuration=${build.configuration}"/>
<arg value='/p:Platform="${build.platform}"'/>
<arg value="/p:OutputPath=${build.dir}/${build.configuration}" />
<arg value="/p:AllowUnsafeBlocks=true" />
<arg value="/p:SolutionDir=${build.solution_dir}" />
<arg value='/p:DefineConstants="${project.anx.directives}"' />
<arg value="/clp:ErrorsOnly" />
<arg value="/nologo" />
<arg value="${projectFile}" />
</exec>
</do>
</foreach>
</target>
<target name="generate_stock_shaders" description="Generate code for stock shaders" depends="tools">
<foreach item="File" property="buildFile">
<in>
<items basedir="../shader/">
<include name="**/build.xml" />
<exclude name="**/*Metro*/build.xml" unless="${project.anx.metro}" />
</items>
</in>
<do>
<echo message="generating: ${path::get-file-name(path::get-directory-name(buildFile))}" />
<exec program="../bin/${build.configuration}/sscg.exe" >
<arg value="${buildFile}" />
<arg value="/silent" />
</exec>
</do>
</foreach>
</target>
<target name="samples" description="Build ANX.Framework samples">
<!-- default windows fileset -->
<fileset id="sample_files" basedir="../Samples/">
<include name="**/*.csproj" unless="${not xnasdk.installed}" />
<include name="**/SimpleNoContent.csproj" />
<exclude name="**/*Kinect*.csproj" />
<exclude name="**/*PSVita*.csproj" />
<exclude name="**/*Metro*.csproj" />
<exclude name="**/*Linux*.csproj" />
</fileset>
<if test="${project.anx.linux}">
<fileset id="sample_files" basedir="../Samples/">
<include name="**/*_Linux.csproj" />
</fileset>
</if>
<if test="${project.anx.psvita}">
<fileset id="sample_files" basedir="../Samples/">
<include name="**/*_PsVita.csproj" />
</fileset>
</if>
<if test="${project.anx.metro}">
<fileset id="sample_files" basedir="../Samples/">
<!--
<include name="**/*_WindowsMetro.csproj" />
-->
<include name="**/SimpleNoContent_WindowsMetro.csproj" />
</fileset>
</if>
<foreach item="File" property="projectFile">
<in>
<items refid="sample_files" />
</in>
<do>
<echo message="building: ${path::get-file-name-without-extension(projectFile)}" />
<exec program="msbuild.exe" >
<arg value="/t:Build"/>
<arg value="/p:Configuration=${build.configuration}"/>
<arg value='/p:Platform="${build.platform}"'/>
<arg value="/p:OutputPath=${build.dir.base}/samples/${build.configuration}" />
<arg value="/p:AllowUnsafeBlocks=true" />
<arg value="/p:SolutionDir=${build.solution_dir}" />
<arg value='/p:DefineConstants="${project.anx.directives}"' />
<arg value="/clp:ErrorsOnly" />
<arg value="/nologo" />
<arg value="${projectFile}" />
</exec>
</do>
</foreach>
</target>
<target name="build_tools" description="Tools supporting the build process of ANX.Framework" unless="${target::has-executed('build_tools')}">
<foreach item="File" property="projectFile">
<in>
<items basedir="../Tools/">
<include name="**/ProjectConverter.csproj" />
</items>
</in>
<do>
<echo message="building: ${path::get-file-name-without-extension(projectFile)}" />
<exec program="msbuild.exe" >
<arg value="/t:Build"/>
<arg value="/p:Configuration=${build.configuration}"/>
<arg value='/p:Platform="${build.platform}"'/>
<arg value="/p:OutputPath=${build.dir.tools}" />
<arg value="/p:AllowUnsafeBlocks=true" />
<arg value="/p:SolutionDir=${build.solution_dir}" />
<!--
<arg value='/p:DefineConstants="${project.anx.directives}"' />
-->
<arg value="/clp:ErrorsOnly" />
<arg value="/nologo" />
<arg value="${projectFile}" />
</exec>
</do>
</foreach>
</target>
<target name="tools" description="Build ANX.Framework tools" depends="anx, content_pipeline, support" unless="${target::has-executed('tools')}">
<foreach item="File" property="projectFile">
<in>
<items basedir="../Tools/">
<include name="**/*.csproj" />
<exclude name="**/ProjectConverter.csproj" />
<exclude name="**/*ANX.ContentCompiler.GUI*.csproj" if="${project.anx.metro}" />
<exclude name="**/*ContentBuilder*.csproj" if="${project.anx.metro}" />
<exclude name="**/*ANXStatusComparer*.csproj" if="${project.anx.metro}" />
<exclude name="**/*StockShaderCodeGenerator*.csproj" if="${project.anx.metro}" />
<exclude name="**/*XNBInspector*.csproj" if="${project.anx.metro}" />
<exclude name="**/*OnlineStatusGenerator*.csproj" if="${project.anx.metro}" />
</items>
</in>
<do>
<echo message="building: ${path::get-file-name-without-extension(projectFile)}" />
<exec program="msbuild.exe" >
<arg value="/t:Build"/>
<arg value="/p:Configuration=${build.configuration}"/>
<arg value='/p:Platform="${build.platform}"'/>
<arg value="/p:OutputPath=${build.dir.base}/${build.configuration}" />
<arg value="/p:AllowUnsafeBlocks=true" />
<arg value="/p:SolutionDir=${build.solution_dir}" />
<arg value='/p:DefineConstants="${project.anx.directives}"' />
<arg value="/clp:ErrorsOnly" />
<arg value="/nologo" />
<arg value="${projectFile}" />
</exec>
</do>
</foreach>
</target>
<target name="content_pipeline" description="Build ANX.Framework ContentPipeline extensions" depends="anx, support" unless="${target::has-executed('content_pipeline')}">
<echo message="building: Content.Pipeline.Extensions" />
<!--
<exec program="msbuild.exe" >
<arg value="/t:Build"/>
<arg value="/p:Configuration=${build.configuration}"/>
<arg value='/p:Platform="${build.platform}"'/>
<arg value="/p:OutputPath=${build.dir}/${build.configuration}" />
<arg value="/p:SolutionDir=${build.solution_dir}" />
<arg value='/p:DefineConstants="${project.anx.directives}"' />
<arg value="/p:AllowUnsafeBlocks=true" />
<arg value="/clp:ErrorsOnly" />
<arg value="/nologo" />
<arg value="${project.anxcontent.path}/${project.anxcontent.name}.csproj" />
</exec>
-->
</target>
<target name="create_packages" description="generates all type of packages">
<call target="create_zip_packages" />
<call target="create_msi_packages" />
</target>
<target name="create_zip_packages" description="Generate zip package containing binaries" depends="build">
<loadfile file="${project.anx.path}/Properties/AssemblyInfo.cs" property="assembly_version_file" />
<regex pattern="AssemblyVersion\(.(?'assembly_version'\d+\.\d+.\d+)" input="${assembly_version_file}" />
<property name="build.output.release_package" value="../package/${project.anx.name}-${build.configuration}-${assembly_version}.zip"/>
<zip ziplevel="9" zipfile="${build.output.release_package}">
<fileset basedir="../bin/${build.configuration}/">
<include name="*.dll" />
<include name="*.config" />
<include name="../../doc/license.txt" />
</fileset>
</zip>
</target>
<target name="create_msi_packages" description="Create the installer package" depends="build">
<loadfile file="${project.anx.path}/Properties/AssemblyInfo.cs" property="assembly_version_file" />
<regex pattern="AssemblyVersion\(.(?'assembly_version'\d+\.\d+.\d+)" input="${assembly_version_file}" />
<property name="build.output.installer_package" value="../package/${project.anx.name}-${build.configuration}-${assembly_version}.msi"/>
<property name="wix.dir" value="${path::combine(environment::get-variable('WIX'), 'bin')}" readonly="true" />
<loadtasks assembly="${wix.dir}\Microsoft.Tools.WindowsInstallerXml.NAntTasks.dll" />
<candle out="${build.dir}/${build.configuration}/installer/" exedir="${wix.dir}" extensions="WixUIExtension;WiXUtilExtension">
<sources>
<include name="../Installer/anx.wxs" />
</sources>
<defines>
<define name="PRODUCTVERSION" value="${assembly_version}" />
</defines>
</candle>
<light
exedir="${wix.dir}"
out="${build.output.installer_package}"
warningsaserrors="true"
suppressices="ICE57"
cultures="en-us"
extensions="WixUIExtension;WiXUtilExtension"
rebuild="true"
suppresspdb="true">
<!-- Specify additional options -->
<arg line="-fv" />
<sources basedir="${build.dir}/${build.configuration}/installer/">
<include name="*.wixobj" />
</sources>
</light>
</target>
<target name="generate_project_files" depends="build_tools">
<fileset id="project_files" basedir="../">
<include name="**/${project.anx.name}/*.csproj" />
<include name="ANX.Framework.Content.Pipeline/**/*.csproj" />
<include name="RenderSystems/**/*.csproj" />
<include name="InputSystems/**/*.csproj" />
<include name="PlatformSystems/**/*.csproj" />
<include name="SoundSystems/**/*.csproj" />
<include name="Samples/**/*.csproj" />
<exclude name="**/*_Linux.csproj" />
<exclude name="**/*_PSVita.csproj" />
<exclude name="**/*_WindowsMetro.csproj" />
</fileset>
<foreach item="File" property="projectFile">
<in>
<items refid="project_files" />
</in>
<do>
<echo message="create project file: ${path::get-file-name-without-extension(projectFile)}" />
<exec program="${build.dir.tools}/ProjectConverter.exe" >
<arg value="&quot;${projectFile}&quot;" />
<arg value="/linux" if="${project.anx.linux}" />
<arg value="/psvita" if="${project.anx.psvita}" />
<arg value="/windowsmetro" if="${project.anx.metro}" />
</exec>
</do>
</foreach>
</target>
</project>