-
Notifications
You must be signed in to change notification settings - Fork 1
/
FString.targets
38 lines (33 loc) · 2.12 KB
/
FString.targets
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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<FStringCompilerPath>$(MSBuildThisFileDirectory)\FStringCompiler\bin\FStringCompiler.exe</FStringCompilerPath>
<FStringLibraryPath>$(MSBuildThisFileDirectory)\FString</FStringLibraryPath>
<FStringOutputPath>$(MSBuildProjectDirectory)\obj\FStrings</FStringOutputPath>
<FStringSentinelPath>$(FStringOutputPath)\.sentinel</FStringSentinelPath>
<FStringDefaultCulture>eng</FStringDefaultCulture>
<FStringMainXmlPath>$(FStringOutputPath)\FStringTable_$(FStringDefaultCulture).xml</FStringMainXmlPath>
</PropertyGroup>
<ItemGroup>
<ProjectCapability Include="DynamicDependentFile" />
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)ProjectItemsSchema.xaml" />
<!-- Reference the library -->
<ProjectReference Include="$(FStringLibraryPath)\LibFString.csproj">
<Project>{91D1707E-393D-4A80-9C9C-AF33C707B76F}</Project>
<Name>LibFString</Name>
</ProjectReference>
<ContentWithTargetPath Include="$(FStringOutputPath)\FStringTable_*.xml" TargetPath="%(Filename)%(Extension)" CopyToOutputDirectory="Always" />
<!-- Second copy to use for clean target below -->
<FStringOutputs Include="$(FStringOutputPath)\*.cs">
<Visible>false</Visible>
</FStringOutputs>
</ItemGroup>
<Target Name="CleanFStrings" BeforeTargets="BeforeBuildDependsOn;CompileFStrings" Inputs="@(FStringTable)" Outputs="$(FStringSentinelPath)">
<!-- HACK: If we need to rebuild anything, we need to delete all the outputs to ensure a full rebuild. -->
<Delete Files="@(FStringOutputs)" />
</Target>
<Target Name="CompileFStrings" BeforeTargets="BeforeCompile" Inputs="@(FStringTable)" Outputs="@(FStringMainXmlPath);@(FStringTable->'$(FStringOutputPath)\%(Filename).cs')">
<Message Importance="High" Text="Compiling FStrings" />
<!-- pass the paths of all the FStringTable files as a quoted list to the compiler -->
<Exec Command=""$(FStringCompilerPath)" $(FStringDefaultCulture) "$(FStringOutputPath)" @(FStringTable->'"%(FullPath)"', ' ')" />
</Target>
</Project>