forked from dotnet/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FSharpBuild.Directory.Build.targets
41 lines (34 loc) · 2.18 KB
/
FSharpBuild.Directory.Build.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
39
40
41
<Project>
<PropertyGroup>
<XlfLanguages>en;$(XlfLanguages)</XlfLanguages>
<TargetDotnetProfile Condition="$(TargetFramework.StartsWith('netstandard')) or $(TargetFramework.StartsWith('netcoreapp'))">coreclr</TargetDotnetProfile>
<TargetDotnetProfile Condition="$(TargetFramework.StartsWith('net4'))">net40</TargetDotnetProfile>
<ActualOutputPath Condition="'$(Language)' != 'VB'">$(MSBuildProjectDirectory)\$(OutputPath)</ActualOutputPath>
<ActualOutputPath Condition="'$(Language)' == 'VB'">$(OutputPath)</ActualOutputPath>
<FinalOutputPath>$(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\bin</FinalOutputPath>
<FinalIntermediateOutputPath>$(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\obj</FinalIntermediateOutputPath>
</PropertyGroup>
<Target Name="HACK_CopyOutputsToTheProperLocation"
AfterTargets="AfterBuild"
Condition="'$(DisableOutputPathCopying)' != 'true'">
<!--
Ideally we'd set <OutputPath> to `$(Configuration)\[net40|coreclr]\bin`, but the calculation of `[net40|coreclr]`
depends on the `$(TargetFramework)` variable which is set by the individual project files, but by the time we have
that value (e.g., in this file) it's too late; some targets, particularly from the VsSDK have already used the
values of $(OutputPath)/$(OutDir).
The fix is to not set `$(Outputpath)` and simply copy stuff there after the fact.
-->
<ItemGroup>
<OutputFilesToCopy Include="$(ActualOutputPath)**" />
<IntermediateFilesToCopy Include="$(IntermediateOutputPath)\**" />
</ItemGroup>
<Message Text="Copying build artifacts to $(FinalOutputPath)" />
<MakeDir Directories="$(FinalOutputPath);$(FinalIntermediateOutputPath)" />
<Copy SourceFiles="@(OutputFilesToCopy)" DestinationFolder="$(FinalOutputPath)" />
<Copy SourceFiles="@(IntermediateFilesToCopy)" DestinationFolder="$(FinalIntermediateOutputPath)" />
</Target>
<Import Project="build\targets\AssemblyVersions.props" />
<Import Project="build\targets\ConvertPortablePdbs.targets" />
<Import Project="build\targets\GenerateAssemblyAttributes.targets" />
<Import Project="build\targets\GenerateInternalsVisibleTo.targets" />
</Project>