Merge pull request #1356 from starkos/xcodebuildresources-patterns

Allow wildcards in xcodebuildresources
This commit is contained in:
Samuel Surtees 2019-10-21 22:19:14 +10:00 committed by GitHub
commit c4e2dca65f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 10 deletions

View File

@ -98,6 +98,25 @@
end end
---
-- Verify that files listed in xcodebuildresources are marked as resources
---
function suite.PBXBuildFile_ListsXcodeBuildResources()
files { "file1.txt", "file01.png", "file02.png", "file-3.png" }
xcodebuildresources { "file1.txt", "**.png" }
prepare()
xcode.PBXBuildFile(tr)
test.capture [[
/* Begin PBXBuildFile section */
628F3826BDD08B98912AD666 /* file-3.png in Resources */ = {isa = PBXBuildFile; fileRef = 992385EEB0362120A0521C2E /* file-3.png */; };
93485EDEC2DA2DD09DE76D1E /* file1.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9F78562642667CD8D18C5C66 /* file1.txt */; };
C87AFEAA23BC521CF7169CEA /* file02.png in Resources */ = {isa = PBXBuildFile; fileRef = D54D8E32EC602964DC7C2472 /* file02.png */; };
EE9FC5C849E1193A1D3B6408 /* file01.png in Resources */ = {isa = PBXBuildFile; fileRef = 989B7E70AFAE19A29FCA14B0 /* file01.png */; };
/* End PBXBuildFile section */
]]
end
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-- PBXFileReference tests -- PBXFileReference tests
--------------------------------------------------------------------------- ---------------------------------------------------------------------------

View File

@ -48,8 +48,7 @@
end end
function xcode.isItemResource(project, node) function xcode.isItemResource(project, node)
local res
local res;
if project and project.xcodebuildresources then if project and project.xcodebuildresources then
if type(project.xcodebuildresources) == "table" then if type(project.xcodebuildresources) == "table" then
@ -59,20 +58,15 @@
local function checkItemInList(item, list) local function checkItemInList(item, list)
if item then if item then
if list then for _,v in pairs(list) do
if type(list) == "table" then if string.find(item, path.wildcards(v)) then
for _,v in pairs(list) do return true
if string.find(item, v) then
return true
end
end
end end
end end
end end
return false return false
end end
--print (node.path, node.buildid, node.cfg, res)
if (checkItemInList(node.path, res)) then if (checkItemInList(node.path, res)) then
return true return true
end end