-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a build error if building on an unsupported SDK #135
Conversation
@@ -1,4 +1,18 @@ | |||
<Project> | |||
<Target Name="_ContainerVerifySDKVersion" | |||
Condition="'$(WebPublishMethod)' == 'Container' or '$(PublishProfile)' == 'DefaultContainer'" | |||
BeforeTargets="AfterPublish"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can't rely on the Container target hookups having been executed in a build, so we need to establish some reasonable point at which to do this check. AfterPublish seemed good.
can't rely only on the WebPublishMethod. --> | ||
<PropertyGroup> | ||
<!-- Allow preview 7, any RC, or any stable version of 7 --> | ||
<_IsAllowedVersion Condition="$(NETCoreSdkVersion.StartsWith('7.0.100-preview.7')) or $(NETCoreSdkVersion.StartsWith('7.0.100-rc')) or ($(NETCoreSdkVersion.StartsWith('7.0.10')) and $(NETCoreSdkVersion.Contains('-')) == false)">true</_IsAllowedVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MSBuild functions for semver compares when?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I explicitly scoped it out dotnet/msbuild#3212 (comment)! Land me dotnet/runtime#19317 and I will plumb it through immediately.
can't rely only on the WebPublishMethod. --> | ||
<PropertyGroup> | ||
<!-- Allow preview 7, any RC, or any stable version of 7 --> | ||
<_IsAllowedVersion Condition="$(NETCoreSdkVersion.StartsWith('7.0.100-preview.7')) or $(NETCoreSdkVersion.StartsWith('7.0.100-rc')) or ($(NETCoreSdkVersion.StartsWith('7.0.10')) and $(NETCoreSdkVersion.Contains('-')) == false)">true</_IsAllowedVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I explicitly scoped it out dotnet/msbuild#3212 (comment)! Land me dotnet/runtime#19317 and I will plumb it through immediately.
If a user explicitly asks for containerization we should be able to tell them if it's not supported.
Strictly speaking this means that they need to be on 7.0.100-preview.7 or higher.
If they are using a custom publish profile, they will have set the WebPublishMethod explicitly, so we can check that to cover that case. If they are using the default publish profile, they will never actually load the nonexistent profile on unsupported SDK versions, so we should check for the explicit use of the default profile.