Created
October 30, 2014 21:24
-
-
Save herskinduk/c718a70852e7bc3dcb25 to your computer and use it in GitHub Desktop.
msbuild target for generating T4 assembly directives based on project references
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
<Target Name="Write_AssemblyRefs_TT" BeforeTargets="TransformOnBuild"> | |
<!-- A message for all to enjoy! --> | |
<WriteLinesToFile File="@(MyTextFile)" | |
Lines="<# /* AUTOGENERATED BY MSBUILD and Kern Herskind Nightingale */ #>" | |
Overwrite="true" | |
Encoding="Unicode" /> | |
<!-- Output all assembly references with a HintPath --> | |
<WriteLinesToFile File="@(MyTextFile)" | |
Lines="<#@ assembly name="$(ProjectDir)%(Reference.HintPath)" #>" | |
Overwrite="false" | |
Encoding="Unicode" | |
Condition="'%(Reference.HintPath)' != ''" /> | |
<!-- Output all project references === this could fail with custom nameing/build output dirs --> | |
<WriteLinesToFile File="@(MyTextFile)" | |
Lines="<#@ assembly name="$(ProjectDir)%(ProjectReference.RelativeDir)bin\$(Configuration)\%(ProjectReference.Name).dll" #>" | |
Overwrite="false" | |
Encoding="Unicode" /> | |
</Target> | |
<ItemGroup> | |
<MyTextFile Include="AssemblyRefs.tt" /> | |
</ItemGroup> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment