Fody.targets 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3. <Choose>
  4. <When Condition="$(NCrunchOriginalSolutionDir) != '' And $(NCrunchOriginalSolutionDir) != '*Undefined*'">
  5. <PropertyGroup>
  6. <FodySolutionDir>$(NCrunchOriginalSolutionDir)</FodySolutionDir>
  7. </PropertyGroup>
  8. </When>
  9. <When Condition="$(SolutionDir) != '' And $(SolutionDir) != '*Undefined*'">
  10. <PropertyGroup>
  11. <FodySolutionDir>$(SolutionDir)</FodySolutionDir>
  12. </PropertyGroup>
  13. </When>
  14. <When Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">
  15. <PropertyGroup>
  16. <FodySolutionDir>$(MSBuildProjectDirectory)\..\</FodySolutionDir>
  17. </PropertyGroup>
  18. </When>
  19. </Choose>
  20. <Choose>
  21. <When Condition="$(KeyOriginatorFile) != '' And $(KeyOriginatorFile) != '*Undefined*'">
  22. <PropertyGroup>
  23. <FodyKeyFilePath>$(KeyOriginatorFile)</FodyKeyFilePath>
  24. </PropertyGroup>
  25. </When>
  26. <When Condition="$(AssemblyOriginatorKeyFile) != '' And $(AssemblyOriginatorKeyFile) != '*Undefined*'">
  27. <PropertyGroup>
  28. <FodyKeyFilePath>$(AssemblyOriginatorKeyFile)</FodyKeyFilePath>
  29. </PropertyGroup>
  30. </When>
  31. <Otherwise >
  32. <PropertyGroup>
  33. <FodyKeyFilePath></FodyKeyFilePath>
  34. </PropertyGroup>
  35. </Otherwise>
  36. </Choose>
  37. <PropertyGroup>
  38. <IntermediateDir>$(ProjectDir)$(IntermediateOutputPath)</IntermediateDir>
  39. <FodyMessageImportance Condition="$(FodyMessageImportance) == '' Or $(FodyMessageImportance) == '*Undefined*'">Low</FodyMessageImportance>
  40. <FodySignAssembly Condition="$(FodySignAssembly) == '' Or $(FodySignAssembly) == '*Undefined*'">$(SignAssembly)</FodySignAssembly>
  41. <FodyPath Condition="$(FodyPath) == '' Or $(FodyPath) == '*Undefined*'">$(MSBuildThisFileDirectory)</FodyPath>
  42. </PropertyGroup>
  43. <UsingTask
  44. TaskName="Fody.WeavingTask"
  45. AssemblyFile="$(FodyPath)\Fody.dll" />
  46. <Target
  47. AfterTargets="AfterCompile"
  48. Name="WinFodyTarget"
  49. Condition=" '$(OS)' == 'Windows_NT'">
  50. <Fody.WeavingTask
  51. AssemblyPath="@(IntermediateAssembly)"
  52. IntermediateDir="$(IntermediateDir)"
  53. KeyFilePath="$(FodyKeyFilePath)"
  54. MessageImportance="$(FodyMessageImportance)"
  55. ProjectDirectory="$(ProjectDir)"
  56. SolutionDir="$(FodySolutionDir)"
  57. References="@(ReferencePath)"
  58. SignAssembly="$(FodySignAssembly)"
  59. ReferenceCopyLocalPaths="@(ReferenceCopyLocalPaths)"
  60. DefineConstants="$(DefineConstants)"
  61. />
  62. </Target>
  63. <Target
  64. AfterTargets="AfterBuild"
  65. Name="NonWinFodyTarget"
  66. Condition=" '$(OS)' != 'Windows_NT'">
  67. <Fody.WeavingTask
  68. AssemblyPath="$(TargetPath)"
  69. IntermediateDir="$(IntermediateDir)"
  70. KeyFilePath="$(FodyKeyFilePath)"
  71. MessageImportance="$(FodyMessageImportance)"
  72. ProjectDirectory="$(ProjectDir)"
  73. SolutionDir="$(FodySolutionDir)"
  74. References="@(ReferencePath)"
  75. SignAssembly="$(FodySignAssembly)"
  76. ReferenceCopyLocalPaths="$(ReferenceCopyLocalPaths)"
  77. DefineConstants="$(DefineConstants)"
  78. />
  79. </Target>
  80. <!--Support for ncrunch-->
  81. <ItemGroup>
  82. <None Include="$(FodyPath)\*.*" />
  83. </ItemGroup>
  84. </Project>