Skip to content

Instantly share code, notes, and snippets.

@qbit86
Created June 13, 2018 23:06
Show Gist options
  • Save qbit86/8f83c9902b562388865f9297adc48068 to your computer and use it in GitHub Desktop.
Save qbit86/8f83c9902b562388865f9297adc48068 to your computer and use it in GitHub Desktop.
Amalgamation
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<!-- https://stackoverflow.com/questions/15858710/how-concatenate-files-in-msbuild-and-preserve-tabs-and-spaces -->
<Target Name="ConcatenateScripts" AfterTargets="Build">
<ItemGroup>
<ConcatFiles Include="@(Compile)" />
<ConcatFiles Remove="obj/**/*.cs" />
<ConcatFiles Remove="$(UserProfile)/**/*.AssemblyAttributes.cs" />
</ItemGroup>
<ItemGroup>
<FileContents Include="// $([System.DateTime]::Now)" />
<FileContents Include="// %(ConcatFiles.Identity)%0d%0a$([System.IO.File]::ReadAllText('%(ConcatFiles.Identity)'))" />
<FileContents Include="// $([System.DateTime]::Now)" />
</ItemGroup>
<WriteLinesToFile File="Amalgam.g.txt" Lines="@(FileContents)" Overwrite="true" />
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment