-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add LICENSE & THIRD-PARTY-LICENSES to NuGet Package (#32)
* Create THIRD-PARTY-LICENSES * Update .csproj to include license & append third-party licenses
- Loading branch information
1 parent
30186e1
commit d425e70
Showing
2 changed files
with
130 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
This project uses third-party libraries or other resources | ||
which are used under the terms of the following license(s). | ||
|
||
=========================================================== | ||
|
||
.NET Runtime License | ||
|
||
https://github.com/dotnet/runtime | ||
|
||
The MIT License (MIT) | ||
|
||
Copyright (c) .NET Foundation and Contributors | ||
|
||
All rights reserved. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,101 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<!-- DETAILS --> | ||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<Title>TJC Singleton Base</Title> | ||
<Description>Singleton Base & Singleton Factory</Description> | ||
<RepositoryUrl>https://github.com/TJC-Tools/TJC.Singleton</RepositoryUrl> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="Nuget.config" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="Nuget.config"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<Title>TJC Singleton Base</Title> | ||
<Description>Singleton Base & Singleton Factory</Description> | ||
<Authors>Tyler Carrol</Authors> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
<PackageLicenseFile>LICENSE</PackageLicenseFile> | ||
<RepositoryUrl>https://github.com/TJC-Tools/TJC.Singleton</RepositoryUrl> | ||
</PropertyGroup> | ||
<!-- INCLUDED FILES --> | ||
<ItemGroup> | ||
<None Include="..\README.md"> | ||
<Pack>True</Pack> | ||
<PackagePath>\</PackagePath> | ||
</None> | ||
<None Remove="Nuget.config" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"> | ||
<_Parameter1>TJC.Singleton.Tests</_Parameter1> | ||
</AssemblyAttribute> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<ItemGroup> | ||
<Content Include="Nuget.config"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="..\README.md"> | ||
<Pack>True</Pack> | ||
<PackagePath>\</PackagePath> | ||
</None> | ||
<None Include="..\LICENSE"> | ||
<Pack>True</Pack> | ||
<PackagePath>\</PackagePath> | ||
</None> | ||
</ItemGroup> | ||
<!-- DEPENDENCIES --> | ||
<ItemGroup> | ||
<!-- N/A --> | ||
</ItemGroup> | ||
<!-- TESTS --> | ||
<ItemGroup> | ||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"> | ||
<_Parameter1>TJC.Singleton.Tests</_Parameter1> | ||
</AssemblyAttribute> | ||
</ItemGroup> | ||
<!-- TASKS --> | ||
<UsingTask TaskName="ReadFileContent" TaskFactory="RoslynCodeTaskFactory" AssemblyName="Microsoft.Build.Tasks.Core"> | ||
<ParameterGroup> | ||
<FilePath ParameterType="System.String" Required="true" /> | ||
<Content Output="true" ParameterType="System.String" /> | ||
</ParameterGroup> | ||
<Task> | ||
<Using Namespace="System.IO" /> | ||
<Code Type="Fragment" Language="cs"> | ||
<![CDATA[ | ||
Content = File.ReadAllText(FilePath); | ||
]]> | ||
</Code> | ||
</Task> | ||
</UsingTask> | ||
<UsingTask TaskName="AppendNewLineAndFile" TaskFactory="RoslynCodeTaskFactory" AssemblyName="Microsoft.Build.Tasks.Core"> | ||
<ParameterGroup> | ||
<File1 ParameterType="System.String" Required="true" /> | ||
<File2 ParameterType="System.String" Required="true" /> | ||
</ParameterGroup> | ||
<Task> | ||
<Using Namespace="System.IO" /> | ||
<Code Type="Fragment" Language="cs"> | ||
<![CDATA[ | ||
var text = Environment.NewLine; | ||
text += "==========================================================="; | ||
text += Environment.NewLine; | ||
text += Environment.NewLine; | ||
text += File.ReadAllText(File2); | ||
text += Environment.NewLine; | ||
File.AppendAllText(File1, text); | ||
]]> | ||
</Code> | ||
</Task> | ||
</UsingTask> | ||
<!-- PRE-BUILD --> | ||
<Target Name="CustomSetup" BeforeTargets="Build"> | ||
<Message Text="=== CUSTOM SETUP ===" Importance="high" /> | ||
<!-- Store the original contents of the license file --> | ||
<ReadFileContent FilePath="..\LICENSE"> | ||
<Output TaskParameter="Content" PropertyName="OriginalLicenseLines" /> | ||
</ReadFileContent> | ||
<CallTarget Targets="AppendThirdPartyLicensesToLicenseFile" /> | ||
</Target> | ||
<Target Name="AppendThirdPartyLicensesToLicenseFile"> | ||
<Message Text="Append Third-Party Licenses to License File" Importance="high" /> | ||
<AppendNewLineAndFile File1="..\LICENSE" File2="..\THIRD-PARTY-LICENSES" /> | ||
</Target> | ||
<!-- POST-PACK --> | ||
<Target Name="CustomCleanup" AfterTargets="Pack"> | ||
<Message Text="=== CUSTOM CLEANUP ===" Importance="high" /> | ||
<CallTarget Targets="RestoreLicenseFile" /> | ||
</Target> | ||
<!-- Cleanup License File --> | ||
<Target Name="RestoreLicenseFile"> | ||
<Message Text="Restore License File Contents" Importance="high" /> | ||
<WriteLinesToFile File="..\LICENSE" Lines="$(OriginalLicenseLines)" Overwrite="true" Encoding="UTF-8" /> | ||
</Target> | ||
</Project> |