Skip to content

Commit 20bf5fa

Browse files
Manually include compiled file in source via auto copy.
1 parent cbd1872 commit 20bf5fa

File tree

3 files changed

+1179
-2
lines changed

3 files changed

+1179
-2
lines changed

src/Directory.Build.targets

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,34 @@
5555
<ItemGroup>
5656
<!--Shared config files that have to exist at root level.-->
5757
<ConfigFilesToCopy Include="..\..\shared-infrastructure\.editorconfig;..\..\shared-infrastructure\.gitattributes" />
58+
<!--
59+
Copy submodule files generated via T4 templates.
60+
We cannot include the generated files in the submodule as any solution wide T4 regeneration
61+
could potentially cause the module to be marked dirty which is a headache.
62+
This, instead, combined with using 'Compile Update' over 'Include' allows us to copy the file
63+
across from the submodule and place it directly in the src folder for compilation.
64+
-->
65+
<SubmoduleSourceFilesToCopy Include="..\..\shared-infrastructure\src\SharedInfrastructure\Guard.Numeric.cs" />
5866
</ItemGroup>
5967

6068
<!--Ensures our config files are up to date.-->
6169
<Target Name="CopyFiles" BeforeTargets="Build">
62-
<Copy SourceFiles="@(ConfigFilesToCopy)" DestinationFolder="..\..\" />
70+
<Copy SourceFiles="@(ConfigFilesToCopy)"
71+
SkipUnchangedFiles = "true"
72+
DestinationFolder="..\..\" />
73+
74+
<Copy SourceFiles="@(SubmoduleSourceFilesToCopy)"
75+
DestinationFolder="..\..\src\ImageSharp\Common\Helpers"
76+
SkipUnchangedFiles="true"
77+
ContinueOnError="true" />
6378
</Target>
6479

6580
<!-- Allows regenerating T4-generated files at build time using MsBuild -->
81+
<!-- Enable on Windows OS to build all T4 templates. TODO: XPlat
6682
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TextTemplating\Microsoft.TextTemplating.targets" />
6783
<PropertyGroup>
6884
<TransformOnBuild>true</TransformOnBuild>
6985
</PropertyGroup>
86+
-->
7087

7188
</Project>

0 commit comments

Comments
 (0)