Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
106 lines (89 sloc) 5.66 KB
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2014 Clarius Consulting SA
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == '' And '$(MSBuildToolsVersion)' &gt;= '12.0'">$(MSBuildToolsVersion)</VisualStudioVersion>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == '' And '$(MSBuildToolsVersion)' &lt; '12.0'">11.0</VisualStudioVersion>
<!-- Define $(Dev) to compare with the simple VS numeric version i.e. '15' directly in MSBuild -->
<Dev Condition="'$(Dev)' == '' Or '$(Dev)' == '.'">$(VisualStudioVersion.Substring(0, $(VisualStudioVersion.IndexOf('.'))))</Dev>
<DefineConstants>$(DefineConstants);DEV$(Dev)</DefineConstants>
<DefineConstants>$(DefineConstants);VS$(VisualStudioVersion.Replace('.', ''))</DefineConstants>
<IsAppLocalIde Condition="'$(VsInstallRoot)' != '' And '$(VisualStudioVersion)' &gt;= '15.0'">true</IsAppLocalIde>
</PropertyGroup>
<!-- This is the property that causes VS 2012+ to insist on one-way update of the project -->
<PropertyGroup Condition="'$(VisualStudioVersion)' &gt;= '11.0'">
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
</PropertyGroup>
<!-- This is an additional property added by VS 2013 -->
<PropertyGroup Condition="'$(VisualStudioVersion)' &gt;= '12.0'">
<OldToolsVersion>4.0</OldToolsVersion>
</PropertyGroup>
<!-- On build servers and command line, this property is not available, so we redefine it in
terms of the environment variables created by VS when installed -->
<PropertyGroup Condition="'$(DevEnvDir)' == ''">
<VSCommToolsVar>VS$(VisualStudioVersion.Replace('.', ''))COMNTOOLS</VSCommToolsVar>
<DevEnvDir Condition="'$(IsAppLocalIde)' != 'true'">$([System.Environment]::ExpandEnvironmentVariables('%$(VSCommToolsVar)%'))..\IDE\</DevEnvDir>
<DevEnvDir Condition="'$(IsAppLocalIde)' == 'true'">$([System.IO.Path]::Combine('$(VsInstallRoot.TrimEnd('\'))', 'Common7', 'IDE'))\</DevEnvDir>
<DevEnvDir>$([System.IO.Path]::GetFullPath('$(DevEnvDir)'))</DevEnvDir>
</PropertyGroup>
<!-- VSSDK directories setup -->
<PropertyGroup Condition="'$(VSSDK)' == ''">
<VSSDKVar>VSSDK$(VisualStudioVersion.Replace('.', ''))Install</VSSDKVar>
<VSSDK Condition="'$(IsAppLocalIde)' != 'true'">$([System.Environment]::ExpandEnvironmentVariables('%$(VSSDKVar)%'))</VSSDK>
<VSSDK Condition="'$(IsAppLocalIde)' == 'true'">$([System.IO.Path]::Combine('$(VsInstallRoot.TrimEnd('\'))', 'VSSDK'))\</VSSDK>
</PropertyGroup>
<PropertyGroup>
<VSSDK20>$(VSSDK)VisualStudioIntegration\Common\Assemblies\v2.0\</VSSDK20>
<VSSDK40>$(VSSDK)VisualStudioIntegration\Common\Assemblies\v4.0\</VSSDK40>
</PropertyGroup>
<PropertyGroup>
<PublicAssemblies>$([System.IO.Path]::Combine('$(DevEnvDir.TrimEnd('\'))', 'PublicAssemblies'))\</PublicAssemblies>
<PrivateAssemblies>$([System.IO.Path]::Combine('$(DevEnvDir.TrimEnd('\'))', 'PrivateAssemblies'))\</PrivateAssemblies>
</PropertyGroup>
<!-- Set startup process to always start with the experimental instance and logging enabled -->
<PropertyGroup>
<StartAction>Program</StartAction>
<StartProgram>$(DevEnvDir)devenv.exe</StartProgram>
<StartArguments>/rootSuffix Exp</StartArguments>
</PropertyGroup>
<PropertyGroup>
<!-- Set a sensible default for whether this target will override the VSSDK location or not.
The heuristic is as follows: the VSSDK nuget package (not the VS installation-imported
one), provides a non-empty $(VSToolsPath) property,
We use the presence of that property as a hint that we should not override the VSSDK
props, since the user has opted in for an explicit version of the VSSDK himself.
NOTE: in order for this heuristic to work, the VSSDK has to be installed BEFORE installing
Clarius.VisualStudio nuget package, so that its .props come before this one.
If, on the other hand, no such property is found, it means the user wants the automatic
switching of VSSDK paths according to the determined VisualStudioVersion value, so that
building for multiple VS versions can automatically switch to the right assembly refs
and targets.
-->
<OverrideVsSDK Condition="'$(VSToolsPath)' != ''">false</OverrideVsSDK>
</PropertyGroup>
<PropertyGroup Condition="'$(OverrideVsSDK)' != 'false'">
<!-- Reset properties from the VSSDK targets -->
<VSToolsPath Condition="'$(IsAppLocalIde)' != 'true'">$(ProgramFiles)\MSBuild\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<VSToolsPath Condition="'$(IsAppLocalIde)' == 'true'">$(VsInstallRoot)\MSBuild\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<VsSDKVersion>$(VisualStudioVersion)</VsSDKVersion>
<VSSDKTargetPlatformVersion>$(VisualStudioVersion)</VSSDKTargetPlatformVersion>
<VSSDKTargetsPath>$(VSToolsPath)\VSSDK</VSSDKTargetsPath>
<VsSDKInstall>$(VSSDK)VisualStudioIntegration</VsSDKInstall>
<VsSDKIncludes>$(VsSDKInstall)\Common\inc</VsSDKIncludes>
<VsSDKToolsPath>$(VsSDKInstall)\Tools\bin</VsSDKToolsPath>
</PropertyGroup>
<PropertyGroup>
<ClariusVisualStudioPropsImported>true</ClariusVisualStudioPropsImported>
</PropertyGroup>
</Project>