Skip to content
Merged
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
6 changes: 0 additions & 6 deletions TJC.StringExtensions.Tests/TJC.StringExtensions.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\TJC.StringExtensions\TJC.StringExtensions.csproj" />
</ItemGroup>

<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>

</Project>
165 changes: 89 additions & 76 deletions TJC.StringExtensions/TJC.StringExtensions.csproj
Original file line number Diff line number Diff line change
@@ -1,106 +1,119 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- DETAILS -->
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Title>TJC String Extensions</Title>
<Description>String Extensions</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.StringExtensions</RepositoryUrl>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Title>TJC String Extensions</Title>
<Description>String Extensions</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.StringExtensions</RepositoryUrl>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<!-- INCLUDED FILES -->
<ItemGroup>
<None Remove="Nuget.config" />
<None Remove="Nuget.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Nuget.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<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" />
<None Include="..\CHANGELOG.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<EmbeddedResource Include="..\CHANGELOG.md" />
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<EmbeddedResource Include="..\LICENSE" />
<None Include="..\CHANGELOG.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<EmbeddedResource Include="..\CHANGELOG.md" />
</ItemGroup>
<!-- DEPENDENCIES -->
<!-- TESTS -->
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>TJC.StringExtensions.Tests</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>TJC.StringExtensions.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);
<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>
</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);
<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>
</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" />
<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" />
<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" />
<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" />
<Message Text="Restore License File Contents" Importance="high" />
<WriteLinesToFile
File="..\LICENSE"
Lines="$(OriginalLicenseLines)"
Overwrite="true"
Encoding="UTF-8"
/>
</Target>
</Project>
Loading