forked from dotnet/wcf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdir.targets
121 lines (105 loc) · 7.63 KB
/
dir.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" InitialTargets="CheckForBuildTools" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="CheckForBuildTools">
<Error Condition="!Exists('$(ToolsDir)') and '$(OverrideToolsDir)'=='true'"
Text="The tools directory [$(ToolsDir)] does not exist. Please run sync in your enlistment to ensure the tools are installed before attempting to build an individual project." />
<Error Condition="!Exists('$(ToolsDir)') and '$(OverrideToolsDir)'!='true'"
Text="The tools directory [$(ToolsDir)] does not exist. Please run init-tools.cmd in your enlistment to ensure the tools are installed before attempting to build an individual project." />
</Target>
<!-- Provide default targets which can be hooked onto or overridden as necessary -->
<Target Name="BuildAndTest" DependsOnTargets="Build;Test" />
<Target Name="RebuildAndTest" DependsOnTargets="Rebuild;Test" />
<Target Name="Test" />
<!-- Targets will be overridden if buildagainstpackages.targets is imported. -->
<Target Name="GenerateTestProjectJson" />
<Target Name="GenerateAllTestProjectJsons" />
<Target Name="UndefineTestTFM" BeforeTargets="AssignProjectConfiguration">
<ItemGroup>
<ProjectReference>
<!--
Always undefine TestTFM and FilterToTestTFM for all project reference as not needed for compilation and
avoid bin clash tool to fail
-->
<UndefineProperties>%(ProjectReference.UndefineProperties);TestTFM;FilterToTestTFM</UndefineProperties>
</ProjectReference>
</ItemGroup>
</Target>
<PropertyGroup>
<CommonTestProjectJson>$(MSBuildThisFileDirectory)src/Common/test-runtime/project.json</CommonTestProjectJson>
<CommonTestProjectLockJson>$(MSBuildThisFileDirectory)src/Common/test-runtime/project.lock.json</CommonTestProjectLockJson>
<CommonOutputTestProjectJson>$(GeneratedProjectJsonDir)/project.json</CommonOutputTestProjectJson>
<CommonOutputTestProjectLockJson>$(GeneratedProjectJsonDir)/project.lock.json</CommonOutputTestProjectLockJson>
</PropertyGroup>
<PropertyGroup Condition="'$(IsTestProject)' == 'true'">
<CommonTestProjectJson Condition="'$(BuildTestsAgainstPackages)'=='true'">$(CommonOutputTestProjectJson)</CommonTestProjectJson>
<CommonTestProjectLockJson Condition="'$(BuildTestsAgainstPackages)'=='true'">$(CommonOutputTestProjectLockJson)</CommonTestProjectLockJson>
<ProjectJson Condition="'$(ProjectJson)'=='' and Exists('$(MSBuildProjectDirectory)/project.json')">$(MSBuildProjectDirectory)/project.json</ProjectJson>
<!-- If project specific project.json exists then don't skip generating test project.json files -->
<SkipGenerateTestProjectJson Condition="'$(ProjectJson)'==''" >true</SkipGenerateTestProjectJson>
<ProjectJson Condition="'$(ProjectJson)'==''">$(CommonTestProjectJson)</ProjectJson>
<ProjectLockJson Condition="'$(ProjectJson)'=='$(CommonTestProjectJson)'">$(CommonTestProjectLockJson)</ProjectLockJson>
</PropertyGroup>
<Import Project="$(ToolsDir)/Build.Common.targets" Condition="Exists('$(ToolsDir)/Build.Common.targets')" />
<!-- permit a wrapping build system to contribute targets to this build -->
<Import Condition="Exists('$(MSBuildThisFileDirectory)..\open.targets')" Project="$(MSBuildThisFileDirectory)..\open.targets" />
<PropertyGroup>
<!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two properties to any folder that exists to skip
the GenerateReferenceAssemblyPaths task (not target) and to prevent it from outputting a warning (MSB3644). -->
<_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)/Documentation</_TargetFrameworkDirectories>
<_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)/Documentation</_FullFrameworkReferenceAssemblyPaths>
<!-- We do not want to target a portable profile.
TODO: Make this the default in buildtools so this is not necessary. -->
<TargetFrameworkProfile></TargetFrameworkProfile>
<!-- We set this property to avoid MSBuild errors regarding not setting TargetFrameworkProfile (see above line) -->
<PortableNuGetMode>true</PortableNuGetMode>
<!-- tests should not set this. A value of netstandard* triggers validation which is irrelevant for tests. Remove once ValidatePackageTargetFramework target is removed -->
<PackageTargetFramework Condition="'$(IsTestProject)' == 'true'"></PackageTargetFramework>
</PropertyGroup>
<!--
add the test-runtime project.json to the list of supplemental test data so it will get included
in the test archive; the stress test build system depends on it when building test mixes.
-->
<ItemGroup Condition="'$(IsTestProject)'=='true'">
<SupplementalTestData Include="$(SourceDir)Common/test-runtime/project.json">
<DestinationDir>test-runtime/</DestinationDir>
</SupplementalTestData>
</ItemGroup>
<ItemGroup Condition="'$(NuGetTargetMoniker)'=='.NETStandard,Version=v1.7'">
<!-- Temporarily suppress the message until we get a nuget version that knows about the mapping between netstandard1.7 and uap10.1 -->
<SuppressPackageTargetFrameworkCompatibility Include="uap10.1" />
</ItemGroup>
<Target Name="ProducesPackageId"
Returns="@(PackageIds)">
<ItemGroup>
<PackageIds Include="$(Id)" />
</ItemGroup>
</Target>
<Target Name="RewriteReferences" Condition="'$(SourceIndex)' == 'true'" AfterTargets="ResolveNuGetPackages">
<ItemGroup>
<Reference Remove="@(_ReferenceFromPackage)"/>
<_ReferenceProjectToHarvest Include="@(_ReferenceFromPackage -> '$(MSBuildThisFileDirectory)src/%(Filename)/src/%(FileName).csproj')"/>
<_ReferenceProjectToHarvest Include="@(_ReferenceFromPackage -> '$(MSBuildThisFileDirectory)src/%(Filename)/src/%(FileName).vbproj')"/>
</ItemGroup>
<MSBuild Condition="'$(SourceIndex)' == 'true' AND Exists('%(Identity)')"
Projects="%(_ReferenceProjectToHarvest.Identity)"
Targets="GetTargetPath">
<Output TaskParameter="TargetOutputs" ItemName="_PackageLibReferencePath"/>
</MSBuild>
<Error Condition="!Exists('%(_PackageLibReferencePath.Identity)')" Text="Required Reference '%(Identity)' does not exist. Ensure that you have built the entire tree."/>
<ItemGroup Condition=" '$(SourceIndex)' == 'true' ">
<ReferencePath Include="%(_PackageLibReferencePath.Identity)" Condition="Exists('%(Identity)')"/>
<ReferencePath Include="$(PackagesDir)runtime.win7-x64.Microsoft.NETCore.Runtime.CoreCLR\1.2.0-$(CoreClrExpectedPrerelease)\runtimes\win7-x64\lib\netstandard1.0\mscorlib.dll"/>
<ReferencePath Include="$(PackagesDir)runtime.win7-x64.Microsoft.NETCore.Runtime.CoreCLR\1.2.0-$(CoreClrExpectedPrerelease)\runtimes\win7-x64\lib\netstandard1.0\System.Private.CoreLib.dll"/>
</ItemGroup>
</Target>
<!-- OverrideLicenseUrl is temporary till we update the buildtools to v2 -->
<Target Name="OverrideLicenseUrl" BeforeTargets="GenerateNuSpec">
<PropertyGroup>
<LicenseUrl>https://github.com/dotnet/wcf/blob/master/LICENSE.TXT</LicenseUrl>
</PropertyGroup>
</Target>
<!-- This import is needed because we're still using project.json to restore packages.
Once we switch to MSBuild it will automatically handle target imports from the packages themselves. -->
<Import Condition="'$(TargetGroup)'=='netstandard2.0' and Exists('$(PackagesDir)NETStandard.Library\2.0.0-$(StandardExpectedPrerelease)\build\netstandard2.0\NETStandard.Library.targets')"
Project="$(PackagesDir)NETStandard.Library\2.0.0-$(StandardExpectedPrerelease)\build\netstandard2.0\NETStandard.Library.targets" />
</Project>