Skip to content

Commit

Permalink
fix for target that is only in .4xx
Browse files Browse the repository at this point in the history
  • Loading branch information
Oren Novotny committed Jul 16, 2018
1 parent 42c5312 commit 045f19b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
14 changes: 14 additions & 0 deletions Source/MSBuild.Sdk.Extras/Build/Core.targets
Expand Up @@ -22,4 +22,18 @@
<Import Project="$(MSBuildThisFileDirectory)..\DefaultItems\DefaultItems.targets"/>
<Import Project="$(MSBuildThisFileDirectory)..\ProjectSystem\ProjectSystem.targets"/>

<!--
Detect the SDK version. For now, we have to check the NETCoreSdkVersion
else check BundledNETCoreAppTargetFrameworkVersion property for Sdk <= 2.1.300
else Give 1.0 version since that property doesn't exist in 1.x Sdks
-->
<PropertyGroup>
<_NETCoreSdkVersion>$(NETCoreSdkVersion)</_NETCoreSdkVersion>
<!-- Handle SemVer version like 2.1.300-preview, since MSBuild doesn't compare versions with alpha-numeric chars! -->
<_NETCoreSdkVersion Condition="$(_NETCoreSdkVersion.Contains('-'))">$(_NETCoreSdkVersion.Split('-')[0])</_NETCoreSdkVersion>
<_NETCoreSdkVersion Condition="'$(_NETCoreSdkVersion)' == ''">$(BundledNETCoreAppTargetFrameworkVersion)</_NETCoreSdkVersion>
<_NETCoreSdkVersion Condition="'$(_NETCoreSdkVersion)' == ''">1.0</_NETCoreSdkVersion>
</PropertyGroup>


</Project>
6 changes: 5 additions & 1 deletion Source/MSBuild.Sdk.Extras/Build/RIDs.targets
Expand Up @@ -139,8 +139,12 @@
ItemName="_FrameworkAssemblyReferences" />
</MSBuild>

<PropertyGroup>
<_SdkMinVersionWithDependencyTarget>2.1.400</_SdkMinVersionWithDependencyTarget>
</PropertyGroup>

<MSBuild
Projects="$(MSBuildProjectFullPath)"
Projects="$(MSBuildProjectFullPath)" Condition="'$([System.Version]::Parse($(_NETCoreSdkVersion)))' >= '$([System.Version]::Parse($(_SdkMinVersionWithDependencyTarget)))' "
Targets="_GetFrameworksWithSuppressedDependencies"
Properties="TargetFramework=%(_TargetFrameworks.Identity);
BuildProjectReferences=false;">
Expand Down
12 changes: 0 additions & 12 deletions Source/MSBuild.Sdk.Extras/Build/Workarounds.targets
Expand Up @@ -94,18 +94,6 @@
</ItemGroup>
</Target>

<!--
Detect the SDK version. For now, we have to check the NETCoreSdkVersion
else check BundledNETCoreAppTargetFrameworkVersion property for Sdk <= 2.1.300
else Give 1.0 version since that property doesn't exist in 1.x Sdks
-->
<PropertyGroup>
<_NETCoreSdkVersion>$(NETCoreSdkVersion)</_NETCoreSdkVersion>
<!-- Handle SemVer version like 2.1.300-preview, since MSBuild doesn't compare versions with alpha-numeric chars! -->
<_NETCoreSdkVersion Condition="$(_NETCoreSdkVersion.Contains('-'))">$(_NETCoreSdkVersion.Split('-')[0])</_NETCoreSdkVersion>
<_NETCoreSdkVersion Condition="'$(_NETCoreSdkVersion)' == ''">$(BundledNETCoreAppTargetFrameworkVersion)</_NETCoreSdkVersion>
<_NETCoreSdkVersion Condition="'$(_NETCoreSdkVersion)' == ''">1.0</_NETCoreSdkVersion>
</PropertyGroup>

<!--
Workaround for bug in Microsoft.NET.Sdk < v2.0 where satellites were deployed on top of each other in root.
Expand Down

0 comments on commit 045f19b

Please sign in to comment.