-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTJC.Collection.Console.csproj
More file actions
98 lines (98 loc) · 3.63 KB
/
TJC.Collection.Console.csproj
File metadata and controls
98 lines (98 loc) · 3.63 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<Project Sdk="Microsoft.NET.Sdk">
<!-- DETAILS -->
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Title>TJC Collection Console</Title>
<Description>Collection of NuGet Packages for Console Applications</Description>
<Authors>Tyler Carrol</Authors>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/../CHANGELOG.md"))</PackageReleaseNotes>
<RepositoryUrl>https://github.com/TJC-Tools/TJC.Collection.Console</RepositoryUrl>
</PropertyGroup>
<!-- INCLUDED FILES -->
<ItemGroup>
<None Remove="Nuget.config" />
</ItemGroup>
<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>
<EmbeddedResource Include="..\LICENSE" />
</ItemGroup>
<!-- DEPENDENCIES -->
<ItemGroup>
<PackageReference Include="TJC.Collection.Core" Version="0.27.0" />
<PackageReference Include="TJC.ConsoleApplication" Version="0.14.7" />
</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-PACK -->
<Target Name="CustomSetup" BeforeTargets="_IntermediatePack">
<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>