Merge pull request #858 from tritao/nuget-unix-paths

Fix Nuget package handling to support Unix-style paths
This commit is contained in:
Tom van Dijck 2017-08-02 11:00:46 -07:00 committed by GitHub
commit 32a130b503
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)