1 <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <PropertyGroup Condition="'$(TargetFrameworkVersion)' != '' and '$(TargetFrameworkProfile)' != ''">
4 <TargetingPortable>true</TargetingPortable>
7 <!-- Setup the default target for projects not already explicitly targeting portable -->
8 <PropertyGroup Condition="'$(TargetingPortable)' != 'true'">
9 <!-- Setting a default portable profile, although nothing should resolve from there as we BuildProjectDir to use the pacakge refs -->
10 <TargetPlatformIdentifier>Portable</TargetPlatformIdentifier>
11 <TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
12 <TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.5</TargetFrameworkVersion>
13 <TargetFrameworkProfile Condition="'$(TargetFrameworkProfile)' == ''">Profile7</TargetFrameworkProfile>
14 <TargetFrameworkMonikerDisplayName>.NET Portable Subset</TargetFrameworkMonikerDisplayName>
15 <ImplicitlyExpandTargetFramework Condition="'$(ImplicitlyExpandTargetFramework)' == ''">false</ImplicitlyExpandTargetFramework>
21 </AssemblySearchPaths>
22 <!-- For our projects we don't BuildProjectDir to resolve from the usual paths for now only hint paths and output directory
23 {CandidateAssemblyFiles};
25 {TargetFrameworkDirectory};
26 {Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)};
30 <!-- Need to add references to the mscorlib design-time facade for some old-style portable dependencies like xunit -->
31 <Target Name="AddDesignTimeFacadeReferences"
32 Condition="'$(TargetingPortable)' != 'true'"
33 BeforeTargets="ResolveReferences"
34 DependsOnTargets="GetReferenceAssemblyPaths"
37 <PossibleTargetFrameworks Include="$(_TargetFrameworkDirectories)" />
38 <ReferencePath Condition="'$(LinkLocalMscorlib)' != 'true'" Include="%(PossibleTargetFrameworks.Identity)mscorlib.dll" />
39 <ReferencePath Condition="'$(LinkLocalMscorlib)' == 'true'" Include="$(ProjectDir)\..\bin\Product\$(BuildOS).$(BuildArch).$(BuildType)\mscorlib.dll" />
43 <!-- Project language -->
44 <PropertyGroup Condition="'$(ProjectLanguage)' == ''">
45 <ProjectLanguage Condition="'$(MSBuildProjectExtension)' == '.ilproj' OR '$(Language)' == 'IL'">IL</ProjectLanguage>
46 <ProjectLanguage Condition="'$(MSBuildProjectExtension)' == '.csproj' OR '$(Language)' == 'C#' OR '$(ProjectLanguage)'==''">CSharp</ProjectLanguage>
49 <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" Condition="'$(ProjectLanguage)' == 'CSharp'" />
51 <!-- TODO (#1122): import this from the ToolsDir once it becomes available -->
52 <Import Project="$(ProjectDir)src\IL.targets" Condition="'$(ProjectLanguage)' == 'IL'" />
54 <Import Project="$(ToolsDir)packageresolve.targets" Condition="Exists('$(ToolsDir)packageresolve.targets')" />
56 <Import Project="$(ToolsDir)sign.targets" Condition="Exists('$(ToolsDir)sign.targets')" />
59 <GenerateRunScript Condition="'$(OutputType.ToUpper())' != 'EXE' And '$(GenerateRunScript)' == ''">false</GenerateRunScript>
62 <Import Project="CLRTest.Execute.targets" />
63 <Target Name="CreateExecuteScript"
65 Condition="'$(GenerateRunScript)' != 'false'"
66 DependsOnTargets="GenerateExecutionScriptsInternal" />
69 <OutDir>$(BaseOutputPathWithConfig)$(BuildProjectRelativeDir)\</OutDir>
72 <Target Name="CopyNativeProjectBinaries">
74 <NativeProjectBinaries Include="$(NativeProjectOutputFolder)\**\*.*" />
77 <Error Text="The native project files are missing in $(NativeProjectOutputFolder) please run build from the root of the repo at least once"
78 Condition="'@(NativeProjectBinaries)' == ''" />
81 SourceFiles="@(NativeProjectBinaries)"
82 DestinationFiles="@(NativeProjectBinaries -> '$(OutDir)%(RecursiveDir)%(Filename)%(Extension)')"
83 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
84 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
85 Retries="$(CopyRetryCount)"
86 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
87 UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
88 <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
92 <Target Name="ResolveCmakeNativeProjectReference"
93 Condition="'@(ProjectReference)' != ''"
94 BeforeTargets="BeforeResolveReferences;BeforeClean" >
96 <NativeProjectReference Include="%(ProjectReference.Identity)" Condition="$([System.String]::Copy(%(ProjectReference.FileName)).ToUpper()) == 'CMAKELISTS'" />
97 <ProjectReference Remove="%(NativeProjectReference.Identity)" />
98 <NativeProjectReferenceNormalized Include="@(NativeProjectReference -> '%(FullPath)')" />
102 <Target Name="ConsolidateNativeProjectReference"
103 Condition="'@(ProjectReference)' != ''"
104 BeforeTargets="Build" >
106 <NativeProjectOutputFoldersToCopy Include="$([System.String]::Copy('%(NativeProjectReferenceNormalized.RelativeDir)').Replace($(SourceDir),$(__NativeTestIntermediatesDir)\src\))$(Configuration)\"/>
109 <Message Text= "Project files are :$([System.String]::Copy(%(ProjectReference.FileName)).ToUpper()) " />
110 <Message Text= "Project references are :%(ProjectReference.Identity)" />
111 <Message Text= "Native project references are :%(NativeProjectReference.Identity)" />
112 <Message Text= "Full native project references are :%(NativeProjectReferenceNormalized.Identity)" />
113 <Message Text= "Native binaries will be copied from :%(NativeProjectOutputFoldersToCopy.Identity)" />
114 <MSBuild Projects="$(MSBuildProjectFile)" Targets="CopyNativeProjectBinaries" Properties="NativeProjectOutputFolder=%(NativeProjectOutputFoldersToCopy.Identity)" Condition="'@(NativeProjectReference)' != ''" />