Validate NuGet package strings
This commit is contained in:
parent
8286a7b9b6
commit
87f527c1df
@ -62,6 +62,7 @@
|
||||
m.projectRulesExist,
|
||||
m.projectValuesInScope,
|
||||
m.NuGetHasHTTP,
|
||||
m.NuGetPackageStrings,
|
||||
}
|
||||
end
|
||||
|
||||
@ -231,6 +232,17 @@
|
||||
end
|
||||
|
||||
|
||||
function m.NuGetPackageStrings(prj)
|
||||
for _, package in ipairs(prj.nuget) do
|
||||
local components = package:explode(":")
|
||||
|
||||
if #components ~= 2 or #components[1] == 0 or #components[2] == 0 then
|
||||
p.error("NuGet package '%s' in project '%s' is invalid - please give packages in the format 'id:version', e.g. 'NUnit:3.6.1'", package, prj.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function m.uniqueProjectIds(wks)
|
||||
local uuids = {}
|
||||
for prj in p.workspace.eachproject(wks) do
|
||||
|
Loading…
Reference in New Issue
Block a user