From 6a1e7eecb85946bc22c899cfba2ee64c99b46a1c Mon Sep 17 00:00:00 2001 From: Alexey Orlov Date: Tue, 20 Nov 2012 00:08:48 +0300 Subject: [PATCH] added dependson command to allow dependency without linking --- src/base/api.lua | 125 ++++++++-------- src/base/project.lua | 133 +++++++++--------- src/project/project.lua | 123 ++++++++-------- .../vstudio/cs2005/test_project_refs.lua | 22 ++- .../vstudio/sln2005/test_dependencies.lua | 15 +- 5 files changed, 231 insertions(+), 187 deletions(-) diff --git a/src/base/api.lua b/src/base/api.lua index 4848e98b..2680bac1 100644 --- a/src/base/api.lua +++ b/src/base/api.lua @@ -10,7 +10,7 @@ premake.fields = {} - + -- -- A place to store the current active objects in each project scope. @@ -40,7 +40,7 @@ if not name then error("missing name", 2) end - + if _G[name] then error("name in use", 2) end @@ -49,22 +49,22 @@ if not api.getsetter(field) then error("invalid kind '" .. kind .. "'", 2) end - + -- add this new field to my master list premake.fields[field.name] = field - + -- add create a setter function for it _G[name] = function(value) return api.callback(field, value) end - + -- list values also get a removal function if api.islistfield(field) and not api.iskeyedfield(field) then _G["remove" .. name] = function(value) return api.remove(field, value) end end - + -- if the field needs special handling, tell the config -- set system about it configset.registerfield(field.name, { @@ -85,7 +85,7 @@ else target = api.scope.configuration or api.scope.root end - + return target end @@ -97,20 +97,20 @@ function api.callback(field, value) local target = api.gettarget(field.scope) - + if not value then return target.configset[field.name] end - local status, result = pcall(function () + local status, result = pcall(function () if api.iskeyedfield(field) then - api.setkeyvalue(target, field, value) + api.setkeyvalue(target, field, value) else local setter = api.getsetter(field, true) setter(target, field.name, field, value) end end) - + if not status then if type(result) == "table" then result = result.msg @@ -137,7 +137,7 @@ local remover = api["remove" .. kind] or table.insert local removes = {} - + function recurse(value) if type(value) == "table" then for _, v in ipairs(value) do @@ -149,14 +149,14 @@ end recurse(value) - + local target = api.gettarget(field.scope) configset.removevalues(target.configset, field.name, removes) end -- --- Check to see if a value exists in a list of values, using a +-- Check to see if a value exists in a list of values, using a -- case-insensitive match. If the value does exist, the canonical -- version contained in the list is returned, so future tests can -- use case-sensitive comparisions. @@ -170,8 +170,8 @@ break end end - end - + end + if allowed then if type(allowed) == "function" then return allowed(value) @@ -213,7 +213,7 @@ function api.iskeyedfield(field) return field.kind:startswith("key-") end - + function api.islistfield(field) return field.kind:endswith("-list") end @@ -248,14 +248,14 @@ function api.setarray(target, name, field, value) -- if the target is the project, configset will be set and I can push -- the value there. Otherwise I was called to store into some other kind - -- of object (i.e. an array or list) + -- of object (i.e. an array or list) target = target.configset or target - + -- put simple values in an array if type(value) ~= "table" then value = { value } end - + -- store it, overwriting any existing value target[name] = value end @@ -289,11 +289,11 @@ target[name] = path.getabsolute(value) end end - + function api.removefile(target, value) table.insert(target, path.getabsolute(value)) end - + api.removedirectory = api.removefile @@ -306,14 +306,14 @@ if type(values) ~= "table" then error({ msg="value must be a table of key-value pairs" }) end - + local newval = {} - + local setter = api.getsetter(field, true) for key, value in pairs(values) do setter(newval, key, field, value) end - + configset.addvalue(target.configset, field.name, newval) end @@ -385,9 +385,9 @@ -- if the target is the project, configset will be set and I can push -- the value there. Otherwise I was called to store into some other kind - -- of object (i.e. an array or list) + -- of object (i.e. an array or list) target = target.configset or target - + target[name] = value end @@ -417,7 +417,7 @@ name = "buildaction", scope = "config", kind = "string", - allowed = { + allowed = { "Compile", "Copy", "Embed", @@ -450,7 +450,7 @@ scope = "project", kind = "string-list", } - + api.register { name = "debugargs", scope = "config", @@ -471,7 +471,7 @@ kind = "path", tokens = true, } - + api.register { name = "debugenvs", scope = "config", @@ -487,14 +487,21 @@ "c7", }, } - + api.register { name = "defines", scope = "config", kind = "string-list", tokens = true, } - + + api.register { + name = "dependson", + scope = "config", + kind = "string-list", + tokens = true, + } + api.register { name = "deploymentoptions", scope = "config", @@ -591,22 +598,22 @@ name = "imageoptions", scope = "config", kind = "string-list", - tokens = true, + tokens = true, } - + api.register { name = "imagepath", scope = "config", kind = "path", - tokens = true, - } + tokens = true, + } api.register { name = "implibdir", scope = "config", kind = "path", tokens = true, - } + } api.register { name = "implibextension", @@ -679,7 +686,7 @@ kind = "string-list", tokens = true, } - + api.register { name = "links", scope = "config", @@ -706,7 +713,7 @@ scope = "config", kind = "string-list", tokens = true, - } + } api.register { @@ -735,7 +742,7 @@ scope = "config", kind = "path", tokens = true, - } + } api.register { name = "platforms", @@ -807,7 +814,7 @@ scope = "config", kind = "path", tokens = true, - } + } api.register { name = "targetextension", @@ -905,13 +912,13 @@ function premake.getobject(t) local container - + if (t == "container" or t == "solution") then container = premake.CurrentContainer else container = premake.CurrentConfiguration end - + if t == "solution" then if type(container) == "project" then container = container.solution @@ -920,7 +927,7 @@ container = nil end end - + local msg if (not container) then if (t == "container") then @@ -931,7 +938,7 @@ msg = "no active solution, project, or configuration" end end - + return container, msg end @@ -951,15 +958,15 @@ if (not container) then error(err, 2) end - + local cfg = { } cfg.terms = table.flatten({terms}) cfg.basedir = os.getcwd() cfg.configset = container.configset - + table.insert(container.blocks, cfg) premake.CurrentConfiguration = cfg - + -- create a keyword list using just the indexed keyword items. This is a little -- confusing: "terms" are what the user specifies in the script, "keywords" are -- the Lua patterns that result. I'll refactor to better names. @@ -977,7 +984,7 @@ return cfg end - + local function createproject(name, sln, isUsage) local prj = premake5.project.new(sln, name) @@ -1002,7 +1009,7 @@ sln.projects[name] = prj end - + prj.script = _SCRIPT prj.usage = isUsage; @@ -1017,31 +1024,31 @@ if(premake.CurrentContainer.usage) then return nil end return premake.CurrentContainer end - + -- identify the parent solution local sln if (type(premake.CurrentContainer) == "project") then sln = premake.CurrentContainer.solution else sln = premake.CurrentContainer - end + end if (type(sln) ~= "solution") then error("no active solution", 2) end - + -- if this is a new project, or the old project is a usage project, create it if((not sln.projects[name]) or sln.projects[name].usage) then premake.CurrentContainer = createproject(name, sln) else premake.CurrentContainer = sln.projects[name]; end - + -- add an empty, global configuration to the project configuration {} - + -- this is the new place for storing scoped objects api.scope.project = premake.CurrentContainer - + return premake.CurrentContainer end @@ -1054,7 +1061,7 @@ return premake.CurrentContainer end end - + premake.CurrentContainer = premake.solution.get(name) if (not premake.CurrentContainer) then local sln = premake.solution.new(name) @@ -1063,11 +1070,11 @@ -- add an empty, global configuration configuration { } - + -- this is the new place for storing scoped objects api.scope.solution = premake.CurrentContainer api.scope.project = nil - + return premake.CurrentContainer end diff --git a/src/base/project.lua b/src/base/project.lua index fad12a1a..9ecd64a3 100644 --- a/src/base/project.lua +++ b/src/base/project.lua @@ -5,7 +5,7 @@ -- premake.project = { } - + -- -- Create a tree from a project's list of files, representing the filesystem hierarchy. @@ -22,11 +22,11 @@ tr.project = prj local isvpath - + local function onadd(node) node.isvpath = isvpath end - + for fcfg in premake.project.eachfile(prj) do isvpath = (fcfg.name ~= fcfg.vpath) local node = premake.tree.add(tr, fcfg.vpath, onadd) @@ -47,10 +47,10 @@ function premake.eachconfig(prj, platform) -- I probably have the project root config, rather than the actual project if prj.project then prj = prj.project end - + local cfgs = prj.solution.configurations local i = 0 - + return function () i = i + 1 if i <= #cfgs then @@ -58,7 +58,7 @@ end end end - + -- @@ -105,8 +105,8 @@ return value end end - - + + -- -- Given a map of supported platform identifiers, filters the solution's list @@ -130,17 +130,17 @@ end end end - + if #result == 0 and default then table.insert(result, default) end - + return result end - --- + +-- -- Locate a project by name; case insensitive. -- @@ -153,8 +153,8 @@ end end end - - + + -- -- Locate a file in a project with a given extension; used to locate "special" @@ -219,12 +219,12 @@ return iif(useshortname, name:lower(), name) end end - - - + + + -- --- Returns a list of sibling projects on which the specified project depends. --- This is used to list dependencies within a solution or workspace. Must +-- Returns a list of sibling projects on which the specified project depends. +-- This is used to list dependencies within a solution or workspace. Must -- consider all configurations because Visual Studio does not support per-config -- project dependencies. -- @@ -237,15 +237,22 @@ function premake.getdependencies(prj) -- make sure I've got the project and not root config prj = prj.project or prj - + + local function add_to_project_list(depproj, results) + local dep = premake.findproject(depproj) + if dep and not table.contains(results, dep) then + table.insert(results, dep) + end + end + local results = { } for _, cfg in pairs(prj.__configs) do for _, link in ipairs(cfg.links) do - local dep = premake.findproject(link) - if dep and not table.contains(results, dep) then - table.insert(results, dep) - end + add_to_project_list(link, results) end + for _, depproj in ipairs(cfg.dependson) do + add_to_project_list(depproj, results) + end end return results @@ -271,9 +278,9 @@ fname = path.join(premake5.project.getlocation(prj), fname) return path.getrelative(os.getcwd(), fname) end - - - + + + -- -- Returns a list of link targets. Kind may be one of: -- siblings - linkable sibling projects @@ -287,21 +294,21 @@ -- directory - just the directory, no name -- fullpath - full path with decorated name -- object - return the project object of the dependency --- - +-- + function premake.getlinks(cfg, kind, part) -- if I'm building a list of link directories, include libdirs local result = iif (part == "directory" and kind == "all", cfg.libdirs, {}) -- am I getting links for a configuration or a project? local cfgname = iif(cfg.name == cfg.project.name, "", cfg.name) - + -- how should files be named? local pathstyle = premake.getpathstyle(cfg) local namestyle = premake.getnamestyle(cfg) - + local function canlink(source, target) - if (target.kind ~= "SharedLib" and target.kind ~= "StaticLib") then + if (target.kind ~= "SharedLib" and target.kind ~= "StaticLib") then return false end if premake.iscppproject(source) then @@ -310,14 +317,14 @@ return premake.isdotnetproject(target) end end - + for _, link in ipairs(cfg.links) do local item - + -- is this a sibling project? local prj = premake.findproject(link) if prj and kind ~= "system" then - + local prjcfg = premake.getconfig(prj, cfgname, cfg.platform) if kind == "dependencies" or canlink(cfg, prjcfg) then if (part == "directory") then @@ -332,7 +339,7 @@ end elseif not prj and (kind == "system" or kind == "all") then - + if (part == "directory") then local dir = path.getdirectory(link) if (dir ~= ".") then @@ -365,12 +372,12 @@ end end end - + return result end - - + + -- -- Gets the name style for a configuration, indicating what kind of prefix, -- extensions, etc. should be used in target file names. @@ -384,7 +391,7 @@ function premake.getnamestyle(cfg) return premake.platforms[cfg.platform].namestyle or premake.gettool(cfg).namestyle or "posix" end - + -- @@ -404,7 +411,7 @@ return "posix" end end - + -- -- Assembles a target for a particular tool/system/configuration. @@ -434,18 +441,18 @@ -- function premake.gettarget(cfg, direction, pathstyle, namestyle, system) - if system == "bsd" or system == "solaris" then - system = "linux" + if system == "bsd" or system == "solaris" then + system = "linux" end -- Fix things up based on the current system local kind = cfg.kind if premake.iscppproject(cfg) then -- On Windows, shared libraries link against a static import library - if (namestyle == "windows" or system == "windows") - and kind == "SharedLib" and direction == "link" - and not cfg.flags.NoImportLib - then + if (namestyle == "windows" or system == "windows") + and kind == "SharedLib" and direction == "link" + and not cfg.flags.NoImportLib + then kind = "StaticLib" end @@ -492,11 +499,11 @@ ext = ".a" end end - + prefix = cfg[field.."prefix"] or cfg.targetprefix or prefix suffix = cfg[field.."suffix"] or cfg.targetsuffix or suffix ext = cfg[field.."extension"] or cfg.targetextension or ext - + -- build the results object local result = { } result.basename = name .. suffix @@ -506,12 +513,12 @@ result.suffix = suffix result.fullpath = path.join(result.directory, result.name) result.bundlepath = bundlepath or result.fullpath - + if pathstyle == "windows" then result.directory = path.translate(result.directory, "\\") result.fullpath = path.translate(result.fullpath, "\\") end - + return result end @@ -535,8 +542,8 @@ return premake.dotnet end end - - + + -- -- Given a source file path, return a corresponding virtual path based on @@ -546,24 +553,24 @@ function premake.project.getvpath(prj, filename) prj = prj.project - + -- if there is no match, return the input filename local vpath = filename for replacement,patterns in pairs(prj.vpaths or {}) do for _,pattern in ipairs(patterns) do pattern = premake5.project.getrelative(prj, pattern) - + -- does the filename match this vpath pattern? local i = vpath:find(path.wildcards(pattern)) - if i == 1 then + if i == 1 then -- yes; trim the leading portion of the path i = pattern:find("*", 1, true) or (pattern:len() + 1) local leaf = vpath:sub(i) if leaf:startswith("/") then leaf = leaf:sub(2) end - + -- check for (and remove) stars in the replacement pattern. -- If there are none, then trim all path info from the leaf -- and use just the filename in the replacement (stars should @@ -575,12 +582,12 @@ leaf = path.getname(leaf) end end - + vpath = path.join(stem, leaf) end end end - + -- remove any dot ("./", "../") patterns from the start of the path local changed repeat @@ -593,12 +600,12 @@ changed = false end until not changed - + return vpath end --- +-- -- Returns true if the solution contains at least one C/C++ project. -- @@ -610,9 +617,9 @@ end end - --- + +-- -- Returns true if the solution contains at least one .NET project. -- diff --git a/src/project/project.lua b/src/project/project.lua index 4e34c711..8f2c95e2 100755 --- a/src/project/project.lua +++ b/src/project/project.lua @@ -70,7 +70,7 @@ local ctx = context.new(prj.configset, environ) context.addterms(ctx, _ACTION) context.addterms(ctx, prj.language) - + -- allow script to override system and architecture ctx.system = ctx.system or premake.action.current().os or os.get() context.addterms(ctx, ctx.system) @@ -78,12 +78,12 @@ -- if a kind is specified at the project level, use that too context.addterms(ctx, ctx.kind) - + -- attach a bit more local state ctx.solution = sln - - - -- TODO: OLD, REMOVE: build an old-style configuration to wrap context, for now + + + -- TODO: OLD, REMOVE: build an old-style configuration to wrap context, for now local result = oven.merge(oven.merge({}, sln), prj) result.solution = sln result.blocks = prj.blocks @@ -91,15 +91,15 @@ -- prevent any default system setting from influencing configurations result.system = nil - - -- TODO: HACK, TRANSITIONAL, REMOVE: pass requests for missing values - -- through to the config context. Eventually all values will be in the + + -- TODO: HACK, TRANSITIONAL, REMOVE: pass requests for missing values + -- through to the config context. Eventually all values will be in the -- context and the cfg wrapper can be done away with setmetatable(prj, nil) result.context = ctx - prj.context = ctx + prj.context = ctx setmetatable(result, { __index = function(prj, key) return prj.context[key] @@ -117,14 +117,14 @@ local buildcfg = pairing[1] local platform = pairing[2] local cfg = project.bakeconfig(result, buildcfg, platform) - + -- make sure this config is supported by the action; skip if not if premake.action.supportsconfig(cfg) then configs[(buildcfg or "*") .. (platform or "")] = cfg end end result.configs = configs - + return result end @@ -135,7 +135,7 @@ -- function project.bakeconfig(prj, buildcfg, platform) - -- set the default system and architecture values; for backward + -- set the default system and architecture values; for backward -- compatibility, use platform if it would be a valid value local system = premake.action.current().os or os.get() local architecture @@ -180,8 +180,8 @@ ctx.language = prj.language - - -- TODO: OLD, REMOVE: build an old-style configuration to wrap context, for now + + -- TODO: OLD, REMOVE: build an old-style configuration to wrap context, for now local filter = { ["buildcfg"] = buildcfg, ["platform"] = platform, @@ -189,7 +189,7 @@ ["system"] = ctx.system, ["architecture"] = ctx.architecture, } - + local cfg = oven.bake(prj, prj.solution, filter) cfg.solution = prj.solution cfg.project = prj @@ -214,8 +214,8 @@ environ.cfg = proxy - -- TODO: HACK, TRANSITIONAL, REMOVE: pass requests for missing values - -- through to the config context. Eventually all values will be in the + -- TODO: HACK, TRANSITIONAL, REMOVE: pass requests for missing values + -- through to the config context. Eventually all values will be in the -- context and the cfg wrapper can be done away with setmetatable(cfg, { __index = function(cfg, key) @@ -226,7 +226,7 @@ end }) - + -- fill in any calculated values premake5.config.bake(cfg) @@ -240,7 +240,7 @@ -- @param prj -- The project to query. -- @return --- Two values: +-- Two values: -- - an array of the project's build configuration/platform -- pairs, based on the result of the mapping -- - a key-value table that maps solution build configuration/ @@ -252,26 +252,26 @@ for i, cfg in ipairs(configs) do configs[i] = project.mapconfig(prj, cfg[1], cfg[2]) end - + -- walk through the result and remove duplicates local buildcfgs = {} local platforms = {} - + for _, pairing in ipairs(configs) do local buildcfg = pairing[1] local platform = pairing[2] - + if not table.contains(buildcfgs, buildcfg) then table.insert(buildcfgs, buildcfg) end - + if platform and not table.contains(platforms, platform) then table.insert(platforms, platform) end end -- merge these canonical lists back into pairs for the final result - configs = table.fold(buildcfgs, platforms) + configs = table.fold(buildcfgs, platforms) return configs end @@ -296,7 +296,7 @@ local configs = prj.cfglist local count = #configs - + local i = 0 return function () i = i + 1 @@ -307,7 +307,7 @@ end --- +-- -- Locate a project by name; case insensitive. -- -- @param name @@ -328,7 +328,7 @@ -- --- Retrieve the project's configuration information for a particular build +-- Retrieve the project's configuration information for a particular build -- configuration/platform pair. -- -- @param prj @@ -340,35 +340,35 @@ -- @return -- A configuration object. -- - + function project.getconfig(prj, buildcfg, platform) -- to make testing a little easier, allow this function to -- accept an unbaked project, and fix it on the fly if not prj.baked then prj = project.bake(prj, prj.solution) end - + -- if no build configuration is specified, return the "root" project -- configurations, which includes all configuration values that -- weren't set with a specific configuration filter if not buildcfg then return prj end - + -- apply any configuration mappings local pairing = project.mapconfig(prj, buildcfg, platform) buildcfg = pairing[1] platform = pairing[2] - -- look up and return the associated config + -- look up and return the associated config local key = (buildcfg or "*") .. (platform or "") return prj.configs[key] end -- --- Returns a list of sibling projects on which the specified project depends. --- This is used to list dependencies within a solution or workspace. Must +-- Returns a list of sibling projects on which the specified project depends. +-- This is used to list dependencies within a solution or workspace. Must -- consider all configurations because Visual Studio does not support per-config -- project dependencies. -- @@ -381,13 +381,20 @@ function project.getdependencies(prj) local result = {} + local function add_to_project_list(cfg, depproj, result) + local dep = premake.solution.findproject(cfg.solution, depproj) + if dep and not table.contains(result, dep) then + table.insert(result, dep) + end + end + for cfg in project.eachconfig(prj) do for _, link in ipairs(cfg.links) do - local dep = premake.solution.findproject(cfg.solution, link) - if dep and not table.contains(result, dep) then - table.insert(result, dep) - end + add_to_project_list(cfg, link, result) end + for _, depproj in ipairs(cfg.dependson) do + add_to_project_list(cfg, depproj, result) + end end return result @@ -421,7 +428,7 @@ fcfg.name = path.getname(filename) fcfg.basename = path.getbasename(filename) fcfg.path = fcfg.relpath - + return fcfg end @@ -456,26 +463,26 @@ function project.getfileobject(prj, filename) -- make sure I have the project, and not it's root configuration prj = prj.project or prj - + -- create a list of objects if necessary prj.fileobjects = prj.fileobjects or {} - -- look for the corresponding object file + -- look for the corresponding object file local basename = path.getbasename(filename) local uniqued = basename local i = 0 - + while prj.fileobjects[uniqued] do -- found a match? if prj.fileobjects[uniqued] == filename then return uniqued end - + -- check a different name i = i + 1 uniqued = basename .. i end - + -- no match, create a new one prj.fileobjects[uniqued] = filename return uniqued @@ -519,7 +526,7 @@ end if not location then location = prj.basedir - end + end if relativeto then location = path.getrelative(relativeto, location) end @@ -573,7 +580,7 @@ function project.getsourcetree(prj) -- make sure I have the project, and not it's root configuration prj = prj.project or prj - + -- check for a previously cached tree if prj.sourcetree then return prj.sourcetree @@ -589,10 +596,10 @@ -- create a file config lookup cache prj.fileconfigs = {} - + -- create a tree from the file list local tr = premake.tree.new(prj.name) - + for file in pairs(files) do local fcfg = project.getfileconfig(prj, file) @@ -601,23 +608,23 @@ -- virtual paths are used when adding nodes. local node = premake.tree.add(tr, fcfg.vpath, function(node) -- ...but when a real file system path is used, store it so that - -- an association can be made in the IDE + -- an association can be made in the IDE if fcfg.vpath == fcfg.relpath then node.realpath = node.path end end) - + -- Store full file configuration in file (leaf) nodes for key, value in pairs(fcfg) do node[key] = value end - + prj.fileconfigs[node.abspath] = node end premake.tree.trimroot(tr) premake.tree.sort(tr) - + -- cache result and return prj.sourcetree = tr return tr @@ -633,7 +640,7 @@ function project.getvpath(prj, filename) -- if there is no match, return the input filename local vpath = filename - + for replacement,patterns in pairs(prj.vpaths or {}) do for _,pattern in ipairs(patterns) do @@ -665,12 +672,12 @@ else leaf = path.getname(leaf) end - + vpath = path.join(stem, leaf) end end end - + return vpath end @@ -720,7 +727,7 @@ function project.mapconfig(prj, buildcfg, platform) local pairing = { buildcfg, platform } - + local testpattern = function(pattern, pairing, i) local j = 1 while i <= #pairing and j <= #pattern do @@ -732,12 +739,12 @@ end return true end - + for pattern, replacements in pairs(prj.configmap or {}) do if type(pattern) ~= "table" then pattern = { pattern } end - + -- does this pattern match any part of the pair? If so, -- replace it with the corresponding values for i = 1, #pairing do @@ -750,7 +757,7 @@ end end end - + return pairing end diff --git a/tests/actions/vstudio/cs2005/test_project_refs.lua b/tests/actions/vstudio/cs2005/test_project_refs.lua index 52b0a4f5..f8bf7eff 100644 --- a/tests/actions/vstudio/cs2005/test_project_refs.lua +++ b/tests/actions/vstudio/cs2005/test_project_refs.lua @@ -14,7 +14,7 @@ -- local sln, prj - + function suite.setup() _ACTION = "vs2008" sln = test.createsolution() @@ -42,7 +42,7 @@ -- --- If a sibling project is listed in links(), an item group should +-- If a sibling project is listed in links()/dependson(), an item group should -- be written with a reference to that sibling project. -- @@ -59,8 +59,22 @@ ]] end + function suite.projectReferenceAdded_onSiblingProjectDependson() + dependson { "MyProject" } + prepare() + test.capture [[ + + + {00112233-4455-6677-8888-99AABBCCDDEE} + MyProject + + + ]] + end + + -- --- Project references should always be specified relative to the +-- Project references should always be specified relative to the -- project doing the referencing. -- @@ -79,4 +93,4 @@ ]] end - + diff --git a/tests/actions/vstudio/sln2005/test_dependencies.lua b/tests/actions/vstudio/sln2005/test_dependencies.lua index 78d4d3ed..40e57c4f 100755 --- a/tests/actions/vstudio/sln2005/test_dependencies.lua +++ b/tests/actions/vstudio/sln2005/test_dependencies.lua @@ -10,25 +10,31 @@ -- --- Setup +-- Setup -- local sln, prj1, prj2 - + function suite.setup() _ACTION = "vs2005" sln, prj1 = test.createsolution() uuid "AE61726D-187C-E440-BD07-2556188A6565" prj2 = test.createproject(sln) uuid "2151E83B-997F-4A9D-955D-380157E88C31" + prj3 = test.createproject(sln) + uuid "CAA68162-8B96-11E1-8D5E-5885BBE59B18" links "MyProject" + dependson "MyProject2" end - + local function prepare(language) prj1.language = language prj2.language = language prj2 = premake.solution.getproject_ng(sln, 2) sln2005.projectdependencies_ng(prj2) + prj3.language = language + prj3 = premake.solution.getproject_ng(sln, 3) + sln2005.projectdependencies_ng(prj3) end @@ -40,6 +46,7 @@ test.capture [[ ProjectSection(ProjectDependencies) = postProject {AE61726D-187C-E440-BD07-2556188A6565} = {AE61726D-187C-E440-BD07-2556188A6565} + {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31} EndProjectSection ]] end @@ -54,6 +61,7 @@ test.capture [[ ProjectSection(ProjectDependencies) = postProject {AE61726D-187C-E440-BD07-2556188A6565} = {AE61726D-187C-E440-BD07-2556188A6565} + {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31} EndProjectSection ]] end @@ -70,6 +78,7 @@ test.capture [[ ProjectSection(ProjectDependencies) = postProject {AE61726D-187C-E440-BD07-2556188A6565} = {AE61726D-187C-E440-BD07-2556188A6565} + {2151E83B-997F-4A9D-955D-380157E88C31} = {2151E83B-997F-4A9D-955D-380157E88C31} EndProjectSection ]] end