From 61d7ad050fabd3cf4185c3ec060054d5b541310f Mon Sep 17 00:00:00 2001 From: Ben Ratzlaff Date: Wed, 4 May 2016 21:47:35 -0700 Subject: [PATCH 1/7] First iteration of creating xcode scheme files so that 'dependson' works for xcode projects --- _manifest.lua | 1 + _preload.lua | 1 + xcode.lua | 1 + xcode_common.lua | 8 ++- xcode_project.lua | 4 +- xcode_scheme.lua | 134 ++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 146 insertions(+), 3 deletions(-) create mode 100644 xcode_scheme.lua diff --git a/_manifest.lua b/_manifest.lua index 4c11a55..44d2931 100644 --- a/_manifest.lua +++ b/_manifest.lua @@ -4,4 +4,5 @@ return { "xcode4_workspace.lua", "xcode_common.lua", "xcode_project.lua", + "xcode_scheme.lua", } diff --git a/_preload.lua b/_preload.lua index 4c1cc1b..cbb971b 100644 --- a/_preload.lua +++ b/_preload.lua @@ -53,6 +53,7 @@ onProject = function(prj) p.generate(prj, ".xcodeproj/project.pbxproj", p.modules.xcode.generateProject) + p.generate(prj, ".xcodeproj/xcshareddata/xcschemes/" .. prj.name .. ".xcscheme", p.modules.xcode.generateScheme) end, } diff --git a/xcode.lua b/xcode.lua index a10454b..a21d252 100644 --- a/xcode.lua +++ b/xcode.lua @@ -15,5 +15,6 @@ include("xcode_common.lua") include("xcode4_workspace.lua") include("xcode_project.lua") + include("xcode_scheme.lua") return m diff --git a/xcode_common.lua b/xcode_common.lua index ff3b569..91de2d6 100644 --- a/xcode_common.lua +++ b/xcode_common.lua @@ -224,6 +224,10 @@ end end + function xcode.printSettingsTable(level, settings) + printSettingsTable(level, settings) + end + local function overrideSettings(settings, overrides) if type(overrides) == 'table' then for name, value in pairs(overrides) do @@ -368,7 +372,7 @@ local settings = {}; tree.traverse(tr, { onnode = function(node) - if node.buildid then + if node.buildid and (not node.not_a_link_dependency) then settings[node.buildid] = function(level) _p(level,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; };', node.buildid, node.name, xcode.getbuildcategory(node), node.id, node.name) @@ -529,7 +533,7 @@ -- write out project dependencies tree.traverse(tr.projects, { onleaf = function(node) - if node.buildid then + if node.buildid and not node.not_a_link_dependency then _p(4,'%s /* %s in Frameworks */,', node.buildid, node.name) end end diff --git a/xcode_project.lua b/xcode_project.lua index e17ca57..4341953 100644 --- a/xcode_project.lua +++ b/xcode_project.lua @@ -88,7 +88,7 @@ -- the special folder "Projects" lists sibling project dependencies tr.projects = tree.new("Projects") - for _, dep in ipairs(project.getdependencies(prj, "sibling", "object")) do + for _, dep in ipairs(project.getdependencies(prj)) do -- create a child node for the dependency's xcodeproj local xcpath = xcode.getxcodeprojname(dep) local xcnode = tree.insert(tr.projects, tree.new(path.getname(xcpath))) @@ -98,6 +98,7 @@ xcnode.productproxyid = xcode.newid(xcnode.name, "prodprox") xcnode.targetproxyid = xcode.newid(xcnode.name, "targprox") xcnode.targetdependid = xcode.newid(xcnode.name, "targdep") + xcnode.not_a_link_dependency = not table.contains(project.getdependencies(prj, "linkOnly"), dep) -- create a grandchild node for the dependency's link target local lprj = premake.workspace.findproject(prj.workspace, dep.name) @@ -105,6 +106,7 @@ node = tree.insert(xcnode, tree.new(cfg.linktarget.name)) node.path = cfg.linktarget.fullpath node.cfg = cfg + node.not_a_link_dependency = xcnode.not_a_link_dependency end if #tr.projects.children > 0 then diff --git a/xcode_scheme.lua b/xcode_scheme.lua new file mode 100644 index 0000000..4cf154b --- /dev/null +++ b/xcode_scheme.lua @@ -0,0 +1,134 @@ +--- +-- xcode/xcode4_scheme.lua +-- Generate a shared scheme for an Xcode C/C++ project. +-- Copyright (c) 2009-2016 Jason Perkins and the Premake project +--- + + local p = premake + local m = p.modules.xcode + + local project = p.project + local config = p.config + local fileconfig = p.fileconfig + local tree = p.tree + + m.scheme = {} + local scheme = m.scheme + + function scheme.Header(tr) + p.w('') + p.push('') + end + + function scheme.Footer(tr) + p.pop('') + end + + function scheme.buildablereference(tr) + for _, node in ipairs(tr.products.children) do + p.push('', tr.name) + p.pop('') + end + end + + function scheme.build(tr) + p.push('') + p.push('') + p.push('') + scheme.buildablereference(tr) + p.pop('') + p.pop('') + p.pop('') + end + + function scheme.test(tr) + p.push('') + p.push('') + p.pop('') + p.push('') + scheme.buildablereference(tr) + p.pop('') + p.pop('') + end + + function scheme.launch(tr) + p.push('') + p.push('') + scheme.buildablereference(tr) + p.pop('') + p.push('') + p.pop('') + p.pop('') + end + + function scheme.profile(tr) + p.push('') + p.push('') + scheme.buildablereference(tr) + p.pop('') + p.pop('') + end + + function scheme.analyze(tr) + p.push('') + p.pop('') + end + + function scheme.archive(tr) + p.push('') + p.pop('') + end + +-- +-- Generate the shared data scheme for an xcode project +-- +-- @param prj +-- The Premake project to generate. +-- + + function m.generateScheme(prj) + local tr = project.getsourcetree(prj) + scheme.Header(tr) + scheme.build(tr) + scheme.test(tr) + scheme.launch(tr) + scheme.profile(tr) + scheme.analyze(tr) + scheme.archive(tr) + scheme.Footer(tr) + end + From 6ce1ba547054d4a142d86861fbac4d655ea4e2f8 Mon Sep 17 00:00:00 2001 From: Ben Ratzlaff Date: Thu, 5 May 2016 22:00:27 -0700 Subject: [PATCH 2/7] Add tests for xcode_scheme.lua --- tests/_tests.lua | 1 + tests/test_xcode_scheme.lua | 228 ++++++++++++++++++++++++++++++++++++ 2 files changed, 229 insertions(+) create mode 100644 tests/test_xcode_scheme.lua diff --git a/tests/_tests.lua b/tests/_tests.lua index 3c9b714..eed4702 100644 --- a/tests/_tests.lua +++ b/tests/_tests.lua @@ -6,4 +6,5 @@ return { "test_xcode4_workspace.lua", "test_xcode_dependencies.lua", "test_xcode_project.lua", + "test_xcode_scheme.lua", } diff --git a/tests/test_xcode_scheme.lua b/tests/test_xcode_scheme.lua new file mode 100644 index 0000000..d077ac1 --- /dev/null +++ b/tests/test_xcode_scheme.lua @@ -0,0 +1,228 @@ +--- +-- tests/test_xcode_scheme.lua +-- Automated test suite for Xcode scheme generation. +-- Copyright (c) 2011-2016 Jason Perkins and the Premake project +--- + + + local suite = test.declare("xcode4_scheme") + local xcode = premake.modules.xcode + local scheme = xcode.scheme + +--------------------------------------------------------------------------- +-- Setup/Teardown +--------------------------------------------------------------------------- + + local wks, prj1, tr + + function suite.teardown() + wks = nil + prj1 = nil + tr = nil + end + + function suite.setup() + _ACTION = "xcode4" + xcode.used_ids = { } -- reset the list of generated IDs + + wks, prj1 = test.createWorkspace() +--[[ + links { "MyProject2" } + dependson { "MyProject3" } + + prj2 = test.createproject(wks) + kind "StaticLib" + configuration "Debug" + targetsuffix "-d" + configuration {} + + prj3 = test.createproject(wks) + kind "SharedLib" + links { "MyProject2" } + configuration "Debug" + targetsuffix "-d" + configuration {} +--]] + end + + local function prepare() + wks = premake.oven.bakeWorkspace(wks) + xcode.prepareWorkspace(wks) + local prj = premake.workspace.getproject(wks, 1) + tr = xcode.buildprjtree(prj) + end + +--------------------------------------------------------------------------- +-- Header +--------------------------------------------------------------------------- + + function suite.scheme_header() + prepare() + scheme.Header(tr) + test.capture [[ + + + ]] + end + +--------------------------------------------------------------------------- +-- Footer +--------------------------------------------------------------------------- + + function suite.scheme_footer() + prepare() + scheme.Footer(tr) + test.capture [[ + + ]] + end + +--------------------------------------------------------------------------- +-- Build +--------------------------------------------------------------------------- + + function suite.scheme_build() + prepare() + scheme.build(tr) + test.capture [[ + + + + + + + + + ]] + end + +--------------------------------------------------------------------------- +-- Test +--------------------------------------------------------------------------- + + function suite.scheme_test() + prepare() + scheme.test(tr) + test.capture [[ + + + + + + + + + ]] + end + +--------------------------------------------------------------------------- +-- Launch +--------------------------------------------------------------------------- + + function suite.scheme_launch() + prepare() + scheme.launch(tr) + test.capture [[ + + + + + + + + + ]] + end + +--------------------------------------------------------------------------- +-- Profile +--------------------------------------------------------------------------- + + function suite.scheme_profile() + prepare() + scheme.profile(tr) + test.capture [[ + + + + + + + ]] + end + +--------------------------------------------------------------------------- +-- Analyze +--------------------------------------------------------------------------- + + function suite.scheme_analyze() + prepare() + scheme.analyze(tr) + test.capture [[ + + + ]] + end + +--------------------------------------------------------------------------- +-- Archive +--------------------------------------------------------------------------- + + function suite.scheme_archive() + prepare() + scheme.archive(tr) + test.capture [[ + + + ]] + end + From 8c8ec4668ad8e2f82e19c22d0587376bf77fb80a Mon Sep 17 00:00:00 2001 From: Ben Ratzlaff Date: Thu, 5 May 2016 22:03:52 -0700 Subject: [PATCH 3/7] Should have been in last commit --- tests/test_xcode_scheme.lua | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/tests/test_xcode_scheme.lua b/tests/test_xcode_scheme.lua index d077ac1..57ff0b0 100644 --- a/tests/test_xcode_scheme.lua +++ b/tests/test_xcode_scheme.lua @@ -26,23 +26,6 @@ xcode.used_ids = { } -- reset the list of generated IDs wks, prj1 = test.createWorkspace() ---[[ - links { "MyProject2" } - dependson { "MyProject3" } - - prj2 = test.createproject(wks) - kind "StaticLib" - configuration "Debug" - targetsuffix "-d" - configuration {} - - prj3 = test.createproject(wks) - kind "SharedLib" - links { "MyProject2" } - configuration "Debug" - targetsuffix "-d" - configuration {} ---]] end local function prepare() From f821bb611eee61c54ad1f6ad0ed76836650075a2 Mon Sep 17 00:00:00 2001 From: Ben Ratzlaff Date: Thu, 5 May 2016 22:37:41 -0700 Subject: [PATCH 4/7] Update tests specifically for 'dependson' to specify non-linking dependencies --- tests/test_xcode_dependencies.lua | 64 ++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 6 deletions(-) diff --git a/tests/test_xcode_dependencies.lua b/tests/test_xcode_dependencies.lua index 6bb952d..722d2a4 100644 --- a/tests/test_xcode_dependencies.lua +++ b/tests/test_xcode_dependencies.lua @@ -12,12 +12,13 @@ -- Setup/Teardown --------------------------------------------------------------------------- - local wks, prj, prj2, tr + local wks, prj1, prj2, prj3, tr function suite.teardown() wks = nil - prj = nil + prj1 = nil prj2 = nil + prj3 = nil tr = nil end @@ -25,13 +26,22 @@ _ACTION = "xcode4" xcode.used_ids = { } -- reset the list of generated IDs - wks, prj = test.createWorkspace() + wks, prj1 = test.createWorkspace() links { "MyProject2" } + dependson { "MyProject3" } prj2 = test.createproject(wks) kind "StaticLib" configuration "Debug" targetsuffix "-d" + configuration {} + + prj3 = test.createproject(wks) + kind "SharedLib" + links { "MyProject2" } + configuration "Debug" + targetsuffix "-d" + configuration {} end local function prepare() @@ -58,7 +68,7 @@ end function suite.PBXBuildFile_ListsDependencyTargets_OnSharedLib() - kind "SharedLib" + prj2.kind="SharedLib" prepare() xcode.PBXBuildFile(tr) test.capture [[ @@ -92,6 +102,20 @@ remoteGlobalIDString = [libMyProject2-d.a:target]; remoteInfo = "libMyProject2-d.a"; }; + [MyProject3.xcodeproj:prodprox] /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = [MyProject3.xcodeproj] /* MyProject3.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = [libMyProject3-d.dylib:product]; + remoteInfo = "libMyProject3-d.dylib"; + }; + [MyProject3.xcodeproj:targprox] /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = [MyProject3.xcodeproj] /* MyProject3.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = [libMyProject3-d.dylib:target]; + remoteInfo = "libMyProject3-d.dylib"; + }; /* End PBXContainerItemProxy section */ ]] end @@ -107,6 +131,7 @@ test.capture [[ /* Begin PBXFileReference section */ [MyProject2.xcodeproj] /* libMyProject2-d.a */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MyProject2.xcodeproj"; path = MyProject2.xcodeproj; sourceTree = SOURCE_ROOT; }; + [MyProject3.xcodeproj] /* libMyProject3-d.dylib */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MyProject3.xcodeproj"; path = MyProject3.xcodeproj; sourceTree = SOURCE_ROOT; }; [MyProject:product] /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = MyProject; path = MyProject; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ ]] @@ -114,12 +139,13 @@ function suite.PBXFileReference_UsesRelativePaths() prj.location = "MyProject" - prj2.location = "MyProject2" + prj2.location = ".." prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [MyProject2.xcodeproj] /* libMyProject2-d.a */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MyProject2.xcodeproj"; path = ../MyProject2.xcodeproj; sourceTree = SOURCE_ROOT; }; + [MyProject3.xcodeproj] /* libMyProject3-d.dylib */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MyProject3.xcodeproj"; path = MyProject3.xcodeproj; sourceTree = SOURCE_ROOT; }; [MyProject:product] /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = MyProject; path = MyProject; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ ]] @@ -148,7 +174,7 @@ end function suite.PBXFrameworksBuildPhase_ListsDependencies_OnSharedLib() - kind "SharedLib" + prj2.kind="SharedLib" prepare() xcode.PBXFrameworksBuildPhase(tr) test.capture [[ @@ -182,6 +208,14 @@ name = Products; sourceTree = ""; }; + [MyProject3.xcodeproj:prodgrp] /* Products */ = { + isa = PBXGroup; + children = ( + [libMyProject3-d.dylib] /* libMyProject3-d.dylib */, + ); + name = Products; + sourceTree = ""; + }; [MyProject] /* MyProject */ = { isa = PBXGroup; children = ( @@ -203,6 +237,7 @@ isa = PBXGroup; children = ( [MyProject2.xcodeproj] /* MyProject2.xcodeproj */, + [MyProject3.xcodeproj] /* MyProject3.xcodeproj */, ); name = Projects; sourceTree = ""; @@ -233,6 +268,7 @@ ); dependencies = ( [MyProject2.xcodeproj:targdep] /* PBXTargetDependency */, + [MyProject3.xcodeproj:targdep] /* PBXTargetDependency */, ); name = MyProject; productInstallPath = "$(HOME)/bin"; @@ -266,6 +302,10 @@ ProductGroup = [MyProject2.xcodeproj:prodgrp] /* Products */; ProjectRef = [MyProject2.xcodeproj] /* MyProject2.xcodeproj */; }, + { + ProductGroup = [MyProject3.xcodeproj:prodgrp] /* Products */; + ProjectRef = [MyProject3.xcodeproj] /* MyProject3.xcodeproj */; + }, ); projectRoot = ""; targets = ( @@ -293,6 +333,13 @@ remoteRef = [MyProject2.xcodeproj:prodprox] /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + [libMyProject3-d.dylib] /* libMyProject3-d.dylib */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.dylib"; + path = "libMyProject3-d.dylib"; + remoteRef = [MyProject3.xcodeproj:prodprox] /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ ]] end @@ -312,6 +359,11 @@ name = "libMyProject2-d.a"; targetProxy = [MyProject2.xcodeproj:targprox] /* PBXContainerItemProxy */; }; + [MyProject3.xcodeproj:targdep] /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "libMyProject3-d.dylib"; + targetProxy = [MyProject3.xcodeproj:targprox] /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ ]] end From aa74a74794c0093a3193079215f6d8cfe1203c99 Mon Sep 17 00:00:00 2001 From: Ben Ratzlaff Date: Thu, 12 May 2016 22:13:38 -0700 Subject: [PATCH 5/7] Update to use p.callArray --- _preload.lua | 2 +- tests/test_xcode_scheme.lua | 27 ++++++++++--------- xcode_scheme.lua | 52 +++++++++++++++++++++---------------- 3 files changed, 43 insertions(+), 38 deletions(-) diff --git a/_preload.lua b/_preload.lua index cbb971b..8470efc 100644 --- a/_preload.lua +++ b/_preload.lua @@ -53,7 +53,7 @@ onProject = function(prj) p.generate(prj, ".xcodeproj/project.pbxproj", p.modules.xcode.generateProject) - p.generate(prj, ".xcodeproj/xcshareddata/xcschemes/" .. prj.name .. ".xcscheme", p.modules.xcode.generateScheme) + p.generate(prj, ".xcodeproj/xcshareddata/xcschemes/" .. prj.name .. ".xcscheme", p.modules.xcode.scheme.generate) end, } diff --git a/tests/test_xcode_scheme.lua b/tests/test_xcode_scheme.lua index 57ff0b0..cc4a50e 100644 --- a/tests/test_xcode_scheme.lua +++ b/tests/test_xcode_scheme.lua @@ -13,26 +13,25 @@ -- Setup/Teardown --------------------------------------------------------------------------- - local wks, prj1, tr + local wks, prj function suite.teardown() wks = nil - prj1 = nil - tr = nil + prj = nil end function suite.setup() _ACTION = "xcode4" xcode.used_ids = { } -- reset the list of generated IDs - wks, prj1 = test.createWorkspace() + wks = test.createWorkspace() end local function prepare() wks = premake.oven.bakeWorkspace(wks) xcode.prepareWorkspace(wks) - local prj = premake.workspace.getproject(wks, 1) - tr = xcode.buildprjtree(prj) + prj = premake.workspace.getproject(wks, 1) + local tr = xcode.buildprjtree(prj) end --------------------------------------------------------------------------- @@ -41,7 +40,7 @@ function suite.scheme_header() prepare() - scheme.Header(tr) + scheme.Header(prj) test.capture [[ ]] @@ -68,7 +67,7 @@ function suite.scheme_build() prepare() - scheme.build(tr) + scheme.build(prj) test.capture [[ @@ -200,7 +199,7 @@ function suite.scheme_archive() prepare() - scheme.archive(tr) + scheme.archive(prj) test.capture [[ ') p.push('') end - function scheme.Footer(tr) + function scheme.Footer(prj) p.pop('') end - function scheme.buildablereference(tr) + function scheme.buildablereference(prj) + local tr = project.getsourcetree(prj) for _, node in ipairs(tr.products.children) do p.push('') @@ -49,13 +50,13 @@ p.w('buildForProfiling = "YES"') p.w('buildForArchiving = "YES"') p.w('buildForAnalyzing = "YES">') - scheme.buildablereference(tr) + scheme.buildablereference(prj) p.pop('') p.pop('') p.pop('') end - function scheme.test(tr) + function scheme.test(prj) p.push('') p.pop('') p.push('') - scheme.buildablereference(tr) + scheme.buildablereference(prj) p.pop('') p.pop('') end - function scheme.launch(tr) + function scheme.launch(prj) p.push('') p.push('') - scheme.buildablereference(tr) + scheme.buildablereference(prj) p.pop('') p.push('') p.pop('') p.pop('') end - function scheme.profile(tr) + function scheme.profile(prj) p.push('') p.push('') - scheme.buildablereference(tr) + scheme.buildablereference(prj) p.pop('') p.pop('') end - function scheme.analyze(tr) + function scheme.analyze(prj) p.push('') p.pop('') end - function scheme.archive(tr) + function scheme.archive(prj) p.push('') @@ -120,15 +121,20 @@ -- The Premake project to generate. -- - function m.generateScheme(prj) - local tr = project.getsourcetree(prj) - scheme.Header(tr) - scheme.build(tr) - scheme.test(tr) - scheme.launch(tr) - scheme.profile(tr) - scheme.analyze(tr) - scheme.archive(tr) - scheme.Footer(tr) + m.scheme.project = function(prj) + return { + scheme.Header, + scheme.build, + scheme.test, + scheme.launch, + scheme.profile, + scheme.analyze, + scheme.archive, + scheme.Footer, + } + end + + function m.scheme.generate(prj) + p.callArray(m.scheme.project, prj) end From cfff5a5b151fe4e9f8c73e1528281d48ec6916ff Mon Sep 17 00:00:00 2001 From: Ben Ratzlaff Date: Fri, 13 May 2016 22:09:19 -0700 Subject: [PATCH 6/7] Clean up dependencies test some --- tests/test_xcode_dependencies.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/test_xcode_dependencies.lua b/tests/test_xcode_dependencies.lua index 722d2a4..80e42cf 100644 --- a/tests/test_xcode_dependencies.lua +++ b/tests/test_xcode_dependencies.lua @@ -23,7 +23,7 @@ end function suite.setup() - _ACTION = "xcode4" + premake.action.set("xcode4") xcode.used_ids = { } -- reset the list of generated IDs wks, prj1 = test.createWorkspace() @@ -45,11 +45,9 @@ end local function prepare() - wks = premake.oven.bakeWorkspace(wks) xcode.prepareWorkspace(wks) - local prj3 = premake.workspace.getproject(wks, 1) - --prj2 = test.getproject(wks, 2) - tr = xcode.buildprjtree(prj3) + local prj = test.getproject(wks, 1) + tr = xcode.buildprjtree(prj) end From 3dc4a5d1d915d1a6a63d47c4fe3db6d2305702dc Mon Sep 17 00:00:00 2001 From: Ben Ratzlaff Date: Sun, 15 May 2016 16:28:44 -0700 Subject: [PATCH 7/7] Undo renaming of prj to prj1, make prj3 assignment a local --- tests/test_xcode_dependencies.lua | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/test_xcode_dependencies.lua b/tests/test_xcode_dependencies.lua index 80e42cf..7a2dc24 100644 --- a/tests/test_xcode_dependencies.lua +++ b/tests/test_xcode_dependencies.lua @@ -12,13 +12,12 @@ -- Setup/Teardown --------------------------------------------------------------------------- - local wks, prj1, prj2, prj3, tr + local wks, prj, prj2, tr function suite.teardown() wks = nil - prj1 = nil + prj = nil prj2 = nil - prj3 = nil tr = nil end @@ -26,7 +25,7 @@ premake.action.set("xcode4") xcode.used_ids = { } -- reset the list of generated IDs - wks, prj1 = test.createWorkspace() + wks, prj = test.createWorkspace() links { "MyProject2" } dependson { "MyProject3" } @@ -36,7 +35,7 @@ targetsuffix "-d" configuration {} - prj3 = test.createproject(wks) + local prj3 = test.createproject(wks) kind "SharedLib" links { "MyProject2" } configuration "Debug" @@ -46,8 +45,8 @@ local function prepare() xcode.prepareWorkspace(wks) - local prj = test.getproject(wks, 1) - tr = xcode.buildprjtree(prj) + local prj1 = test.getproject(wks, 1) + tr = xcode.buildprjtree(prj1) end @@ -66,7 +65,7 @@ end function suite.PBXBuildFile_ListsDependencyTargets_OnSharedLib() - prj2.kind="SharedLib" + prj2.kind = "SharedLib" prepare() xcode.PBXBuildFile(tr) test.capture [[ @@ -137,13 +136,12 @@ function suite.PBXFileReference_UsesRelativePaths() prj.location = "MyProject" - prj2.location = ".." prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [MyProject2.xcodeproj] /* libMyProject2-d.a */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MyProject2.xcodeproj"; path = ../MyProject2.xcodeproj; sourceTree = SOURCE_ROOT; }; - [MyProject3.xcodeproj] /* libMyProject3-d.dylib */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MyProject3.xcodeproj"; path = MyProject3.xcodeproj; sourceTree = SOURCE_ROOT; }; + [MyProject3.xcodeproj] /* libMyProject3-d.dylib */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MyProject3.xcodeproj"; path = ../MyProject3.xcodeproj; sourceTree = SOURCE_ROOT; }; [MyProject:product] /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = MyProject; path = MyProject; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ ]]