-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing intellisense in vscode for src and ref projects (#34025)
* fixing intel for ref and src * fixing ref and src intell * renaming props file * remove extra property * fixing the intellisense in tests * add extra line * addressing feedback * revert shim path * fix allconfig restore * adding comment
- Loading branch information
Showing
4 changed files
with
167 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<Project> | ||
<!-- We are reseting the target framework, so we need to reset the properties derived by the sdk | ||
eg TargetFrameworkIdentifier, TargetFrameworkVersion. In order to do that we are copying the sdk | ||
parsing code https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets#L47 | ||
--> | ||
<PropertyGroup> | ||
<_UnsupportedTargetFrameworkError></_UnsupportedTargetFrameworkError> | ||
<TargetFrameworkIdentifier></TargetFrameworkIdentifier> | ||
<TargetFrameworkVersion></TargetFrameworkVersion> | ||
<TargetFrameworkMoniker></TargetFrameworkMoniker> | ||
<NuGetTargetMoniker></NuGetTargetMoniker> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="$(TargetFramework.Contains('-'))"> | ||
<_OriginalTargetFramework>$(TargetFramework)</_OriginalTargetFramework> | ||
<TargetFrameworkSuffix>$(TargetFramework.SubString($([MSBuild]::Add($(TargetFramework.IndexOf('-')), 1))))</TargetFrameworkSuffix> | ||
<TargetFramework>$(TargetFramework.SubString(0, $(TargetFramework.IndexOf('-'))))</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<!-- Split $(TargetFramework) (e.g. net45) into short identifier and short version (e.g. 'net' and '45'). --> | ||
<PropertyGroup Condition="'$(TargetFramework)' != '' and !$(TargetFramework.Contains(',')) and !$(TargetFramework.Contains('+'))"> | ||
<_ShortFrameworkIdentifier>$(TargetFramework.TrimEnd('.0123456789'))</_ShortFrameworkIdentifier> | ||
<_ShortFrameworkVersion>$(TargetFramework.Substring($(_ShortFrameworkIdentifier.Length)))</_ShortFrameworkVersion> | ||
</PropertyGroup> | ||
|
||
<!-- Versions with dots are taken as is and just given leading 'v'. --> | ||
<PropertyGroup Condition="'$(TargetFrameworkVersion)' == '' and '$(_ShortFrameworkVersion)' != '' and $(_ShortFrameworkVersion.Contains('.'))"> | ||
<TargetFrameworkVersion>v$(_ShortFrameworkVersion)</TargetFrameworkVersion> | ||
</PropertyGroup> | ||
|
||
<!-- Versions with no dots and up to 3 characters get leading 'v' and implicit dots between characters. --> | ||
<PropertyGroup Condition="'$(TargetFrameworkVersion)' == '' and '$(_ShortFrameworkVersion)' != ''"> | ||
<TargetFrameworkVersion Condition="$(_ShortFrameworkVersion.Length) == 1">v$(_ShortFrameworkVersion[0]).0</TargetFrameworkVersion> | ||
<TargetFrameworkVersion Condition="$(_ShortFrameworkVersion.Length) == 2">v$(_ShortFrameworkVersion[0]).$(_ShortFrameworkVersion[1])</TargetFrameworkVersion> | ||
<TargetFrameworkVersion Condition="$(_ShortFrameworkVersion.Length) == 3">v$(_ShortFrameworkVersion[0]).$(_ShortFrameworkVersion[1]).$(_ShortFrameworkVersion[2])</TargetFrameworkVersion> | ||
</PropertyGroup> | ||
|
||
<!-- Map short name to long name. See earlier comment for example of how to work with identifiers that are not recognized here. --> | ||
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == ''"> | ||
<TargetFrameworkIdentifier Condition="'$(_ShortFrameworkIdentifier)' == 'netstandard'">.NETStandard</TargetFrameworkIdentifier> | ||
<TargetFrameworkIdentifier Condition="'$(_ShortFrameworkIdentifier)' == 'netcoreapp'">.NETCoreApp</TargetFrameworkIdentifier> | ||
|
||
<!-- The meaning of "net" as a short framework name depends on the version. If it's 4.x or less, it means .NETFramework. | ||
If the version is 5.0 or higher, then "net" means .NET 5.0 and on, which is the evolution of .NET Core, and uses | ||
the .NETCoreApp TargetFrameworkIdentifier. --> | ||
<TargetFrameworkIdentifier Condition="'$(_ShortFrameworkIdentifier)' == 'net' And | ||
$([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '5.0'))">.NETFramework</TargetFrameworkIdentifier> | ||
<TargetFrameworkIdentifier Condition="'$(_ShortFrameworkIdentifier)' == 'net' And | ||
$([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '5.0'))">.NETCoreApp</TargetFrameworkIdentifier> | ||
</PropertyGroup> | ||
|
||
<!-- | ||
Trigger an error if we're unable to infer the framework identifier and version. | ||
We have to evaluate this here and not in the target because by the time the target runs, | ||
Microsoft.Common.targets will have defaulted to .NETFramework,Version=v4.0 | ||
--> | ||
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '' or '$(TargetFrameworkVersion)' == ''"> | ||
<_UnsupportedTargetFrameworkError>true</_UnsupportedTargetFrameworkError> | ||
</PropertyGroup> | ||
|
||
<Import Project="$(MSBuildThisDirectory)targetframework.props" /> | ||
|
||
<PropertyGroup> | ||
<GeneratedAssemblyInfoFile>$(IntermediateOutputPath)$(MSBuildProjectName).AssemblyInfo$(DefaultLanguageSourceExtension)</GeneratedAssemblyInfoFile> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' != '' and '$(TargetFrameworkVersion)' != ''"> | ||
<TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == '' and '$([System.String]::IsNullOrWhitespace($(TargetFrameworkProfile)))' != 'true'">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion),Profile=$(TargetFrameworkProfile)</TargetFrameworkMoniker> | ||
<TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)</TargetFrameworkMoniker> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<!-- Note that the assets.cache file has contents that are unique to the current TFM and configuration and therefore cannot | ||
be stored in a shared directory next to the assets.json file --> | ||
<ProjectAssetsCacheFile Condition="'$(ProjectAssetsCacheFile)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).assets.cache</ProjectAssetsCacheFile> | ||
<ProjectAssetsCacheFile>$([MSBuild]::NormalizePath($(MSBuildProjectDirectory), $(ProjectAssetsCacheFile)))</ProjectAssetsCacheFile> | ||
<NuGetTargetMoniker>$(TargetFrameworkMoniker)</NuGetTargetMoniker> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<Project> | ||
<Choose> | ||
<When Condition="'$(TargetFrameworkSuffix)' == 'Windows_NT'"> | ||
<PropertyGroup> | ||
<TargetsWindows>true</TargetsWindows> | ||
<PackageTargetRuntime>win</PackageTargetRuntime> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="'$(TargetFrameworkSuffix)' == 'Unix'"> | ||
<PropertyGroup> | ||
<TargetsUnix>true</TargetsUnix> | ||
<PackageTargetRuntime>unix</PackageTargetRuntime> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="'$(TargetFrameworkSuffix)' == 'Linux'"> | ||
<PropertyGroup> | ||
<TargetsUnix>true</TargetsUnix> | ||
<TargetsLinux>true</TargetsLinux> | ||
<PackageTargetRuntime>linux</PackageTargetRuntime> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="'$(TargetFrameworkSuffix)' == 'Android'"> | ||
<PropertyGroup> | ||
<TargetsUnix>true</TargetsUnix> | ||
<TargetsLinux>true</TargetsLinux> | ||
<TargetsAndroid>true</TargetsAndroid> | ||
<PackageTargetRuntime>android</PackageTargetRuntime> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="'$(TargetFrameworkSuffix)' == 'OSX'"> | ||
<PropertyGroup> | ||
<TargetsUnix>true</TargetsUnix> | ||
<TargetsOSX>true</TargetsOSX> | ||
<PackageTargetRuntime>osx</PackageTargetRuntime> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="'$(TargetFrameworkSuffix)' == 'iOS'"> | ||
<PropertyGroup> | ||
<TargetsUnix>true</TargetsUnix> | ||
<TargetsiOS>true</TargetsiOS> | ||
<PackageTargetRuntime>ios</PackageTargetRuntime> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="'$(TargetFrameworkSuffix)' == 'FreeBSD'"> | ||
<PropertyGroup> | ||
<TargetsUnix>true</TargetsUnix> | ||
<TargetsFreeBSD>true</TargetsFreeBSD> | ||
<PackageTargetRuntime>freebsd</PackageTargetRuntime> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="'$(TargetFrameworkSuffix)' == 'NetBSD'"> | ||
<PropertyGroup> | ||
<TargetsUnix>true</TargetsUnix> | ||
<TargetsNetBSD>true</TargetsNetBSD> | ||
<PackageTargetRuntime>netbsd</PackageTargetRuntime> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="'$(TargetFrameworkSuffix)' == 'WebAssembly'"> | ||
<PropertyGroup> | ||
<TargetsLinux>true</TargetsLinux> | ||
<TargetsWebAssembly>true</TargetsWebAssembly> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="'$(TargetFrameworkSuffix)' == ''"> | ||
<PropertyGroup> | ||
<TargetsAnyOS>true</TargetsAnyOS> | ||
</PropertyGroup> | ||
</When> | ||
</Choose> | ||
|
||
<PropertyGroup> | ||
<TargetsNetCoreApp Condition="$(TargetFramework.StartsWith('netcoreapp'))">true</TargetsNetCoreApp> | ||
<TargetsNetStandard Condition="$(TargetFramework.StartsWith('netstandard'))">true</TargetsNetStandard> | ||
<TargetsNetFx Condition="$(TargetFramework.StartsWith('net4'))">true</TargetsNetFx> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<RefRootPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'ref'))</RefRootPath> | ||
<RefPath>$([MSBuild]::NormalizeDirectory('$(RefRootPath)', '$(TargetFramework)'))</RefPath> | ||
<BaseIntermediateOutputPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsObjDir)', '$(MSBuildProjectName)'))</BaseIntermediateOutputPath> | ||
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(TargetFramework)-$(TargetFrameworkSuffix)-$(Configuration)\</IntermediateOutputPath> | ||
<IntermediateOutputPath Condition="'$(TargetFrameworkSuffix)' == ''">$(BaseIntermediateOutputPath)$(TargetFramework)-$(Configuration)\</IntermediateOutputPath> | ||
</PropertyGroup> | ||
|
||
</Project> |