Created
October 30, 2018 09:21
-
-
Save yuriyostapenko/f988bca133498bbae8381740ec5ab458 to your computer and use it in GitHub Desktop.
Naive file length enforcement before build
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
<Project> | |
<Target Name="DubiksCube" BeforeTargets="Build"> | |
<PropertyGroup> | |
<DubiksLimit>42</DubiksLimit> | |
</PropertyGroup> | |
<ItemGroup> | |
<FilesWithNames Include="@(Compile)" NameLength="$([System.String]::new('%(Identity)').Length)" /> | |
<FilesWithTooLongNames Include="@(FilesWithNames)" Condition="%(NameLength) > $(DubiksLimit)" /> | |
</ItemGroup> | |
<Error Condition="'@(FilesWithTooLongNames->Count())' > 0" Text="These file names are too long: @(FilesWithTooLongNames)" /> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment