2012-11-15 21:36:23 +01:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2015-01-18 03:03:42 +01:00
|
|
|
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
2012-11-15 21:36:23 +01:00
|
|
|
<PropertyGroup>
|
|
|
|
<_PropertySheetDisplayName>Custom Tasks</_PropertySheetDisplayName>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
2014-05-09 21:40:08 +02:00
|
|
|
<UsingTask TaskName="GitVersion" AssemblyFile="$(AegisubBinaryDir)BuildTasks.dll" />
|
2015-01-18 21:52:27 +01:00
|
|
|
|
|
|
|
<UsingTask TaskName="CalculateOutputDir" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" >
|
|
|
|
<ParameterGroup>
|
|
|
|
<Items ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
|
|
|
|
<SourceDir Required="true" />
|
|
|
|
<DestinationDir Required="true" />
|
|
|
|
<Outputs ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true" />
|
|
|
|
</ParameterGroup>
|
|
|
|
<Task>
|
|
|
|
<Code Type="Fragment" Language="cs"><![CDATA[
|
|
|
|
Outputs = new TaskItem[Items.Length];
|
|
|
|
char[] backslash = new char[] {'\\'};
|
|
|
|
var srcdir = SourceDir.Replace('/', '\\').TrimEnd(backslash) + "\\";
|
|
|
|
var dstdir = DestinationDir.Replace('/', '\\').TrimEnd(backslash) + "\\";
|
|
|
|
int i = 0;
|
|
|
|
foreach (var item in Items) {
|
|
|
|
var itemDir = item.GetMetadata("RelativeDir"); // the dir specified in the item Include= attribute
|
|
|
|
var outputDir = itemDir.Replace(srcdir, dstdir).Replace('/', '\\').TrimEnd(backslash) + "\\";
|
|
|
|
var output = new TaskItem(item);
|
|
|
|
((ITaskItem2)output).SetMetadataValueLiteral("OutputDir", outputDir);
|
|
|
|
Outputs[i] = output;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
]]></Code>
|
|
|
|
</Task>
|
|
|
|
</UsingTask>
|
2012-11-15 21:36:23 +01:00
|
|
|
</Project>
|
|
|
|
|