/
Fody.targets
74 lines (70 loc) · 2.57 KB
/
Fody.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Choose>
<When Condition="$(NCrunchOriginalSolutionDir) != '' And $(NCrunchOriginalSolutionDir) != '*Undefined*'">
<PropertyGroup>
<FodySolutionDir>$(NCrunchOriginalSolutionDir)</FodySolutionDir>
</PropertyGroup>
</When>
<When Condition="$(SolutionDir) != '' And $(SolutionDir) != '*Undefined*'">
<PropertyGroup>
<FodySolutionDir>$(SolutionDir)</FodySolutionDir>
</PropertyGroup>
</When>
<When Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">
<PropertyGroup>
<FodySolutionDir>$(MSBuildProjectDirectory)\..\</FodySolutionDir>
</PropertyGroup>
</When>
</Choose>
<PropertyGroup>
<IntermediateDir>$(ProjectDir)$(IntermediateOutputPath)</IntermediateDir>
<FodyMessageImportance Condition="$(FodyMessageImportance) == '' Or $(FodyMessageImportance) == '*Undefined*'">Low</FodyMessageImportance>
</PropertyGroup>
<UsingTask
TaskName="Fody.WeavingTask"
AssemblyFile="$(MSBuildThisFileDirectory)Fody.dll" />
<Target
AfterTargets="CopyFilesToOutputDirectory"
Name="WinFodyTarget"
Condition=" '$(OS)' == 'Windows_NT'">
<Fody.WeavingTask
AssemblyPath="$(TargetPath)"
IntermediateDir="$(IntermediateDir)"
KeyFilePath="$(KeyOriginatorFile)"
MessageImportance="$(FodyMessageImportance)"
ProjectDirectory="$(ProjectDir)"
SolutionDir="$(FodySolutionDir)"
References="@(ReferencePath)"
/>
<Copy
SourceFiles="$(TargetPath)"
DestinationFolder="$(IntermediateDir)" />
<Copy
SourceFiles="$(TargetDir)$(TargetName).pdb"
DestinationFolder="$(IntermediateDir)"
Condition="Exists('$(TargetDir)$(TargetName).pdb')"/>
<Copy
SourceFiles="$(TargetDir)$(TargetName).mdb"
DestinationFolder="$(IntermediateDir)"
Condition="Exists('$(TargetDir)$(TargetName).mdb')"/>
</Target>
<Target
AfterTargets="AfterBuild"
Name="NonWinFodyTarget"
Condition=" '$(OS)' != 'Windows_NT'">
<Fody.WeavingTask
AssemblyPath="$(TargetPath)"
IntermediateDir="$(IntermediateDir)"
KeyFilePath="$(KeyOriginatorFile)"
MessageImportance="$(FodyMessageImportance)"
ProjectDirectory="$(ProjectDir)"
SolutionDir="$(FodySolutionDir)"
References="@(ReferencePath)"
/>
</Target>
<!--Support for ncrunch-->
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)*.*" />
</ItemGroup>
</Project>