-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathXamlImageConverter.targets
55 lines (45 loc) · 2.84 KB
/
XamlImageConverter.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--Reference the assembly where our tasks are defined-->
<UsingTask TaskName="XamlImageConverter" AssemblyFile=".\XamlImageConverter.dll" />
<PropertyGroup>
<PrepareResourcesDependsOn>XamlImageConverterPreCompiler;$(PrepareResourcesDependsOn)</PrepareResourcesDependsOn>
<OriginalCoreBuildDependsOn>$(CoreBuildDependsOn)</OriginalCoreBuildDependsOn>
</PropertyGroup>
<ItemGroup>
<CoreBuildDependsOnItems Include="$(OriginalCoreBuildDependsOn)" Exclude="PostBuildEvent" />
</ItemGroup>
<PropertyGroup>
<CoreBuildDependsOn>@(CoreBuildDependsOnItems);XamlImageConverterPostCompiler;PostBuildEvent;</CoreBuildDependsOn>
</PropertyGroup>
<PropertyGroup>
<XamlImageConverterDependsOn />
<XamlImageConverterPreCompilerDependsOn>$(XamlImageConverterDependsOn)</XamlImageConverterPreCompilerDependsOn>
<XamlImageConverterPostCompilerDependsOn>$(XamlImageConverterDependsOn)</XamlImageConverterPostCompilerDependsOn>
</PropertyGroup>
<ItemGroup>
<AvailableItemName Include="XamlConverter" />
<AvailableItemName Include="ConvertToPng" />
<AvailableItemName Include="ConvertToPdf" />
<AvailableItemName Include="ConvertToJpeg" />
</ItemGroup>
<!--Compile target (this is the target that calls the compiler task)-->
<Target Name="XamlImageConverterPreCompiler" DependsOnTargets="$(XamlImageConverterPreCompilerDependsOn)">
<XamlImageConverter SourceFiles="@(XamlConverter)" ProjectPath="$(MSBuildProjectDirectory)" Mode="Loose" />
<XamlImageConverter SourceFiles="@(ConvertToPng)" ProjectPath="$(MSBuildProjectDirectory)" Mode="Loose" Parameters="Type=png" />
<XamlImageConverter SourceFiles="@(ConvertToPdf)" ProjectPath="$(MSBuildProjectDirectory)" Mode="Loose" Parameters="Type=pdf" />
<XamlImageConverter SourceFiles="@(ConvertToJpeg)" ProjectPath="$(MSBuildProjectDirectory)" Mode="Loose" Parameters="Type=jpg" />
</Target>
<Target Name="XamlImageConverterPostCompiler" DependsOnTargets="$(XamlImageConverterPostCompilerDependsOn)">
<XamlImageConverter SourceFiles="@(XamlConverter)" ProjectPath="$(MSBuildProjectDirectory)" Mode="Compiled" />
<XamlImageConverter SourceFiles="@(ConvertToPng)" ProjectPath="$(MSBuildProjectDirectory)" Mode="Compiled" Parameters="Type=png" />
<XamlImageConverter SourceFiles="@(ConvertToPdf)" ProjectPath="$(MSBuildProjectDirectory)" Mode="Compiled" Parameters="Type=pdf" />
<XamlImageConverter SourceFiles="@(ConvertToJpeg)" ProjectPath="$(MSBuildProjectDirectory)" Mode="Compiled" Parameters="Type=jpg" />
</Target>
<!--This is an override of CoreCompile to have our XamlImageConverter be called at compile time-->
<!--<Target
Name="CoreCompile"
Inputs="@(Compile)"
Outputs="@(XamlImageConverterImages)"
DependsOnTargets="$(CoreCompileDependsOn);XamlImageConverterCompilerTarget">
</Target>-->
</Project>