-
Notifications
You must be signed in to change notification settings - Fork 594
feat: use floating NuGet version 2.* for Microsoft.Build.Sql and resolve at runtime #22405
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
Changes from 5 commits
ba10162
83974d4
e2b67ec
2eb0450
3c080a4
4a1edaa
d06e348
d6470fc
20881d3
e06387f
5579b8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,21 @@ import { ISqlProject, SqlTargetPlatform } from "sqldbproj"; | |
| import { SystemDatabase } from "./typeHelper"; | ||
| import { DeploymentScenario } from "./enums"; | ||
|
|
||
| /** | ||
| * Returns true if the version string is a valid semver or a NuGet floating version ("2.*" or "2.1.*"). | ||
| */ | ||
|
ssreerama marked this conversation as resolved.
ssreerama marked this conversation as resolved.
|
||
| export function isValidMicrosoftBuildSqlVersion(version: string): boolean { | ||
| // Accept "N.*" or "N.M.*" floating versions only. | ||
| if (!version.endsWith(".*")) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't love doing this logic manually. Can I think it could just do:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thankyou, will do this in a follow up PR :) |
||
| return false; | ||
| } | ||
| const parts = version.slice(0, -2).split("."); // strip ".*", split remainder | ||
| if (parts.length < 1 || parts.length > 2) { | ||
| return false; | ||
| } | ||
| return parts.every((p) => p.length > 0 && String(parseInt(p, 10)) === p); | ||
| } | ||
|
ssreerama marked this conversation as resolved.
|
||
|
|
||
| /** | ||
| * Consolidates on the error message string | ||
| */ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.