Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AssemblyReferencesTT/AssemblyReferencesTT.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<None Include="content\AssemblyReferences.tt">
<LastGenOutput>AssemblyReferences.txt</LastGenOutput>
</None>
<None Include="content\References.tt" />
<None Include="NuGetPackage.ps1" />
<None Include="NuGetSetup.ps1" />
<None Include="NuGet.exe" />
Expand Down
58 changes: 27 additions & 31 deletions AssemblyReferencesTT/Package.nuspec
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>AssemblyReferencesTT</id>
<version>1.0.12</version>
<title>AssemblyReferences.tt</title>
<authors>Kern Herskind Nightingale</authors>
<owners>Herskind Limited</owners>
<description>
Build target for generating a T4 file with a list of assembly directives based on the projects references. References with a hint path and solution references will be listed the AssemblyReferences.tt file. This file can then be included by other T4 files.
</description>
<releaseNotes>
</releaseNotes>
<summary>
Build target for generating a T4 file with a list of assembly directives based on the projects references.
</summary>
<language>en-GB</language>
<projectUrl>https://github.com/herskinduk/AssemblyReferencesTT</projectUrl>
<iconUrl>https://nuget.org/Content/Images/packageDefaultIcon-50x50.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl>http://opensource.org/licenses/MIT</licenseUrl>
<copyright>Copyright 2014</copyright>
<dependencies>
</dependencies>
<references></references>
<tags >t4 text template transformation toolkit assembly project reference references csproj tt hintpath hint path</tags>
</metadata>
<files>
<file src="build\" target="build" />
<file src="content\" target="content" />
</files>
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>AssemblyReferencesTT</id>
<version>1.0.13</version>
<title>AssemblyReferences.tt</title>
<authors>Kern Herskind Nightingale</authors>
<owners>Herskind Limited</owners>
<licenseUrl>http://opensource.org/licenses/MIT</licenseUrl>
<projectUrl>https://github.com/herskinduk/AssemblyReferencesTT</projectUrl>
<iconUrl>https://nuget.org/Content/Images/packageDefaultIcon-50x50.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Build target for generating a T4 file with a list of assembly directives based on the projects references. References with a hint path and solution references will be listed the AssemblyReferences.tt file. This file can then be included by other T4 files.</description>
<summary>Build target for generating a T4 file with a list of assembly directives based on the projects references.</summary>
<releaseNotes />
<copyright>Copyright 2014</copyright>
<language>en-GB</language>
<tags>t4 text template transformation toolkit assembly project reference references csproj tt hintpath hint path</tags>
</metadata>
<files>
<file src="build\AssemblyReferencesTT.targets" target="build\AssemblyReferencesTT.targets" />
<file src="content\AssemblyReferences.tt" target="content\AssemblyReferences.tt" />
<file src="content\References.tt" target="content\References.tt" />
<file src="tools\init.ps1" target="tools\init.ps1" />
<file src="tools\install.ps1" target="tools\install.ps1" />
<file src="tools\uninstall.ps1" target="tools\uninstall.ps1" />
</files>
</package>
49 changes: 49 additions & 0 deletions AssemblyReferencesTT/build/AssemblyReferencesTT.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Target Name="AssemblyReferencesTT" BeforeTargets="Build;TransformOnBuild">
<!-- Look for files to generate -->
<ItemGroup>
<AssemblyReferencesTT Include="@(None)" Condition="'%(None.Filename)%(None.Extension)' == 'AssemblyReferences.tt'"/>
<ReferencesTT Include="@(None)" Condition="'%(None.Filename)%(None.Extension)' == 'References.tt'"/>
</ItemGroup>

<Error Condition="'@(AssemblyReferencesTT->Count())' == 0" Text="No AssemblyReferences.tt file(s) found" />
<Error Condition="'@(ReferencesTT->Count())' == 0" Text="No References.tt file(s) found" />

<!-- A message for all to enjoy! -->
<WriteLinesToFile File="@(AssemblyReferencesTT)"
Lines="&lt;# /* AUTOGENERATED BY MSBUILD and Kern Herskind Nightingale */ #&gt;"
Overwrite="true"
Encoding="Unicode" />

<!-- Output all assembly references with a HintPath -->
<WriteLinesToFile File="@(AssemblyReferencesTT)"
Lines="&lt;#@ assembly name=&quot;%24%28ProjectDir%29%(Reference.HintPath)&quot; #&gt;"
Overwrite="false"
Encoding="Unicode"
Condition="'%(Reference.HintPath)' != ''" />

<!-- Output all project references. This could fail with custom naming/structure of build output dirs -->
<WriteLinesToFile File="@(AssemblyReferencesTT)"
Lines="&lt;#@ assembly name=&quot;%24%28ProjectDir%29%(ProjectReference.RelativeDir)bin\$(Configuration)\%(ProjectReference.Name).dll&quot; #&gt;"
Overwrite="false"
Encoding="Unicode"
Condition="'%(ProjectReference.Name)' != ''" />

<!-- A message for all to enjoy! -->
<WriteLinesToFile File="@(ReferencesTT)"
Lines="&lt;# /* AUTOGENERATED BY MSBUILD and Kern Herskind Nightingale */ #&gt;"
Overwrite="true"
Encoding="Unicode" />

<!-- Output all assembly references without a HintPath -->
<WriteLinesToFile File="@(ReferencesTT)"
Lines="&lt;#@ assembly name=&quot;%(Reference.Identity)&quot; #&gt;"
Overwrite="false"
Encoding="Unicode"
Condition="'%(Reference.HintPath)' == ''" />

<Message Text="Generating %(AssemblyReferencesTT.FullPath) and %(ReferencesTT.FullPath)" Importance="high" />
</Target>
</Project>
1 change: 1 addition & 0 deletions AssemblyReferencesTT/content/References.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<# /* AUTOGENERATED BY MSBUILD and Kern Herskind Nightingale */ #>
3 changes: 3 additions & 0 deletions AssemblyReferencesTT/tools/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ param($installPath, $toolsPath, $package, $project)
# $toolsPath is the path to the tools directory in the folder where the package is installed.
# $package is a reference to the package object.
# $project is a reference to the project the package was installed to.

$project.ProjectItems.Item("AssemblyReferences.tt").Properties.Item("CustomTool").Value = ""
$project.ProjectItems.Item("References.tt").Properties.Item("CustomTool").Value = ""