Created
April 17, 2013 19:59
-
-
Save tomspilman/5407266 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
MonoGame - Copyright (C) The MonoGame Team | |
This file is subject to the terms and conditions defined in | |
file 'LICENSE.txt', which is part of this source code package. | |
--> | |
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<UsingTask TaskName="MonoGame_ParseContent" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" > | |
<ParameterGroup> | |
<Items ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" /> | |
<Result ParameterType="System.String" Output="true" /> | |
</ParameterGroup> | |
<Task> | |
<Code Type="Fragment" Language="cs"> | |
<![CDATA[ | |
Result = ""; | |
foreach (var item in Items) | |
{ | |
Result += string.Format("\r\n/importer:{0}\r\n", item.GetMetadata("Importer")); | |
Result += string.Format("/processor:{0}\r\n", item.GetMetadata("Processor")); | |
foreach (string meta in item.MetadataNames) | |
{ | |
if (meta.StartsWith("ProcessorParameters_")) | |
Result += string.Format("/processorParam:{0}={1}\r\n", meta.Substring(20), item.GetMetadata(meta)); | |
} | |
Result += string.Format("/build:{0}\r\n", item.ItemSpec); //GetMetadata("%(Identity)")); | |
} | |
]]></Code> | |
</Task> | |
</UsingTask> | |
<PropertyGroup> | |
<!-- Make sure some default properties are setup properly --> | |
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform> | |
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> | |
<OutputPath Condition="'$(OutputPath)' == ''">bin\$(Platform)\$(Configuration)</OutputPath> | |
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">obj\$(Platform)\$(Configuration)</IntermediateOutputPath> | |
<ContentResponseFile>$(IntermediateOutputPath)\content.txt</ContentResponseFile> | |
<MonoGameContentBuilderExe>D:\Projects\BtA\MonoGame\Tools\MGCB\bin\Debug\MGCB.exe</MonoGameContentBuilderExe> | |
<MonoGamePlatform Condition="'$(MonoGamePlatform)' == ''">Windows</MonoGamePlatform> | |
</PropertyGroup> | |
<Target Name="MonoGame_WriteResponseFile"> | |
<MakeDir Directories="$(IntermediateOutputPath)"/> | |
<MakeDir Directories="$(OutputPath)"/> | |
<WriteLinesToFile File="$(ContentResponseFile)" Lines="/outputDir:$(OutputPath)\$(ContentRootDirectory)" Overwrite="true"/> | |
<WriteLinesToFile File="$(ContentResponseFile)" Lines="/intermediateDir:$(IntermediateOutputPath)\$(ContentRootDirectory)"/> | |
<WriteLinesToFile File="$(ContentResponseFile)" Lines="/config:$(Configuration)"/> | |
<WriteLinesToFile File="$(ContentResponseFile)" Lines="/platform:$(MonoGamePlatform)"/> | |
</Target> | |
<Target Name="MonoGame_WriteContent" DependsOnTargets="MonoGame_WriteResponseFile"> | |
<MonoGame_ParseContent Items="@(Compile)"> | |
<Output ItemName="ContentItems" TaskParameter="Result" /> | |
</MonoGame_ParseContent> | |
<WriteLinesToFile File="$(ContentResponseFile)" Lines="@(ContentItems)"/> | |
</Target> | |
<Target Name="Build" DependsOnTargets="MonoGame_WriteContent"> | |
<Exec Command="$(MonoGameContentBuilderExe) /@:$(ContentResponseFile) /quiet" IgnoreExitCode="true" EchoOff="true"/> | |
</Target> | |
<Target Name="Rebuild" DependsOnTargets="MonoGame_WriteContent"> | |
<Exec Command="$(MonoGameContentBuilderExe) /@:$(ContentResponseFile) /quiet /rebuild" IgnoreExitCode="true" EchoOff="true"/> | |
</Target> | |
<Target Name="Clean" DependsOnTargets="MonoGame_WriteResponseFile"> | |
<Exec Command="$(MonoGameContentBuilderExe) /@:$(ContentResponseFile) /quiet /clean" IgnoreExitCode="true" EchoOff="true"/> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment