|
1 | 1 | <Project> |
2 | 2 |
|
3 | 3 | <PropertyGroup> |
| 4 | + <XlfLanguages>en;$(XlfLanguages)</XlfLanguages> |
4 | 5 | <TargetDotnetProfileCondition="$(TargetFramework.StartsWith('netstandard')) or $(TargetFramework.StartsWith('netcoreapp'))">coreclr</TargetDotnetProfile> |
5 | 6 | <TargetDotnetProfileCondition="$(TargetFramework.StartsWith('net4'))">net40</TargetDotnetProfile> |
6 | | - <OutputPath>$(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\bin</OutputPath> |
7 | | - <IntermediateOutputPath>$(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\obj\$(MSBuildProjectName)\</IntermediateOutputPath> |
8 | | - <XlfLanguages>en;$(XlfLanguages)</XlfLanguages> |
| 7 | + <ActualOutputPathCondition="'$(Language)' != 'VB'">$(MSBuildProjectDirectory)\$(OutputPath)</ActualOutputPath> |
| 8 | + <ActualOutputPathCondition="'$(Language)' == 'VB'">$(OutputPath)</ActualOutputPath> |
| 9 | + <FinalOutputPath>$(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\bin</FinalOutputPath> |
| 10 | + <FinalIntermediateOutputPath>$(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\obj</FinalIntermediateOutputPath> |
9 | 11 | </PropertyGroup> |
10 | 12 |
|
| 13 | + <TargetName="HACK_CopyOutputsToTheProperLocation" |
| 14 | +AfterTargets="AfterBuild" |
| 15 | +Condition="'$(DisableOutputPathCopying)' != 'true'"> |
| 16 | +<!-- |
| 17 | + Ideally we'd set <OutputPath> to `$(Configuration)\[net40|coreclr]\bin`, but the calculation of `[net40|coreclr]` |
| 18 | + depends on the `$(TargetFramework)` variable which is set by the individual project files, but by the time we have |
| 19 | + that value (e.g., in this file) it's too late; some targets, particularly from the VsSDK have already used the |
| 20 | + values of $(OutputPath)/$(OutDir). |
| 21 | +
|
| 22 | + The fix is to not set `$(Outputpath)` and simply copy stuff there after the fact. |
| 23 | +--> |
| 24 | + |
| 25 | + <ItemGroup> |
| 26 | + <OutputFilesToCopyInclude="$(ActualOutputPath)**" /> |
| 27 | + <IntermediateFilesToCopyInclude="$(IntermediateOutputPath)\**" /> |
| 28 | + </ItemGroup> |
| 29 | + |
| 30 | + <MessageText="Copying build artifacts to $(FinalOutputPath)" /> |
| 31 | + <MakeDirDirectories="$(FinalOutputPath);$(FinalIntermediateOutputPath)" /> |
| 32 | + <CopySourceFiles="@(OutputFilesToCopy)"DestinationFolder="$(FinalOutputPath)" /> |
| 33 | + <CopySourceFiles="@(IntermediateFilesToCopy)"DestinationFolder="$(FinalIntermediateOutputPath)" /> |
| 34 | + </Target> |
| 35 | + |
11 | 36 | <ImportProject="build\targets\AssemblyVersions.props" /> |
12 | 37 | <ImportProject="build\targets\GenerateAssemblyAttributes.targets" /> |
13 | 38 | <ImportProject="build\targets\GenerateInternalsVisibleTo.targets" /> |
|