forked from dotnet/msbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreatePrivateMSBuildEnvironment.proj
59 lines (47 loc) · 3.19 KB
/
CreatePrivateMSBuildEnvironment.proj
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" InitialTargets="CheckForBootstrap" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="dir.props" />
<ItemGroup>
<InstalledVersionedExtensions Include="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\**\*.targets" />
<InstalledVersionedExtensions Include="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\**\*.props" />
<ShimTargets Include="Microsoft.Data.Entity.targets" />
<ShimTargets Include="Microsoft.ServiceModel.targets" />
<ShimTargets Include="Microsoft.WinFx.targets" />
<ShimTargets Include="Microsoft.WorkflowBuildExtensions.targets" />
<ShimTargets Include="Microsoft.Xaml.targets" />
<ShimTargets Include="Workflow.Targets" />
<ShimTargets Include="Workflow.VisualBasic.Targets" />
<InstalledMicrosoftExtensions Include="$(MSBuildExtensionsPath)\Microsoft\**\*.props" />
<InstalledMicrosoftExtensions Include="$(MSBuildExtensionsPath)\Microsoft\**\*.targets" />
<InstalledNuGetFiles Include="$(MSBuildExtensionsPath)\Microsoft\NuGet\*" />
<FreshlyBuiltBinaries Include="$(OutputPath)**\*.dll" />
<FreshlyBuiltBinaries Include="$(OutputPath)*.exe" />
<FreshlyBuiltBinaries Include="$(OutputPath)*.pdb" />
<FreshlyBuiltBinaries Include="$(OutputPath)*.exe.config" />
<FreshlyBuiltProjects Include="$(OutputPath)*props" />
<FreshlyBuiltProjects Include="$(OutputPath)*targets" />
<FreshlyBuiltProjects Include="$(OutputPath)*tasks" />
</ItemGroup>
<Target Name="Build">
<!-- Copy in props and targets from the machine-installed MSBuildExtensionsPath -->
<Copy SourceFiles="@(InstalledVersionedExtensions)"
DestinationFiles="@(InstalledVersionedExtensions->'$(BootstrapDestination)$(TargetMSBuildToolsVersion)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(InstalledMicrosoftExtensions)"
DestinationFiles="@(InstalledMicrosoftExtensions->'$(BootstrapDestination)Microsoft\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(InstalledNuGetFiles)"
DestinationFiles="@(InstalledNuGetFiles->'$(BootstrapDestination)Microsoft\NuGet\%(Filename)%(Extension)')" />
<!-- Delete shim projects, because they point where we can't follow. -->
<!-- It would be better to just not copy these. -->
<Delete Files="@(ShimTargets->'$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\%(FileName)%(Extension)')" />
<!-- Copy our binaries -->
<Copy SourceFiles="@(FreshlyBuiltBinaries)"
DestinationFiles="@(FreshlyBuiltBinaries -> '$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\%(RecursiveDir)%(Filename)%(Extension)')" />
<!-- Copy our freshly-built props and targets, overwriting anything we copied from the machine -->
<Copy SourceFiles="@(FreshlyBuiltProjects)"
DestinationFolder="$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin" />
</Target>
<Target Name="CheckForBootstrap">
<Error Text="You must not build $(MSBuildThisFile) with BootstrapBuildPath set. It needs to see the 'machine-installed' MSBuildExtensionsPath."
Condition="'$(BootstrapBuildPath)' != ''" />
</Target>
</Project>