Fix Nuget package file path regex matching to support Unix-style path separators.

This commit is contained in:
Joao Matos 2017-08-01 20:08:28 +01:00
parent 74819eb945
commit 2ba09656f8
3 changed files with 41 additions and 1 deletions

View File

@ -12,6 +12,7 @@ return {
"cs2005/test_nuget_config.lua",
"cs2005/test_nuget_framework_folders.lua",
"cs2005/test_nuget_packages_config.lua",
"cs2005/test_nuget_references.lua",
"cs2005/test_output_props.lua",
"cs2005/projectelement.lua",
"cs2005/test_platform_groups.lua",

View File

@ -0,0 +1,39 @@
--
-- tests/actions/vstudio/cs2005/test_nuget_references.lua
-- Validate generation of NuGet package references files for Visual Studio 2010 and newer
-- Copyright (c) 2017 Jason Perkins and the Premake project
--
local p = premake
local suite = test.declare("vstudio_cs2005_nuget_references")
local cs2005 = p.vstudio.cs2005
local nuget2010 = p.vstudio.nuget2010
--
-- Setup and teardown
--
local wks, prj
function suite.setup()
_OPTIONS.os = "macosx"
p.action.set("vs2010")
wks = test.createWorkspace()
language "C#"
end
local function prepare(platform)
prj = test.getproject(wks, 1)
cs2005.nuGetReferences(prj)
end
--
-- Check that we process Unix-style paths correctly.
--
function suite.unixPaths()
dotnetframework "4.6"
nuget "Mono.Cecil:0.9.6.4"
prepare()
end

View File

@ -425,7 +425,7 @@
local bestVersion, bestFolder
for _, file in ipairs(packageAPIInfo.packageEntries) do
local folder = file:match("^lib\\(.+)\\")
local folder = file:match("^lib[\\/](.+)[\\/]")
if folder and path.hasextension(file, ".dll") then
local version = cs2005.frameworkVersionForFolder(folder)