Increased consistency of p. usage

This commit is contained in:
Sam Surtees 2017-04-25 15:44:13 +10:00
parent 43c5e0a4ae
commit fa3328440e
191 changed files with 868 additions and 735 deletions

View File

@ -281,17 +281,17 @@
_p(3, '<Debugger IsRemote="%s" RemoteHostName="%s" RemoteHostPort="%s" DebuggerPath="" IsExtended="%s">', iif(cfg.debugremotehost, "yes", "no"), cfg.debugremotehost or "", iif(cfg.debugport, tostring(cfg.debugport), ""), iif(cfg.debugextendedprotocol, "yes", "no")) _p(3, '<Debugger IsRemote="%s" RemoteHostName="%s" RemoteHostPort="%s" DebuggerPath="" IsExtended="%s">', iif(cfg.debugremotehost, "yes", "no"), cfg.debugremotehost or "", iif(cfg.debugport, tostring(cfg.debugport), ""), iif(cfg.debugextendedprotocol, "yes", "no"))
if #cfg.debugsearchpaths > 0 then if #cfg.debugsearchpaths > 0 then
_p(4, '<DebuggerSearchPaths>%s</DebuggerSearchPaths>', table.concat(premake.esc(project.getrelative(cfg.project, cfg.debugsearchpaths)), "\n")) _p(4, '<DebuggerSearchPaths>%s</DebuggerSearchPaths>', table.concat(p.esc(project.getrelative(cfg.project, cfg.debugsearchpaths)), "\n"))
else else
_p(4, '<DebuggerSearchPaths/>') _p(4, '<DebuggerSearchPaths/>')
end end
if #cfg.debugconnectcommands > 0 then if #cfg.debugconnectcommands > 0 then
_p(4, '<PostConnectCommands>%s</PostConnectCommands>', table.concat(premake.esc(cfg.debugconnectcommands), "\n")) _p(4, '<PostConnectCommands>%s</PostConnectCommands>', table.concat(p.esc(cfg.debugconnectcommands), "\n"))
else else
_p(4, '<PostConnectCommands/>') _p(4, '<PostConnectCommands/>')
end end
if #cfg.debugstartupcommands > 0 then if #cfg.debugstartupcommands > 0 then
_p(4, '<StartupCommands>%s</StartupCommands>', table.concat(premake.esc(cfg.debugstartupcommands), "\n")) _p(4, '<StartupCommands>%s</StartupCommands>', table.concat(p.esc(cfg.debugstartupcommands), "\n"))
else else
_p(4, '<StartupCommands/>') _p(4, '<StartupCommands/>')
end end

View File

@ -6,7 +6,8 @@
local suite = test.declare("codelite_cproj_config") local suite = test.declare("codelite_cproj_config")
local codelite = premake.modules.codelite local p = premake
local codelite = p.modules.codelite
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-- Setup/Teardown -- Setup/Teardown
@ -15,8 +16,8 @@
local wks, prj, cfg local wks, prj, cfg
function suite.setup() function suite.setup()
premake.action.set("codelite") p.action.set("codelite")
premake.indent(" ") p.indent(" ")
wks, prj = test.createWorkspace() wks, prj = test.createWorkspace()
end end

View File

@ -6,7 +6,8 @@
local suite = test.declare("codelite_cproj") local suite = test.declare("codelite_cproj")
local codelite = premake.modules.codelite local p = premake
local codelite = p.modules.codelite
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-- Setup/Teardown -- Setup/Teardown
@ -15,13 +16,13 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.action.set("codelite") p.action.set("codelite")
premake.indent(" ") p.indent(" ")
wks = test.createWorkspace() wks = test.createWorkspace()
end end
local function prepare() local function prepare()
wks = premake.oven.bakeWorkspace(wks) wks = p.oven.bakeWorkspace(wks)
prj = test.getproject(wks, 1) prj = test.getproject(wks, 1)
end end

View File

@ -6,7 +6,8 @@
--- ---
local suite = test.declare("codelite_workspace") local suite = test.declare("codelite_workspace")
local codelite = premake.modules.codelite local p = premake
local codelite = p.modules.codelite
-- --
@ -16,8 +17,8 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.action.set("codelite") p.action.set("codelite")
premake.indent(" ") p.indent(" ")
wks = test.createWorkspace() wks = test.createWorkspace()
end end

View File

@ -20,7 +20,7 @@
-- Patch the project table to provide knowledge of D projects -- Patch the project table to provide knowledge of D projects
-- --
function p.project.isd(prj) function p.project.isd(prj)
return prj.language == premake.D return prj.language == p.D
end end
-- --

View File

@ -5,10 +5,11 @@
--- ---
local suite = test.declare("d_dmd") local suite = test.declare("d_dmd")
local m = premake.modules.d local p = premake
local m = p.modules.d
local make = premake.make local make = p.make
local project = premake.project local project = p.project
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
@ -18,15 +19,15 @@
local wks, prj, cfg local wks, prj, cfg
function suite.setup() function suite.setup()
premake.escaper(make.esc) p.escaper(make.esc)
wks = test.createWorkspace() wks = test.createWorkspace()
end end
local function prepare_cfg(calls) local function prepare_cfg(calls)
prj = premake.workspace.getproject(wks, 1) prj = p.workspace.getproject(wks, 1)
local cfg = test.getconfig(prj, "Debug") local cfg = test.getconfig(prj, "Debug")
local toolset = premake.tools.dmd local toolset = p.tools.dmd
premake.callArray(calls, cfg, toolset) p.callArray(calls, cfg, toolset)
end end

View File

@ -5,10 +5,11 @@
--- ---
local suite = test.declare("d_gdc") local suite = test.declare("d_gdc")
local m = premake.modules.d local p = premake
local m = p.modules.d
local make = premake.make local make = p.make
local project = premake.project local project = p.project
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
@ -18,15 +19,15 @@
local wks, prj, cfg local wks, prj, cfg
function suite.setup() function suite.setup()
premake.escaper(make.esc) p.escaper(make.esc)
wks = test.createWorkspace() wks = test.createWorkspace()
end end
local function prepare_cfg(calls) local function prepare_cfg(calls)
prj = premake.workspace.getproject(wks, 1) prj = p.workspace.getproject(wks, 1)
local cfg = test.getconfig(prj, "Debug") local cfg = test.getconfig(prj, "Debug")
local toolset = premake.tools.gdc local toolset = p.tools.gdc
premake.callArray(calls, cfg, toolset) p.callArray(calls, cfg, toolset)
end end

View File

@ -5,10 +5,11 @@
--- ---
local suite = test.declare("d_make") local suite = test.declare("d_make")
local m = premake.modules.d local p = premake
local m = p.modules.d
local make = premake.make local make = p.make
local project = premake.project local project = p.project
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
@ -18,19 +19,19 @@
local wks, prj, cfg local wks, prj, cfg
function suite.setup() function suite.setup()
premake.escaper(make.esc) p.escaper(make.esc)
wks = test.createWorkspace() wks = test.createWorkspace()
end end
local function prepare() local function prepare()
prj = premake.workspace.getproject(wks, 1) prj = p.workspace.getproject(wks, 1)
end end
local function prepare_cfg(calls) local function prepare_cfg(calls)
prj = premake.workspace.getproject(wks, 1) prj = p.workspace.getproject(wks, 1)
local cfg = test.getconfig(prj, "Debug") local cfg = test.getconfig(prj, "Debug")
local toolset = premake.tools.dmd local toolset = p.tools.dmd
premake.callArray(calls, cfg, toolset) p.callArray(calls, cfg, toolset)
end end

View File

@ -5,10 +5,11 @@
--- ---
local suite = test.declare("d_ldc") local suite = test.declare("d_ldc")
local m = premake.modules.d local p = premake
local m = p.modules.d
local make = premake.make local make = p.make
local project = premake.project local project = p.project
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
@ -18,15 +19,15 @@
local wks, prj, cfg local wks, prj, cfg
function suite.setup() function suite.setup()
premake.escaper(make.esc) p.escaper(make.esc)
wks = test.createWorkspace() wks = test.createWorkspace()
end end
local function prepare_cfg(calls) local function prepare_cfg(calls)
prj = premake.workspace.getproject(wks, 1) prj = p.workspace.getproject(wks, 1)
local cfg = test.getconfig(prj, "Debug") local cfg = test.getconfig(prj, "Debug")
local toolset = premake.tools.ldc local toolset = p.tools.ldc
premake.callArray(calls, cfg, toolset) p.callArray(calls, cfg, toolset)
end end

View File

@ -5,7 +5,8 @@
--- ---
local suite = test.declare("visual_d") local suite = test.declare("visual_d")
local m = premake.modules.d local p = premake
local m = p.modules.d
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
@ -15,9 +16,9 @@
local wks, prj, cfg local wks, prj, cfg
function suite.setup() function suite.setup()
premake.action.set("vs2010") p.action.set("vs2010")
-- premake.escaper(premake.vstudio.vs2005.esc) -- p.escaper(p.vstudio.vs2005.esc)
premake.indent(" ") p.indent(" ")
wks = workspace "MyWorkspace" wks = workspace "MyWorkspace"
configurations { "Debug", "Release" } configurations { "Debug", "Release" }
language "D" language "D"
@ -41,8 +42,8 @@
function suite.slnProj() function suite.slnProj()
project "MyProject" project "MyProject"
language "D" language "D"
premake.vstudio.sln2005.reorderProjects(wks) p.vstudio.sln2005.reorderProjects(wks)
premake.vstudio.sln2005.projects(wks) p.vstudio.sln2005.projects(wks)
test.capture [[ test.capture [[
Project("{002A2DE9-8BB6-484D-9802-7E4AD4084715}") = "MyProject", "MyProject.visualdproj", "{42B5DBC6-AE1F-903D-F75D-41E363076E92}" Project("{002A2DE9-8BB6-484D-9802-7E4AD4084715}") = "MyProject", "MyProject.visualdproj", "{42B5DBC6-AE1F-903D-F75D-41E363076E92}"
EndProject EndProject

View File

@ -6,9 +6,10 @@
local tdmd = {} local tdmd = {}
local project = premake.project local p = premake
local config = premake.config local project = p.project
local d = premake.modules.d local config = p.config
local d = p.modules.d
-- --
-- Set default tools -- Set default tools
@ -83,7 +84,7 @@
-- skip external project references, since I have no way -- skip external project references, since I have no way
-- to know the actual output target path -- to know the actual output target path
if not link.project.external then if not link.project.external then
if link.kind == premake.STATICLIB then if link.kind == p.STATICLIB then
-- Don't use "-l" flag when linking static libraries; instead use -- Don't use "-l" flag when linking static libraries; instead use
-- path/libname.a to avoid linking a shared library of the same -- path/libname.a to avoid linking a shared library of the same
-- name if one is present -- name if one is present
@ -166,7 +167,7 @@
-- to know the actual output target path -- to know the actual output target path
if not link.project.externalname then if not link.project.externalname then
local linkinfo = config.getlinkinfo(link) local linkinfo = config.getlinkinfo(link)
if link.kind == premake.STATICLIB then if link.kind == p.STATICLIB then
table.insert(result, project.getrelative(cfg.project, linkinfo.abspath)) table.insert(result, project.getrelative(cfg.project, linkinfo.abspath))
end end
end end
@ -177,7 +178,7 @@
for _, link in ipairs(links) do for _, link in ipairs(links) do
if path.isobjectfile(link) then if path.isobjectfile(link) then
table.insert(result, link) table.insert(result, link)
elseif path.hasextension(link, premake.systems[cfg.system].staticlib.extension) then elseif path.hasextension(link, p.systems[cfg.system].staticlib.extension) then
table.insert(result, link) table.insert(result, link)
end end
end end
@ -192,17 +193,17 @@
-- ///////////////////////////////////////////////////////////////////////// -- /////////////////////////////////////////////////////////////////////////
-- if we are compiling on windows, we need to specialise to OPTLINK as the linker -- if we are compiling on windows, we need to specialise to OPTLINK as the linker
-- OR!!! if cfg.system ~= premake.WINDOWS then -- OR!!! if cfg.system ~= p.WINDOWS then
if string.match( os.getversion().description, "Windows" ) ~= nil then if string.match( os.getversion().description, "Windows" ) ~= nil then
-- TODO: on windows, we may use OPTLINK or MSLINK (for Win64)... -- TODO: on windows, we may use OPTLINK or MSLINK (for Win64)...
-- printf("TODO: select proper linker for 32/64 bit code") -- printf("TODO: select proper linker for 32/64 bit code")
premake.tools.dmd = tdmd.optlink p.tools.dmd = tdmd.optlink
else else
premake.tools.dmd = tdmd.gcc p.tools.dmd = tdmd.gcc
end end
local dmd = premake.tools.dmd local dmd = p.tools.dmd
-- --
@ -265,18 +266,18 @@
if cfg.flags.Documentation then if cfg.flags.Documentation then
if cfg.docname then if cfg.docname then
table.insert(flags, "-Df" .. premake.quoted(cfg.docname)) table.insert(flags, "-Df" .. p.quoted(cfg.docname))
end end
if cfg.docdir then if cfg.docdir then
table.insert(flags, "-Dd" .. premake.quoted(cfg.docdir)) table.insert(flags, "-Dd" .. p.quoted(cfg.docdir))
end end
end end
if cfg.flags.GenerateHeader then if cfg.flags.GenerateHeader then
if cfg.headername then if cfg.headername then
table.insert(flags, "-Hf" .. premake.quoted(cfg.headername)) table.insert(flags, "-Hf" .. p.quoted(cfg.headername))
end end
if cfg.headerdir then if cfg.headerdir then
table.insert(flags, "-Hd" .. premake.quoted(cfg.headerdir)) table.insert(flags, "-Hd" .. p.quoted(cfg.headerdir))
end end
end end
@ -324,7 +325,7 @@
local result = {} local result = {}
for _, dir in ipairs(dirs) do for _, dir in ipairs(dirs) do
dir = project.getrelative(cfg.project, dir) dir = project.getrelative(cfg.project, dir)
table.insert(result, '-I' .. premake.quoted(dir)) table.insert(result, '-I' .. p.quoted(dir))
end end
return result return result
end end

View File

@ -4,12 +4,13 @@
-- Copyright (c) 2013-2015 Andrew Gough, Manu Evans, and the Premake project -- Copyright (c) 2013-2015 Andrew Gough, Manu Evans, and the Premake project
-- --
premake.tools.gdc = { } local p = premake
p.tools.gdc = { }
local gdc = premake.tools.gdc local gdc = p.tools.gdc
local project = premake.project local project = p.project
local config = premake.config local config = p.config
local d = premake.modules.d local d = p.modules.d
-- --
-- Set default tools -- Set default tools
@ -83,18 +84,18 @@
if cfg.flags.Documentation then if cfg.flags.Documentation then
if cfg.docname then if cfg.docname then
table.insert(flags, "-fdoc-file=" .. premake.quoted(cfg.docname)) table.insert(flags, "-fdoc-file=" .. p.quoted(cfg.docname))
end end
if cfg.docdir then if cfg.docdir then
table.insert(flags, "-fdoc-dir=" .. premake.quoted(cfg.docdir)) table.insert(flags, "-fdoc-dir=" .. p.quoted(cfg.docdir))
end end
end end
if cfg.flags.GenerateHeader then if cfg.flags.GenerateHeader then
if cfg.headername then if cfg.headername then
table.insert(flags, "-fintfc-file=" .. premake.quoted(cfg.headername)) table.insert(flags, "-fintfc-file=" .. p.quoted(cfg.headername))
end end
if cfg.headerdir then if cfg.headerdir then
table.insert(flags, "-fintfc-dir=" .. premake.quoted(cfg.headerdir)) table.insert(flags, "-fintfc-dir=" .. p.quoted(cfg.headerdir))
end end
end end
@ -142,7 +143,7 @@
local result = {} local result = {}
for _, dir in ipairs(dirs) do for _, dir in ipairs(dirs) do
dir = project.getrelative(cfg.project, dir) dir = project.getrelative(cfg.project, dir)
table.insert(result, '-I' .. premake.quoted(dir)) table.insert(result, '-I' .. p.quoted(dir))
end end
return result return result
end end
@ -168,14 +169,14 @@
}, },
kind = { kind = {
SharedLib = function(cfg) SharedLib = function(cfg)
local r = { iif(cfg.system == premake.MACOSX, "-dynamiclib", "-shared") } local r = { iif(cfg.system == p.MACOSX, "-dynamiclib", "-shared") }
if cfg.system == "windows" and not cfg.flags.NoImportLib then if cfg.system == "windows" and not cfg.flags.NoImportLib then
table.insert(r, '-Wl,--out-implib="' .. cfg.linktarget.relpath .. '"') table.insert(r, '-Wl,--out-implib="' .. cfg.linktarget.relpath .. '"')
end end
return r return r
end, end,
WindowedApp = function(cfg) WindowedApp = function(cfg)
if cfg.system == premake.WINDOWS then return "-mwindows" end if cfg.system == p.WINDOWS then return "-mwindows" end
end, end,
}, },
} }
@ -224,7 +225,7 @@
-- skip external project references, since I have no way -- skip external project references, since I have no way
-- to know the actual output target path -- to know the actual output target path
if not link.project.external then if not link.project.external then
if link.kind == premake.STATICLIB then if link.kind == p.STATICLIB then
-- Don't use "-l" flag when linking static libraries; instead use -- Don't use "-l" flag when linking static libraries; instead use
-- path/libname.a to avoid linking a shared library of the same -- path/libname.a to avoid linking a shared library of the same
-- name if one is present -- name if one is present

View File

@ -4,12 +4,13 @@
-- Copyright (c) 2013-2015 Andrew Gough, Manu Evans, and the Premake project -- Copyright (c) 2013-2015 Andrew Gough, Manu Evans, and the Premake project
-- --
premake.tools.ldc = { } local p = premake
p.tools.ldc = { }
local ldc = premake.tools.ldc local ldc = p.tools.ldc
local project = premake.project local project = p.project
local config = premake.config local config = p.config
local d = premake.modules.d local d = p.modules.d
-- --
@ -89,18 +90,18 @@
if cfg.flags.Documentation then if cfg.flags.Documentation then
if cfg.docname then if cfg.docname then
table.insert(flags, "-Df=" .. premake.quoted(cfg.docname)) table.insert(flags, "-Df=" .. p.quoted(cfg.docname))
end end
if cfg.docdir then if cfg.docdir then
table.insert(flags, "-Dd=" .. premake.quoted(cfg.docdir)) table.insert(flags, "-Dd=" .. p.quoted(cfg.docdir))
end end
end end
if cfg.flags.GenerateHeader then if cfg.flags.GenerateHeader then
if cfg.headername then if cfg.headername then
table.insert(flags, "-Hf=" .. premake.quoted(cfg.headername)) table.insert(flags, "-Hf=" .. p.quoted(cfg.headername))
end end
if cfg.headerdir then if cfg.headerdir then
table.insert(flags, "-Hd=" .. premake.quoted(cfg.headerdir)) table.insert(flags, "-Hd=" .. p.quoted(cfg.headerdir))
end end
end end
@ -148,7 +149,7 @@
local result = {} local result = {}
for _, dir in ipairs(dirs) do for _, dir in ipairs(dirs) do
dir = project.getrelative(cfg.project, dir) dir = project.getrelative(cfg.project, dir)
table.insert(result, '-I=' .. premake.quoted(dir)) table.insert(result, '-I=' .. p.quoted(dir))
end end
return result return result
end end
@ -222,7 +223,7 @@
-- skip external project references, since I have no way -- skip external project references, since I have no way
-- to know the actual output target path -- to know the actual output target path
if not link.project.external then if not link.project.external then
if link.kind == premake.STATICLIB then if link.kind == p.STATICLIB then
-- Don't use "-l" flag when linking static libraries; instead use -- Don't use "-l" flag when linking static libraries; instead use
-- path/libname.a to avoid linking a shared library of the same -- path/libname.a to avoid linking a shared library of the same
-- name if one is present -- name if one is present

View File

@ -1,5 +1,6 @@
premake.raw = { } local p = premake
local raw = premake.raw p.raw = { }
local raw = p.raw
local gvisited = { } local gvisited = { }
function raw.solution(sln) function raw.solution(sln)

View File

@ -16,10 +16,10 @@
function m.capture(expected) function m.capture(expected)
local actual = premake.captured() .. premake.eol() local actual = p.captured() .. p.eol()
-- create line-by-line iterators for both values -- create line-by-line iterators for both values
local ait = actual:gmatch("(.-)" .. premake.eol()) local ait = actual:gmatch("(.-)" .. p.eol())
local eit = expected:gmatch("(.-)\n") local eit = expected:gmatch("(.-)\n")
-- compare each value line by line -- compare each value line by line
@ -109,7 +109,7 @@
function m.hasoutput() function m.hasoutput()
local actual = premake.captured() local actual = p.captured()
if actual == "" then if actual == "" then
m.fail("expected output, received none"); m.fail("expected output, received none");
end end
@ -118,7 +118,7 @@
function m.isemptycapture() function m.isemptycapture()
local actual = premake.captured() local actual = p.captured()
if actual ~= "" then if actual ~= "" then
m.fail("expected empty capture, but was %s", actual); m.fail("expected empty capture, but was %s", actual);
end end

View File

@ -6,7 +6,8 @@
--- ---
local suite = test.declare("xcode_header") local suite = test.declare("xcode_header")
local xcode = premake.modules.xcode local p = premake
local xcode = p.modules.xcode
-- --

View File

@ -6,7 +6,8 @@
local suite = test.declare("xcode4_proj") local suite = test.declare("xcode4_proj")
local xcode = premake.modules.xcode local p = premake
local xcode = p.modules.xcode
-- --
@ -56,9 +57,9 @@
end end
local function prepare() local function prepare()
wks = premake.oven.bakeWorkspace(wks) wks = p.oven.bakeWorkspace(wks)
xcode.prepareWorkspace(wks) xcode.prepareWorkspace(wks)
local prj = premake.workspace.getproject(wks, 1) local prj = p.workspace.getproject(wks, 1)
tr = xcode.buildprjtree(prj) tr = xcode.buildprjtree(prj)
end end

View File

@ -7,7 +7,8 @@
--- ---
local suite = test.declare("xcode4_workspace") local suite = test.declare("xcode4_workspace")
local xcode = premake.modules.xcode local p = premake
local xcode = p.modules.xcode
-- --

View File

@ -5,7 +5,8 @@
-- --
local suite = test.declare("xcode_deps") local suite = test.declare("xcode_deps")
local xcode = premake.modules.xcode local p = premake
local xcode = p.modules.xcode
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
@ -35,9 +36,9 @@
end end
local function prepare() local function prepare()
wks = premake.oven.bakeWorkspace(wks) wks = p.oven.bakeWorkspace(wks)
xcode.prepareWorkspace(wks) xcode.prepareWorkspace(wks)
local prj3 = premake.workspace.getproject(wks, 1) local prj3 = p.workspace.getproject(wks, 1)
--prj2 = test.getproject(wks, 2) --prj2 = test.getproject(wks, 2)
tr = xcode.buildprjtree(prj3) tr = xcode.buildprjtree(prj3)
end end

View File

@ -4,7 +4,8 @@
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project -- Copyright (c) 2009-2011 Jason Perkins and the Premake project
-- --
local suite = test.declare("xcode_project") local suite = test.declare("xcode_project")
local xcode = premake.modules.xcode local p = premake
local xcode = p.modules.xcode
@ -21,13 +22,13 @@
function suite.setup() function suite.setup()
_TARGET_OS = "macosx" _TARGET_OS = "macosx"
_ACTION = "xcode4" _ACTION = "xcode4"
premake.eol("\n") p.eol("\n")
xcode.used_ids = { } -- reset the list of generated IDs xcode.used_ids = { } -- reset the list of generated IDs
wks = test.createWorkspace() wks = test.createWorkspace()
end end
local function prepare() local function prepare()
wks = premake.oven.bakeWorkspace(wks) wks = p.oven.bakeWorkspace(wks)
xcode.prepareWorkspace(wks) xcode.prepareWorkspace(wks)
local prj = test.getproject(wks, 1) local prj = test.getproject(wks, 1)
tr = xcode.buildprjtree(prj) tr = xcode.buildprjtree(prj)
@ -404,7 +405,7 @@
prepare() prepare()
xcode.PBXGroup(tr) xcode.PBXGroup(tr)
local str = premake.captured() local str = p.captured()
--test.istrue(str:find('path = "RequiresQuoting%+%+";')) --test.istrue(str:find('path = "RequiresQuoting%+%+";'))
end end
@ -2031,7 +2032,7 @@
function suite.defaultVisibility_settingIsFound() function suite.defaultVisibility_settingIsFound()
prepare() prepare()
xcode.XCBuildConfiguration(tr) xcode.XCBuildConfiguration(tr)
local str = premake.captured() local str = p.captured()
test.istrue(str:find('GCC_SYMBOLS_PRIVATE_EXTERN')) test.istrue(str:find('GCC_SYMBOLS_PRIVATE_EXTERN'))
end end
@ -2039,7 +2040,7 @@ end
function suite.defaultVisibilitySetting_setToNo() function suite.defaultVisibilitySetting_setToNo()
prepare() prepare()
xcode.XCBuildConfiguration(tr) xcode.XCBuildConfiguration(tr)
local str = premake.captured() local str = p.captured()
test.istrue(str:find('GCC_SYMBOLS_PRIVATE_EXTERN = NO;')) test.istrue(str:find('GCC_SYMBOLS_PRIVATE_EXTERN = NO;'))
end end
@ -2047,7 +2048,7 @@ function suite.releaseBuild_onlyDefaultArch_equalsNo()
optimize "On" optimize "On"
prepare() prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[2]) xcode.XCBuildConfiguration_Project(tr, tr.configs[2])
local str = premake.captured() local str = p.captured()
test.istrue(str:find('ONLY_ACTIVE_ARCH = NO;')) test.istrue(str:find('ONLY_ACTIVE_ARCH = NO;'))
end end
@ -2056,6 +2057,6 @@ function suite.debugBuild_onlyDefaultArch_equalsYes()
prepare() prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
local str = premake.captured() local str = p.captured()
test.istrue(str:find('ONLY_ACTIVE_ARCH = YES;')) test.istrue(str:find('ONLY_ACTIVE_ARCH = YES;'))
end end

View File

@ -38,7 +38,7 @@
function m.workspaceTail() function m.workspaceTail()
-- Don't output final newline. Xcode doesn't. -- Don't output final newline. Xcode doesn't.
premake.out('</Workspace>') p.out('</Workspace>')
end end

View File

@ -287,7 +287,7 @@
function xcode.getxcodeprojname(prj) function xcode.getxcodeprojname(prj)
-- if there is a workspace with matching name, then use "projectname1.xcodeproj" -- if there is a workspace with matching name, then use "projectname1.xcodeproj"
-- just get something working for now -- just get something working for now
local fname = premake.filename(prj, ".xcodeproj") local fname = p.filename(prj, ".xcodeproj")
return fname return fname
end end
@ -336,7 +336,7 @@
-- create and cache a list of supported platforms -- create and cache a list of supported platforms
wks.xcode = { } wks.xcode = { }
for prj in premake.workspace.eachproject(wks) do for prj in p.workspace.eachproject(wks) do
-- need a configuration to get the target information -- need a configuration to get the target information
local cfg = project.getconfig(prj, prj.configurations[1], prj.platforms[1]) local cfg = project.getconfig(prj, prj.configurations[1], prj.platforms[1])
@ -346,7 +346,7 @@
bundlepath = cfg.project.name bundlepath = cfg.project.name
end end
local node = premake.tree.new(path.getname(bundlepath)) local node = p.tree.new(path.getname(bundlepath))
node.cfg = cfg node.cfg = cfg
node.id = xcode.newid(node.name, "product") node.id = xcode.newid(node.name, "product")
@ -1065,13 +1065,13 @@
local includedirs = project.getrelative(cfg.project, cfg.includedirs) local includedirs = project.getrelative(cfg.project, cfg.includedirs)
for i,v in ipairs(includedirs) do for i,v in ipairs(includedirs) do
cfg.includedirs[i] = premake.quoted(v) cfg.includedirs[i] = p.quoted(v)
end end
settings['USER_HEADER_SEARCH_PATHS'] = cfg.includedirs settings['USER_HEADER_SEARCH_PATHS'] = cfg.includedirs
local sysincludedirs = project.getrelative(cfg.project, cfg.sysincludedirs) local sysincludedirs = project.getrelative(cfg.project, cfg.sysincludedirs)
for i,v in ipairs(sysincludedirs) do for i,v in ipairs(sysincludedirs) do
cfg.sysincludedirs[i] = premake.quoted(v) cfg.sysincludedirs[i] = p.quoted(v)
end end
if not table.isempty(cfg.sysincludedirs) then if not table.isempty(cfg.sysincludedirs) then
table.insert(cfg.sysincludedirs, "$(inherited)") table.insert(cfg.sysincludedirs, "$(inherited)")
@ -1079,19 +1079,19 @@
settings['HEADER_SEARCH_PATHS'] = cfg.sysincludedirs settings['HEADER_SEARCH_PATHS'] = cfg.sysincludedirs
for i,v in ipairs(cfg.libdirs) do for i,v in ipairs(cfg.libdirs) do
cfg.libdirs[i] = premake.project.getrelative(cfg.project, cfg.libdirs[i]) cfg.libdirs[i] = p.project.getrelative(cfg.project, cfg.libdirs[i])
end end
settings['LIBRARY_SEARCH_PATHS'] = cfg.libdirs settings['LIBRARY_SEARCH_PATHS'] = cfg.libdirs
for i,v in ipairs(cfg.frameworkdirs) do for i,v in ipairs(cfg.frameworkdirs) do
cfg.frameworkdirs[i] = premake.project.getrelative(cfg.project, cfg.frameworkdirs[i]) cfg.frameworkdirs[i] = p.project.getrelative(cfg.project, cfg.frameworkdirs[i])
end end
settings['FRAMEWORK_SEARCH_PATHS'] = cfg.frameworkdirs settings['FRAMEWORK_SEARCH_PATHS'] = cfg.frameworkdirs
local objDir = path.getrelative(tr.project.location, cfg.objdir) local objDir = path.getrelative(tr.project.location, cfg.objdir)
settings['OBJROOT'] = objDir settings['OBJROOT'] = objDir
settings['ONLY_ACTIVE_ARCH'] = iif(premake.config.isDebugBuild(cfg), 'YES', 'NO') settings['ONLY_ACTIVE_ARCH'] = iif(p.config.isDebugBuild(cfg), 'YES', 'NO')
-- build list of "other" C/C++ flags -- build list of "other" C/C++ flags
local checks = { local checks = {

View File

@ -145,7 +145,7 @@
xcnode.targetdependid = xcode.newid(xcnode.name, "targdep") xcnode.targetdependid = xcode.newid(xcnode.name, "targdep")
-- create a grandchild node for the dependency's link target -- create a grandchild node for the dependency's link target
local lprj = premake.workspace.findproject(prj.workspace, dep.name) local lprj = p.workspace.findproject(prj.workspace, dep.name)
local cfg = project.findClosestMatch(lprj, prj.configurations[1]) local cfg = project.findClosestMatch(lprj, prj.configurations[1])
node = tree.insert(xcnode, tree.new(cfg.linktarget.name)) node = tree.insert(xcnode, tree.new(cfg.linktarget.name))
node.path = cfg.linktarget.fullpath node.path = cfg.linktarget.fullpath

View File

@ -96,7 +96,7 @@
function m.prepareEnvironment() function m.prepareEnvironment()
math.randomseed(os.time()) math.randomseed(os.time())
_PREMAKE_DIR = path.getdirectory(_PREMAKE_COMMAND) _PREMAKE_DIR = path.getdirectory(_PREMAKE_COMMAND)
premake.path = premake.path .. ";" .. _PREMAKE_DIR .. ";" .. _MAIN_SCRIPT_DIR p.path = p.path .. ";" .. _PREMAKE_DIR .. ";" .. _MAIN_SCRIPT_DIR
end end
@ -171,14 +171,14 @@
-- The "next-gen" actions have now replaced their deprecated counterparts. -- The "next-gen" actions have now replaced their deprecated counterparts.
-- Provide a warning for a little while before I remove them entirely. -- Provide a warning for a little while before I remove them entirely.
if _ACTION and _ACTION:endswith("ng") then if _ACTION and _ACTION:endswith("ng") then
premake.warnOnce(_ACTION, "'%s' has been deprecated; use '%s' instead", _ACTION, _ACTION:sub(1, -3)) p.warnOnce(_ACTION, "'%s' has been deprecated; use '%s' instead", _ACTION, _ACTION:sub(1, -3))
end end
premake.action.set(_ACTION) p.action.set(_ACTION)
-- Allow the action to initialize stuff. -- Allow the action to initialize stuff.
local action = premake.action.current() local action = p.action.current()
if action then if action then
premake.action.initialize(action.trigger) p.action.initialize(action.trigger)
end end
end end
@ -218,13 +218,13 @@
end end
if (_OPTIONS["help"]) then if (_OPTIONS["help"]) then
premake.showhelp() p.showhelp()
os.exit(1) os.exit(1)
end end
-- Validate the command-line arguments. This has to happen after the -- Validate the command-line arguments. This has to happen after the
-- script has run to allow for project-specific options -- script has run to allow for project-specific options
ok, err = premake.option.validate(_OPTIONS) ok, err = p.option.validate(_OPTIONS)
if not ok then if not ok then
print("Error: " .. err) print("Error: " .. err)
os.exit(1) os.exit(1)
@ -237,7 +237,7 @@
os.exit(1) os.exit(1)
end end
local action = premake.action.current() local action = p.action.current()
if not action then if not action then
print("Error: no such action '" .. _ACTION .. "'") print("Error: no such action '" .. _ACTION .. "'")
os.exit(1) os.exit(1)
@ -268,7 +268,7 @@
function m.bake() function m.bake()
if p.action.isConfigurable() then if p.action.isConfigurable() then
premake.oven.bake() p.oven.bake()
end end
end end
@ -317,7 +317,7 @@
--- ---
function m.preAction() function m.preAction()
local action = premake.action.current() local action = p.action.current()
printf("Running action '%s'...", action.trigger) printf("Running action '%s'...", action.trigger)
end end
@ -327,8 +327,8 @@
--- ---
function m.callAction() function m.callAction()
local action = premake.action.current() local action = p.action.current()
premake.action.call(action.trigger) p.action.call(action.trigger)
end end

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2002-2015 Jason Perkins and the Premake project -- Copyright (c) 2002-2015 Jason Perkins and the Premake project
-- --
premake.make = {}
local p = premake local p = premake
p.make = {}
local make = p.make local make = p.make
local project = p.project local project = p.project
@ -34,32 +34,32 @@
end, end,
onWorkspace = function(wks) onWorkspace = function(wks)
premake.escaper(make.esc) p.escaper(make.esc)
premake.generate(wks, make.getmakefilename(wks, false), make.generate_workspace) p.generate(wks, make.getmakefilename(wks, false), make.generate_workspace)
end, end,
onProject = function(prj) onProject = function(prj)
premake.escaper(make.esc) p.escaper(make.esc)
local makefile = make.getmakefilename(prj, true) local makefile = make.getmakefilename(prj, true)
if prj.kind == premake.UTILITY then if prj.kind == p.UTILITY then
premake.generate(prj, makefile, make.utility.generate) p.generate(prj, makefile, make.utility.generate)
elseif prj.kind == premake.MAKEFILE then elseif prj.kind == p.MAKEFILE then
premake.generate(prj, makefile, make.makefile.generate) p.generate(prj, makefile, make.makefile.generate)
else else
if project.isdotnet(prj) then if project.isdotnet(prj) then
premake.generate(prj, makefile, make.cs.generate) p.generate(prj, makefile, make.cs.generate)
elseif project.isc(prj) or project.iscpp(prj) then elseif project.isc(prj) or project.iscpp(prj) then
premake.generate(prj, makefile, make.cpp.generate) p.generate(prj, makefile, make.cpp.generate)
end end
end end
end, end,
onCleanWorkspace = function(wks) onCleanWorkspace = function(wks)
premake.clean.file(wks, make.getmakefilename(wks, false)) p.clean.file(wks, make.getmakefilename(wks, false))
end, end,
onCleanProject = function(prj) onCleanProject = function(prj)
premake.clean.file(prj, make.getmakefilename(prj, true)) p.clean.file(prj, make.getmakefilename(prj, true))
end end
} }
@ -144,7 +144,7 @@
function make.header(target) function make.header(target)
local kind = iif(target.project, "project", "workspace") local kind = iif(target.project, "project", "workspace")
_p('# %s %s makefile autogenerated by Premake', premake.action.current().shortname, kind) _p('# %s %s makefile autogenerated by Premake', p.action.current().shortname, kind)
_p('') _p('')
if kind == "workspace" then if kind == "workspace" then
@ -205,7 +205,7 @@
if #result then if #result then
result = result .. " " result = result .. " "
end end
result = result .. premake.quoted(v) result = result .. p.quoted(v)
end end
return result return result
else else
@ -236,7 +236,7 @@
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
function make.objdir(cfg) function make.objdir(cfg)
_x(' OBJDIR = %s', premake.esc(project.getrelative(cfg.project, cfg.objdir))) _x(' OBJDIR = %s', p.esc(project.getrelative(cfg.project, cfg.objdir)))
end end

View File

@ -16,7 +16,7 @@
--- ---
-- Add namespace for element definition lists for premake.callarray() -- Add namespace for element definition lists for p.callarray()
--- ---
cpp.elements = {} cpp.elements = {}
@ -44,8 +44,8 @@
end end
function make.cpp.generate(prj) function make.cpp.generate(prj)
premake.eol("\n") p.eol("\n")
premake.callArray(cpp.elements.makefile, prj) p.callArray(cpp.elements.makefile, prj)
end end
@ -84,13 +84,13 @@
-- identify the toolset used by this configurations (would be nicer if -- identify the toolset used by this configurations (would be nicer if
-- this were computed and stored with the configuration up front) -- this were computed and stored with the configuration up front)
local toolset = premake.tools[_OPTIONS.cc or cfg.toolset or "gcc"] local toolset = p.tools[_OPTIONS.cc or cfg.toolset or "gcc"]
if not toolset then if not toolset then
error("Invalid toolset '" .. cfg.toolset .. "'") error("Invalid toolset '" .. cfg.toolset .. "'")
end end
_x('ifeq ($(config),%s)', cfg.shortname) _x('ifeq ($(config),%s)', cfg.shortname)
premake.callArray(cpp.elements.configuration, cfg, toolset) p.callArray(cpp.elements.configuration, cfg, toolset)
_p('endif') _p('endif')
_p('') _p('')
end end
@ -122,7 +122,7 @@
function make.cppFileRules(prj) function make.cppFileRules(prj)
local tr = project.getsourcetree(prj) local tr = project.getsourcetree(prj)
premake.tree.traverse(tr, { p.tree.traverse(tr, {
onleaf = function(node, depth) onleaf = function(node, depth)
-- check to see if this file has custom rules -- check to see if this file has custom rules
local rules local rules
@ -207,7 +207,7 @@
-- now walk the list of files in the project -- now walk the list of files in the project
local tr = project.getsourcetree(prj) local tr = project.getsourcetree(prj)
premake.tree.traverse(tr, { p.tree.traverse(tr, {
onleaf = function(node, depth) onleaf = function(node, depth)
-- figure out what configurations contain this file, and -- figure out what configurations contain this file, and
-- if it uses custom build rules -- if it uses custom build rules
@ -316,7 +316,7 @@
function make.cppAllRules(cfg, toolset) function make.cppAllRules(cfg, toolset)
if cfg.system == premake.MACOSX and cfg.kind == premake.WINDOWEDAPP then if cfg.system == p.MACOSX and cfg.kind == p.WINDOWEDAPP then
_p('all: prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist') _p('all: prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')
_p('\t@:') _p('\t@:')
_p('') _p('')
@ -423,7 +423,7 @@
function make.ldDeps(cfg, toolset) function make.ldDeps(cfg, toolset)
local deps = config.getlinks(cfg, "siblings", "fullpath") local deps = config.getlinks(cfg, "siblings", "fullpath")
_p(' LDDEPS +=%s', make.list(premake.esc(deps))) _p(' LDDEPS +=%s', make.list(p.esc(deps)))
end end
@ -440,13 +440,13 @@
function make.linkCmd(cfg, toolset) function make.linkCmd(cfg, toolset)
if cfg.kind == premake.STATICLIB then if cfg.kind == p.STATICLIB then
if cfg.architecture == premake.UNIVERSAL then if cfg.architecture == p.UNIVERSAL then
_p(' LINKCMD = libtool -o "$@" $(OBJECTS)') _p(' LINKCMD = libtool -o "$@" $(OBJECTS)')
else else
_p(' LINKCMD = $(AR) ' .. (toolset.arargs or '-rcs') ..' "$@" $(OBJECTS)') _p(' LINKCMD = $(AR) ' .. (toolset.arargs or '-rcs') ..' "$@" $(OBJECTS)')
end end
elseif cfg.kind == premake.UTILITY then elseif cfg.kind == p.UTILITY then
-- Empty LINKCMD for Utility (only custom build rules) -- Empty LINKCMD for Utility (only custom build rules)
_p(' LINKCMD =') _p(' LINKCMD =')
else else

View File

@ -4,16 +4,17 @@
-- Copyright (c) 2002-2013 Jason Perkins and the Premake project -- Copyright (c) 2002-2013 Jason Perkins and the Premake project
-- --
premake.make.cs = {} local p = premake
local make = premake.make p.make.cs = {}
local cs = premake.make.cs local make = p.make
local project = premake.project local cs = p.make.cs
local config = premake.config local project = p.project
local fileconfig = premake.fileconfig local config = p.config
local fileconfig = p.fileconfig
-- --
-- Add namespace for element definition lists for premake.callarray() -- Add namespace for element definition lists for p.callarray()
-- --
cs.elements = {} cs.elements = {}
@ -52,9 +53,9 @@
-- --
function make.cs.generate(prj) function make.cs.generate(prj)
premake.eol("\n") p.eol("\n")
local toolset = premake.tools.dotnet local toolset = p.tools.dotnet
premake.callArray(cs.elements.makefile, prj, toolset) p.callArray(cs.elements.makefile, prj, toolset)
end end
@ -79,7 +80,7 @@
function make.csConfigs(prj, toolset) function make.csConfigs(prj, toolset)
for cfg in project.eachconfig(prj) do for cfg in project.eachconfig(prj) do
_x('ifeq ($(config),%s)', cfg.shortname) _x('ifeq ($(config),%s)', cfg.shortname)
premake.callArray(cs.elements.configuration, cfg, toolset) p.callArray(cs.elements.configuration, cfg, toolset)
_p('endif') _p('endif')
_p('') _p('')
end end
@ -98,7 +99,7 @@
if dir ~= "." then if dir ~= "." then
name = name .. path.translate(dir, ".") .. "." name = name .. path.translate(dir, ".") .. "."
end end
return "$(OBJDIR)/" .. premake.esc(name .. path.getbasename(fname)) .. ".resources" return "$(OBJDIR)/" .. p.esc(name .. path.getbasename(fname)) .. ".resources"
else else
return fname return fname
end end
@ -111,7 +112,7 @@
function cs.listsources(prj, selector) function cs.listsources(prj, selector)
local tr = project.getsourcetree(prj) local tr = project.getsourcetree(prj)
premake.tree.traverse(tr, { p.tree.traverse(tr, {
onleaf = function(node, depth) onleaf = function(node, depth)
local value = selector(node) local value = selector(node)
if value then if value then
@ -186,9 +187,9 @@
function make.csResponseRules(prj) function make.csResponseRules(prj)
local toolset = premake.tools.dotnet local toolset = p.tools.dotnet
local ext = make.getmakefilename(prj, true) local ext = make.getmakefilename(prj, true)
local makefile = path.getname(premake.filename(prj, ext)) local makefile = path.getname(p.filename(prj, ext))
local response = make.cs.getresponsefilename(prj) local response = make.cs.getresponsefilename(prj)
_p('$(RESPONSE): %s', makefile) _p('$(RESPONSE): %s', makefile)
@ -202,7 +203,7 @@
local sep = os.istarget("windows") and "\\" or "/" local sep = os.istarget("windows") and "\\" or "/"
local tr = project.getsourcetree(prj) local tr = project.getsourcetree(prj)
premake.tree.traverse(tr, { p.tree.traverse(tr, {
onleaf = function(node, depth) onleaf = function(node, depth)
if toolset.fileinfo(node).action == "Compile" then if toolset.fileinfo(node).action == "Compile" then
_x('\t@echo %s >> $(RESPONSE)', path.translate(node.relpath, sep)) _x('\t@echo %s >> $(RESPONSE)', path.translate(node.relpath, sep))
@ -232,10 +233,10 @@
--[[ --[[
-- porting from 4.x -- porting from 4.x
_p('# Per-configuration copied file rules') _p('# Per-configuration copied file rules')
for cfg in premake.eachconfig(prj) do for cfg in p.eachconfig(prj) do
_x('ifneq (,$(findstring %s,$(config)))', cfg.name:lower()) _x('ifneq (,$(findstring %s,$(config)))', cfg.name:lower())
for target, source in pairs(cfgpairs[cfg]) do for target, source in pairs(cfgpairs[cfg]) do
premake.make_copyrule(source, target) p.make_copyrule(source, target)
end end
_p('endif') _p('endif')
_p('') _p('')
@ -243,7 +244,7 @@
_p('# Copied file rules') _p('# Copied file rules')
for target, source in pairs(copypairs) do for target, source in pairs(copypairs) do
premake.make_copyrule(source, target) p.make_copyrule(source, target)
end end
_p('# Embedded file rules') _p('# Embedded file rules')
@ -264,7 +265,7 @@
function make.csLinkCmd(cfg, toolset) function make.csLinkCmd(cfg, toolset)
local deps = premake.esc(config.getlinks(cfg, "dependencies", "fullpath")) local deps = p.esc(config.getlinks(cfg, "dependencies", "fullpath"))
_p(' DEPENDS =%s', make.list(deps)) _p(' DEPENDS =%s', make.list(deps))
_p(' REFERENCES = %s', table.implode(deps, "/r:", "", " ")) _p(' REFERENCES = %s', table.implode(deps, "/r:", "", " "))
end end
@ -276,10 +277,10 @@
local cfg = project.getfirstconfig(prj) local cfg = project.getfirstconfig(prj)
local kindflag = "/t:" .. toolset.getkind(cfg):lower() local kindflag = "/t:" .. toolset.getkind(cfg):lower()
local libdirs = table.implode(premake.esc(cfg.libdirs), "/lib:", "", " ") local libdirs = table.implode(p.esc(cfg.libdirs), "/lib:", "", " ")
_p('FLAGS += %s', table.concat(table.join(kindflag, libdirs), " ")) _p('FLAGS += %s', table.concat(table.join(kindflag, libdirs), " "))
local refs = premake.esc(config.getlinks(cfg, "system", "fullpath")) local refs = p.esc(config.getlinks(cfg, "system", "fullpath"))
_p('REFERENCES += %s', table.implode(refs, "/r:", "", " ")) _p('REFERENCES += %s', table.implode(refs, "/r:", "", " "))
_p('') _p('')
end end

View File

@ -14,7 +14,7 @@
local fileconfig = p.fileconfig local fileconfig = p.fileconfig
--- ---
-- Add namespace for element definition lists for premake.callarray() -- Add namespace for element definition lists for p.callarray()
--- ---
makefile.elements = {} makefile.elements = {}
@ -30,8 +30,8 @@
} }
function make.makefile.generate(prj) function make.makefile.generate(prj)
premake.eol("\n") p.eol("\n")
premake.callarray(make, makefile.elements.makefile, prj) p.callarray(make, makefile.elements.makefile, prj)
end end
@ -46,13 +46,13 @@
-- identify the toolset used by this configurations (would be nicer if -- identify the toolset used by this configurations (would be nicer if
-- this were computed and stored with the configuration up front) -- this were computed and stored with the configuration up front)
local toolset = premake.tools[cfg.toolset or "gcc"] local toolset = p.tools[cfg.toolset or "gcc"]
if not toolset then if not toolset then
error("Invalid toolset '" .. cfg.toolset .. "'") error("Invalid toolset '" .. cfg.toolset .. "'")
end end
_x('ifeq ($(config),%s)', cfg.shortname) _x('ifeq ($(config),%s)', cfg.shortname)
premake.callarray(make, makefile.elements.configuration, cfg, toolset) p.callarray(make, makefile.elements.configuration, cfg, toolset)
_p('endif') _p('endif')
_p('') _p('')
end end

View File

@ -14,7 +14,7 @@
local fileconfig = p.fileconfig local fileconfig = p.fileconfig
--- ---
-- Add namespace for element definition lists for premake.callarray() -- Add namespace for element definition lists for p.callarray()
--- ---
utility.elements = {} utility.elements = {}
@ -30,8 +30,8 @@
} }
function make.utility.generate(prj) function make.utility.generate(prj)
premake.eol("\n") p.eol("\n")
premake.callarray(make, utility.elements.makefile, prj) p.callarray(make, utility.elements.makefile, prj)
end end
@ -46,13 +46,13 @@
-- identify the toolset used by this configurations (would be nicer if -- identify the toolset used by this configurations (would be nicer if
-- this were computed and stored with the configuration up front) -- this were computed and stored with the configuration up front)
local toolset = premake.tools[cfg.toolset or "gcc"] local toolset = p.tools[cfg.toolset or "gcc"]
if not toolset then if not toolset then
error("Invalid toolset '" .. cfg.toolset .. "'") error("Invalid toolset '" .. cfg.toolset .. "'")
end end
_x('ifeq ($(config),%s)', cfg.shortname) _x('ifeq ($(config),%s)', cfg.shortname)
premake.callarray(make, utility.elements.configuration, cfg, toolset) p.callarray(make, utility.elements.configuration, cfg, toolset)
_p('endif') _p('endif')
_p('') _p('')
end end

View File

@ -58,7 +58,7 @@
function make.cleanrules(wks) function make.cleanrules(wks)
_p('clean:') _p('clean:')
for prj in p.workspace.eachproject(wks) do for prj in p.workspace.eachproject(wks) do
local prjpath = premake.filename(prj, make.getmakefilename(prj, true)) local prjpath = p.filename(prj, make.getmakefilename(prj, true))
local prjdir = path.getdirectory(path.getrelative(wks.location, prjpath)) local prjdir = path.getdirectory(path.getrelative(wks.location, prjpath))
local prjname = path.getname(prjpath) local prjname = path.getname(prjpath)
_x(1,'@${MAKE} --no-print-directory -C %s -f %s clean', prjdir, prjname) _x(1,'@${MAKE} --no-print-directory -C %s -f %s clean', prjdir, prjname)
@ -101,7 +101,7 @@
-- --
function make.projects(wks) function make.projects(wks)
_p('PROJECTS := %s', table.concat(premake.esc(table.extract(wks.projects, "name")), " ")) _p('PROJECTS := %s', table.concat(p.esc(table.extract(wks.projects, "name")), " "))
_p('') _p('')
end end
@ -167,14 +167,14 @@
for prj in p.workspace.eachproject(wks) do for prj in p.workspace.eachproject(wks) do
local deps = project.getdependencies(prj) local deps = project.getdependencies(prj)
deps = table.extract(deps, "name") deps = table.extract(deps, "name")
_p('%s:%s', premake.esc(prj.name), make.list(deps)) _p('%s:%s', p.esc(prj.name), make.list(deps))
local cfgvar = make.tovar(prj.name) local cfgvar = make.tovar(prj.name)
_p('ifneq (,$(%s_config))', cfgvar) _p('ifneq (,$(%s_config))', cfgvar)
_p(1,'@echo "==== Building %s ($(%s_config)) ===="', prj.name, cfgvar) _p(1,'@echo "==== Building %s ($(%s_config)) ===="', prj.name, cfgvar)
local prjpath = premake.filename(prj, make.getmakefilename(prj, true)) local prjpath = p.filename(prj, make.getmakefilename(prj, true))
local prjdir = path.getdirectory(path.getrelative(wks.location, prjpath)) local prjdir = path.getdirectory(path.getrelative(wks.location, prjpath))
local prjname = path.getname(prjpath) local prjname = path.getname(prjpath)

View File

@ -4,10 +4,10 @@
-- Copyright (c) 2008-2013 Jason Perkins and the Premake project -- Copyright (c) 2008-2013 Jason Perkins and the Premake project
-- --
premake.vstudio = {}
local vstudio = premake.vstudio
local p = premake local p = premake
p.vstudio = {}
local vstudio = p.vstudio
local project = p.project local project = p.project
local config = p.config local config = p.config
@ -294,8 +294,8 @@
-- --
function vstudio.archFromPlatform(platform) function vstudio.archFromPlatform(platform)
local system = premake.api.checkValue(premake.fields.system, platform) local system = p.api.checkValue(p.fields.system, platform)
local arch = premake.api.checkValue(premake.fields.architecture, platform) local arch = p.api.checkValue(p.fields.architecture, platform)
return architecture(system, arch or platform:lower()) return architecture(system, arch or platform:lower())
end end
@ -308,7 +308,7 @@
if locale then if locale then
local culture = vstudio._cultures[locale] local culture = vstudio._cultures[locale]
if not culture then if not culture then
premake.warnOnce("Locale" .. locale, 'Unsupported locale "%s"', locale) p.warnOnce("Locale" .. locale, 'Unsupported locale "%s"', locale)
end end
return culture return culture
end end
@ -341,7 +341,7 @@
-- --
function vstudio.isMakefile(cfg) function vstudio.isMakefile(cfg)
return (cfg.kind == premake.MAKEFILE or cfg.kind == premake.NONE) return (cfg.kind == p.MAKEFILE or cfg.kind == p.NONE)
end end
@ -443,7 +443,7 @@
extension = iif(_ACTION > "vs2008", ".vcxproj", ".vcproj") extension = iif(_ACTION > "vs2008", ".vcxproj", ".vcproj")
end end
return premake.filename(prj, extension) return p.filename(prj, extension)
end end

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2008-2015 Jason Perkins and the Premake project -- Copyright (c) 2008-2015 Jason Perkins and the Premake project
-- --
premake.vstudio.vs2005 = {}
local p = premake local p = premake
p.vstudio.vs2005 = {}
local vs2005 = p.vstudio.vs2005 local vs2005 = p.vstudio.vs2005
local vstudio = p.vstudio local vstudio = p.vstudio
@ -20,7 +20,7 @@
p.eol("\r\n") p.eol("\r\n")
p.escaper(vs2005.esc) p.escaper(vs2005.esc)
premake.generate(wks, ".sln", vstudio.sln2005.generate) p.generate(wks, ".sln", vstudio.sln2005.generate)
end end
@ -29,8 +29,8 @@
p.eol("\r\n") p.eol("\r\n")
p.escaper(vs2005.esc) p.escaper(vs2005.esc)
if premake.project.isdotnet(prj) then if p.project.isdotnet(prj) then
premake.generate(prj, ".csproj", vstudio.cs2005.generate) p.generate(prj, ".csproj", vstudio.cs2005.generate)
-- Skip generation of empty user files -- Skip generation of empty user files
local user = p.capture(function() vstudio.cs2005.generateUser(prj) end) local user = p.capture(function() vstudio.cs2005.generateUser(prj) end)
@ -38,7 +38,7 @@
p.generate(prj, ".csproj.user", function() p.outln(user) end) p.generate(prj, ".csproj.user", function() p.outln(user) end)
end end
else else
premake.generate(prj, ".vcproj", vstudio.vc200x.generate) p.generate(prj, ".vcproj", vstudio.vc200x.generate)
-- Skip generation of empty user files -- Skip generation of empty user files
local user = p.capture(function() vstudio.vc200x.generateUser(prj) end) local user = p.capture(function() vstudio.vc200x.generateUser(prj) end)

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2009-2014 Jason Perkins and the Premake project -- Copyright (c) 2009-2014 Jason Perkins and the Premake project
-- --
premake.vstudio.cs2005 = {}
local p = premake local p = premake
p.vstudio.cs2005 = {}
local vstudio = p.vstudio local vstudio = p.vstudio
local cs2005 = p.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
local project = p.project local project = p.project
@ -35,7 +35,7 @@
function cs2005.generate(prj) function cs2005.generate(prj)
p.utf8() p.utf8()
premake.callarray(cs2005, cs2005.elements.project, prj) p.callarray(cs2005, cs2005.elements.project, prj)
_p(1,'<ItemGroup>') _p(1,'<ItemGroup>')
cs2005.files(prj) cs2005.files(prj)
@ -55,7 +55,7 @@
function cs2005.projectElement(prj) function cs2005.projectElement(prj)
local ver = '' local ver = ''
local action = premake.action.current() local action = p.action.current()
if action.vstudio.toolsVersion then if action.vstudio.toolsVersion then
ver = string.format(' ToolsVersion="%s"', action.vstudio.toolsVersion) ver = string.format(' ToolsVersion="%s"', action.vstudio.toolsVersion)
end end
@ -86,7 +86,7 @@
function cs2005.projectProperties(prj) function cs2005.projectProperties(prj)
_p(1,'<PropertyGroup>') _p(1,'<PropertyGroup>')
local cfg = project.getfirstconfig(prj) local cfg = project.getfirstconfig(prj)
premake.callarray(cs2005, cs2005.elements.projectProperties, cfg) p.callarray(cs2005, cs2005.elements.projectProperties, cfg)
_p(1,'</PropertyGroup>') _p(1,'</PropertyGroup>')
end end
@ -109,7 +109,7 @@
end end
function cs2005.configuration(cfg) function cs2005.configuration(cfg)
premake.callarray(cs2005, cs2005.elements.configuration, cfg) p.callarray(cs2005, cs2005.elements.configuration, cfg)
_p(1,'</PropertyGroup>') _p(1,'</PropertyGroup>')
end end
@ -142,7 +142,7 @@
-- Process any sub-elements required by this file; choose the write -- Process any sub-elements required by this file; choose the write
-- element form to use based on the results. -- element form to use based on the results.
local contents = premake.capture(function () local contents = p.capture(function ()
-- Try to write file-level elements in the same order as Visual Studio -- Try to write file-level elements in the same order as Visual Studio
local elements = { local elements = {
"AutoGen", "AutoGen",
@ -190,7 +190,7 @@
local firstcfg = project.getfirstconfig(prj) local firstcfg = project.getfirstconfig(prj)
local tr = project.getsourcetree(prj) local tr = project.getsourcetree(prj)
premake.tree.traverse(tr, { p.tree.traverse(tr, {
onleaf = function(node, depth) onleaf = function(node, depth)
-- test if all fileinfo's are going to be the same for each config. -- test if all fileinfo's are going to be the same for each config.
local allsame = true local allsame = true
@ -373,7 +373,7 @@
local packageAPIInfo = vstudio.nuget2010.packageAPIInfo(prj, package) local packageAPIInfo = vstudio.nuget2010.packageAPIInfo(prj, package)
local cfg = p.project.getfirstconfig(prj) local cfg = p.project.getfirstconfig(prj)
local action = premake.action.current() local action = p.action.current()
local targetFramework = cfg.dotnetframework or action.vstudio.targetFramework local targetFramework = cfg.dotnetframework or action.vstudio.targetFramework
-- This is a bit janky. To compare versions, we extract all -- This is a bit janky. To compare versions, we extract all
@ -601,7 +601,7 @@
function cs2005.productVersion(cfg) function cs2005.productVersion(cfg)
local action = premake.action.current() local action = p.action.current()
if action.vstudio.productVersion then if action.vstudio.productVersion then
_p(2,'<ProductVersion>%s</ProductVersion>', action.vstudio.productVersion) _p(2,'<ProductVersion>%s</ProductVersion>', action.vstudio.productVersion)
end end
@ -625,7 +625,7 @@
function cs2005.schemaVersion(cfg) function cs2005.schemaVersion(cfg)
local action = premake.action.current() local action = p.action.current()
if action.vstudio.csprojSchemaVersion then if action.vstudio.csprojSchemaVersion then
_p(2,'<SchemaVersion>%s</SchemaVersion>', action.vstudio.csprojSchemaVersion) _p(2,'<SchemaVersion>%s</SchemaVersion>', action.vstudio.csprojSchemaVersion)
end end
@ -633,7 +633,7 @@
function cs2005.targetFrameworkVersion(cfg) function cs2005.targetFrameworkVersion(cfg)
local action = premake.action.current() local action = p.action.current()
local framework = cfg.dotnetframework or action.vstudio.targetFramework local framework = cfg.dotnetframework or action.vstudio.targetFramework
if framework then if framework then
_p(2,'<TargetFrameworkVersion>v%s</TargetFrameworkVersion>', framework) _p(2,'<TargetFrameworkVersion>v%s</TargetFrameworkVersion>', framework)

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2009-2015 Jason Perkins and the Premake project -- Copyright (c) 2009-2015 Jason Perkins and the Premake project
-- --
premake.vstudio.sln2005 = {}
local p = premake local p = premake
p.vstudio.sln2005 = {}
local vstudio = p.vstudio local vstudio = p.vstudio
local sln2005 = p.vstudio.sln2005 local sln2005 = p.vstudio.sln2005
local project = p.project local project = p.project
@ -14,7 +14,7 @@
--- ---
-- Add namespace for element definition lists for premake.callArray() -- Add namespace for element definition lists for p.callArray()
--- ---
sln2005.elements = {} sln2005.elements = {}
@ -41,8 +41,8 @@
function sln2005.generate(wks) function sln2005.generate(wks)
-- Mark the file as Unicode -- Mark the file as Unicode
premake.utf8() p.utf8()
premake.outln('') p.outln('')
sln2005.reorderProjects(wks) sln2005.reorderProjects(wks)
@ -62,7 +62,7 @@
-- --
function sln2005.header() function sln2005.header()
local action = premake.action.current() local action = p.action.current()
p.w('Microsoft Visual Studio Solution File, Format Version %d.00', action.vstudio.solutionVersion) p.w('Microsoft Visual Studio Solution File, Format Version %d.00', action.vstudio.solutionVersion)
p.w('# Visual Studio %s', action.vstudio.versionName) p.w('# Visual Studio %s', action.vstudio.versionName)
end end
@ -200,7 +200,7 @@
function sln2005.build0(cfg, context) function sln2005.build0(cfg, context)
if not context.excluded and context.prjCfg.kind ~= premake.NONE then if not context.excluded and context.prjCfg.kind ~= p.NONE then
p.w('{%s}.%s.Build.0 = %s|%s', context.prj.uuid, context.descriptor, context.platform, context.architecture) p.w('{%s}.%s.Build.0 = %s|%s', context.prj.uuid, context.descriptor, context.platform, context.architecture)
end end
end end

View File

@ -4,9 +4,10 @@
-- Copyright (c) 2008-2013 Jason Perkins and the Premake project -- Copyright (c) 2008-2013 Jason Perkins and the Premake project
-- --
premake.vstudio.vs2008 = {} local p = premake
local vs2008 = premake.vstudio.vs2008 p.vstudio.vs2008 = {}
local vstudio = premake.vstudio local vs2008 = p.vstudio.vs2008
local vstudio = p.vstudio
--- ---

View File

@ -4,10 +4,10 @@
-- Copyright (c) 2009-2014 Jason Perkins and the Premake project -- Copyright (c) 2009-2014 Jason Perkins and the Premake project
-- --
premake.vstudio.vc200x = {}
local m = premake.vstudio.vc200x
local p = premake local p = premake
p.vstudio.vc200x = {}
local m = p.vstudio.vc200x
local vstudio = p.vstudio local vstudio = p.vstudio
local context = p.context local context = p.context
local project = p.project local project = p.project
@ -219,7 +219,7 @@
end end
function m.tools(cfg) function m.tools(cfg)
premake.callArray(m.elements.tools, cfg, config.toolset(cfg)) p.callArray(m.elements.tools, cfg, config.toolset(cfg))
end end

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2009-2015 Jason Perkins and the Premake project -- Copyright (c) 2009-2015 Jason Perkins and the Premake project
-- --
premake.vstudio.vs2010 = {}
local p = premake local p = premake
p.vstudio.vs2010 = {}
local vs2010 = p.vstudio.vs2010 local vs2010 = p.vstudio.vs2010
local vstudio = p.vstudio local vstudio = p.vstudio
local project = p.project local project = p.project
@ -69,7 +69,7 @@
-- Only generate a filters file if the source tree actually has subfolders -- Only generate a filters file if the source tree actually has subfolders
if tree.hasbranches(project.getsourcetree(prj)) then if tree.hasbranches(project.getsourcetree(prj)) then
premake.generate(prj, ".vcxproj.filters", vstudio.vc2010.generateFilters) p.generate(prj, ".vcxproj.filters", vstudio.vc2010.generateFilters)
end end
end end

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2016 Jason Perkins and the Premake project -- Copyright (c) 2016 Jason Perkins and the Premake project
-- --
premake.vstudio.nuget2010 = {}
local p = premake local p = premake
p.vstudio.nuget2010 = {}
local vstudio = p.vstudio local vstudio = p.vstudio
local nuget2010 = p.vstudio.nuget2010 local nuget2010 = p.vstudio.nuget2010
local cs2005 = p.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
@ -30,7 +30,7 @@
function nuget2010.packageFramework(prj) function nuget2010.packageFramework(prj)
if p.project.isdotnet(prj) then if p.project.isdotnet(prj) then
local cfg = p.project.getfirstconfig(prj) local cfg = p.project.getfirstconfig(prj)
local action = premake.action.current() local action = p.action.current()
local framework = cfg.dotnetframework or action.vstudio.targetFramework local framework = cfg.dotnetframework or action.vstudio.targetFramework
return cs2005.formatNuGetFrameworkVersion(framework) return cs2005.formatNuGetFrameworkVersion(framework)
else else

View File

@ -5,14 +5,12 @@
-- --
premake.vstudio.vs2010.rules = {}
premake.vstudio.vs2010.rules.props = {}
local m = premake.vstudio.vs2010.rules.props
m.elements = {}
local p = premake local p = premake
p.vstudio.vs2010.rules = {}
p.vstudio.vs2010.rules.props = {}
local m = p.vstudio.vs2010.rules.props
m.elements = {}
--- ---

View File

@ -4,12 +4,11 @@
-- Copyright (c) 2014 Jason Perkins and the Premake project -- Copyright (c) 2014 Jason Perkins and the Premake project
--- ---
premake.vstudio.vs2010.rules.targets = {}
local m = premake.vstudio.vs2010.rules.targets
m.elements = {}
local p = premake local p = premake
p.vstudio.vs2010.rules.targets = {}
local m = p.vstudio.vs2010.rules.targets
m.elements = {}
--- ---

View File

@ -4,12 +4,11 @@
-- Copyright (c) 2014 Jason Perkins and the Premake project -- Copyright (c) 2014 Jason Perkins and the Premake project
-- --
premake.vstudio.vs2010.rules.xml = {}
local m = premake.vstudio.vs2010.rules.xml
m.elements = {}
local p = premake local p = premake
p.vstudio.vs2010.rules.xml = {}
local m = p.vstudio.vs2010.rules.xml
m.elements = {}
--- ---

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2009-2015 Jason Perkins and the Premake project -- Copyright (c) 2009-2015 Jason Perkins and the Premake project
-- --
premake.vstudio.vc2010 = {}
local p = premake local p = premake
p.vstudio.vc2010 = {}
local vstudio = p.vstudio local vstudio = p.vstudio
local project = p.project local project = p.project
local config = p.config local config = p.config
@ -17,7 +17,7 @@
--- ---
-- Add namespace for element definition lists for premake.callArray() -- Add namespace for element definition lists for p.callArray()
--- ---
m.elements = {} m.elements = {}

View File

@ -29,7 +29,7 @@
-- --
function m.filtersProject() function m.filtersProject()
local action = premake.action.current() local action = p.action.current()
p.push('<Project ToolsVersion="%s" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">', p.push('<Project ToolsVersion="%s" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">',
action.vstudio.filterToolsVersion or action.vstudio.toolsVersion) action.vstudio.filterToolsVersion or action.vstudio.toolsVersion)
end end

View File

@ -53,7 +53,7 @@
-- --
function m.userProject() function m.userProject()
local action = premake.action.current() local action = p.action.current()
p.push('<Project ToolsVersion="%s" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">', p.push('<Project ToolsVersion="%s" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">',
action.vstudio.toolsVersion) action.vstudio.toolsVersion)
end end

View File

@ -4,12 +4,11 @@
-- Copyright (c) 2013-2014 Jason Perkins and the Premake project -- Copyright (c) 2013-2014 Jason Perkins and the Premake project
-- --
local vstudio = premake.vstudio local p = premake
local vstudio = p.vstudio
local cs2005 = vstudio.cs2005 local cs2005 = vstudio.cs2005
local vc2010 = vstudio.vc2010 local vc2010 = vstudio.vc2010
local p = premake
--- ---
-- Define the Visual Studio 2010 export action. -- Define the Visual Studio 2010 export action.

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2013-2014 Jason Perkins and the Premake project -- Copyright (c) 2013-2014 Jason Perkins and the Premake project
-- --
premake.vstudio.vc2013 = {}
local p = premake local p = premake
p.vstudio.vc2013 = {}
local vstudio = p.vstudio local vstudio = p.vstudio
local vc2010 = vstudio.vc2010 local vc2010 = vstudio.vc2010

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2015-2015 Jason Perkins and the Premake project -- Copyright (c) 2015-2015 Jason Perkins and the Premake project
-- --
premake.vstudio.vc2015 = {}
local p = premake local p = premake
p.vstudio.vc2015 = {}
local vstudio = p.vstudio local vstudio = p.vstudio
local vc2010 = vstudio.vc2010 local vc2010 = vstudio.vc2010

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2017-2017 Jason Perkins and the Premake project -- Copyright (c) 2017-2017 Jason Perkins and the Premake project
-- --
premake.vstudio.vc2017 = {}
local p = premake local p = premake
p.vstudio.vc2017 = {}
local vstudio = p.vstudio local vstudio = p.vstudio
local vc2010 = vstudio.vc2010 local vc2010 = vstudio.vc2010

View File

@ -7,7 +7,7 @@
local p = premake local p = premake
p.action = {} p.action = {}
local action = premake.action local action = p.action
@ -62,7 +62,7 @@
end end
if act.os ~= nil then if act.os ~= nil then
premake.warnOnce(act.trigger, "action '" .. act.trigger .. "' sets 'os' field, which is deprecated, use 'targetos' instead.") p.warnOnce(act.trigger, "action '" .. act.trigger .. "' sets 'os' field, which is deprecated, use 'targetos' instead.")
act.targetos = act.os act.targetos = act.os
act.os = nil act.os = nil
end end
@ -272,7 +272,7 @@
-- @return -- @return
-- True if the configuration is supported, false otherwise. -- True if the configuration is supported, false otherwise.
-- --
function premake.action.supportsconfig(action, cfg) function p.action.supportsconfig(action, cfg)
if not action then if not action then
return false return false
end end

View File

@ -8,7 +8,7 @@
local p = premake local p = premake
p.api = {} p.api = {}
local api = premake.api local api = p.api
local configset = p.configset local configset = p.configset
@ -81,7 +81,7 @@
--- ---
function includeexternal(fname) function includeexternal(fname)
local fullPath = premake.findProjectScript(fname) local fullPath = p.findProjectScript(fname)
api._isIncludingExternal = true api._isIncludingExternal = true
fname = fullPath or fname fname = fullPath or fname
dofile(fname) dofile(fname)
@ -248,7 +248,7 @@
end end
-- add this new field to my master list -- add this new field to my master list
field, err = premake.field.new(field) field, err = p.field.new(field)
if not field then if not field then
error(err) error(err)
end end
@ -258,7 +258,7 @@
-- use this information when expanding tokens, to ensure that the paths -- use this information when expanding tokens, to ensure that the paths
-- are still well-formed after replacements. -- are still well-formed after replacements.
field.paths = premake.field.property(field, "paths") field.paths = p.field.property(field, "paths")
-- Add preprocessed, lowercase keys to the allowed and aliased value -- Add preprocessed, lowercase keys to the allowed and aliased value
-- lists to speed up value checking later on. -- lists to speed up value checking later on.
@ -281,7 +281,7 @@
return api.storeField(field, value) return api.storeField(field, value)
end end
if premake.field.removes(field) then if p.field.removes(field) then
_G["remove" .. name] = function(value) _G["remove" .. name] = function(value)
return api.remove(field, value) return api.remove(field, value)
end end
@ -299,9 +299,9 @@
function api.unregister(field) function api.unregister(field)
if type(field) == "string" then if type(field) == "string" then
field = premake.field.get(field) field = p.field.get(field)
end end
premake.field.unregister(field) p.field.unregister(field)
_G[field.name] = nil _G[field.name] = nil
_G["remove" .. field.name] = nil _G["remove" .. field.name] = nil
end end
@ -338,7 +338,7 @@
-- --
function api.addAllowed(fieldName, value) function api.addAllowed(fieldName, value)
local field = premake.field.get(fieldName) local field = p.field.get(fieldName)
if not field then if not field then
error("No such field: " .. fieldName, 2) error("No such field: " .. fieldName, 2)
end end
@ -367,7 +367,7 @@
-- --
function api.addAliases(fieldName, value) function api.addAliases(fieldName, value)
local field = premake.field.get(fieldName) local field = p.field.get(fieldName)
if not field then if not field then
error("No such field: " .. fieldName, 2) error("No such field: " .. fieldName, 2)
end end
@ -395,7 +395,7 @@
-- --
function api.deprecateField(name, message, handler) function api.deprecateField(name, message, handler)
premake.fields[name].deprecated = { p.fields[name].deprecated = {
handler = handler, handler = handler,
message = message message = message
} }
@ -427,7 +427,7 @@
api.deprecateValue(name, v, message, addHandler, removeHandler) api.deprecateValue(name, v, message, addHandler, removeHandler)
end end
else else
local field = premake.fields[name] local field = p.fields[name]
field.deprecated = field.deprecated or {} field.deprecated = field.deprecated or {}
field.deprecated[value] = { field.deprecated[value] = {
add = addHandler, add = addHandler,
@ -490,7 +490,7 @@
if field.deprecated and type(field.deprecated.handler) == "function" then if field.deprecated and type(field.deprecated.handler) == "function" then
field.deprecated.handler(value) field.deprecated.handler(value)
if field.deprecated.message and api._deprecations ~= "off" then if field.deprecated.message and api._deprecations ~= "off" then
premake.warnOnce(field.name, "the field %s has been deprecated and will be removed.\n %s", field.name, field.deprecated.message) p.warnOnce(field.name, "the field %s has been deprecated and will be removed.\n %s", field.name, field.deprecated.message)
if api._deprecations == "error" then error("deprecation errors enabled", 3) end if api._deprecations == "error" then error("deprecation errors enabled", 3) end
end end
end end
@ -542,7 +542,7 @@
if handler.remove then handler.remove(value) end if handler.remove then handler.remove(value) end
if handler.message and api._deprecations ~= "off" then if handler.message and api._deprecations ~= "off" then
local key = field.name .. "_" .. value local key = field.name .. "_" .. value
premake.warnOnce(key, "the %s value %s has been deprecated and will be removed.\n %s", field.name, value, handler.message) p.warnOnce(key, "the %s value %s has been deprecated and will be removed.\n %s", field.name, value, handler.message)
if api._deprecations == "error" then if api._deprecations == "error" then
error { msg="deprecation errors enabled" } error { msg="deprecation errors enabled" }
end end
@ -648,7 +648,7 @@
handler.add(canonical) handler.add(canonical)
if handler.message and api._deprecations ~= "off" then if handler.message and api._deprecations ~= "off" then
local key = field.name .. "_" .. value local key = field.name .. "_" .. value
premake.warnOnce(key, "the %s value %s has been deprecated and will be removed.\n %s", field.name, canonical, handler.message) p.warnOnce(key, "the %s value %s has been deprecated and will be removed.\n %s", field.name, canonical, handler.message)
if api._deprecations == "error" then if api._deprecations == "error" then
return nil, "deprecation errors enabled" return nil, "deprecation errors enabled"
end end
@ -1142,7 +1142,7 @@
-- --
function newaction(a) function newaction(a)
premake.action.add(a) p.action.add(a)
end end
@ -1154,5 +1154,5 @@
-- --
function newoption(opt) function newoption(opt)
premake.option.add(opt) p.option.add(opt)
end end

View File

@ -48,7 +48,7 @@
local bundlename = "" local bundlename = ""
local bundlepath = "" local bundlepath = ""
if cfg.system == premake.MACOSX and kind == premake.WINDOWEDAPP then if cfg.system == p.MACOSX and kind == p.WINDOWEDAPP then
bundlename = basename .. ".app" bundlename = basename .. ".app"
bundlepath = path.join(bundlename, "Contents/MacOS") bundlepath = path.join(bundlename, "Contents/MacOS")
end end
@ -193,8 +193,8 @@
-- is provided, change the kind as import libraries are static. -- is provided, change the kind as import libraries are static.
local kind = cfg.kind local kind = cfg.kind
if project.isnative(cfg.project) then if project.isnative(cfg.project) then
if cfg.system == premake.WINDOWS and kind == premake.SHAREDLIB and not cfg.flags.NoImportLib then if cfg.system == p.WINDOWS and kind == p.SHAREDLIB and not cfg.flags.NoImportLib then
kind = premake.STATICLIB kind = p.STATICLIB
end end
end end
return config.buildtargetinfo(cfg, kind, "implib") return config.buildtargetinfo(cfg, kind, "implib")

View File

@ -6,9 +6,9 @@
-- Copyright (c) 2011-2014 Jason Perkins and the Premake project -- Copyright (c) 2011-2014 Jason Perkins and the Premake project
-- --
premake.detoken = {}
local p = premake local p = premake
p.detoken = {}
local detoken = p.detoken local detoken = p.detoken

View File

@ -12,8 +12,9 @@
-- Copyright (c) 2014 Jason Perkins and the Premake project -- Copyright (c) 2014 Jason Perkins and the Premake project
--- ---
premake.field = {} local p = premake
local field = premake.field p.field = {}
local field = p.field
-- Lists to hold all of the registered fields and data kinds -- Lists to hold all of the registered fields and data kinds
@ -334,14 +335,14 @@
--- ---
-- Override one of the field kind accessor functions. This works just like -- Override one of the field kind accessor functions. This works just like
-- premake.override(), but applies the new function to the internal field -- p.override(), but applies the new function to the internal field
-- description and clears the accessor caches to make sure the change gets -- description and clears the accessor caches to make sure the change gets
-- picked up by future operations. -- picked up by future operations.
--- ---
function field.override(fieldName, accessorName, func) function field.override(fieldName, accessorName, func)
local kind = field.kind(fieldName) local kind = field.kind(fieldName)
premake.override(kind, accessorName, func) p.override(kind, accessorName, func)
field._accessors = {} field._accessors = {}
end end

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2011-2014 Jason Perkins and the Premake project -- Copyright (c) 2011-2014 Jason Perkins and the Premake project
-- --
premake.fileconfig = {}
local p = premake local p = premake
p.fileconfig = {}
local fileconfig = p.fileconfig local fileconfig = p.fileconfig
local context = p.context local context = p.context
local project = p.project local project = p.project
@ -184,7 +184,7 @@
-- --
function fileconfig.hasFileSettings(fcfg) function fileconfig.hasFileSettings(fcfg)
for key, field in pairs(premake.fields) do for key, field in pairs(p.fields) do
if field.scopes[1] == "config" then if field.scopes[1] == "config" then
local value = fcfg[field.name] local value = fcfg[field.name]
if value then if value then

View File

@ -4,8 +4,8 @@
-- Copyright (c) 2002-2015 Jason Perkins and the Premake project -- Copyright (c) 2002-2015 Jason Perkins and the Premake project
--- ---
premake.languages = {}
local p = premake local p = premake
p.languages = {}
local languages = p.languages local languages = p.languages
@ -62,7 +62,7 @@
-- Combined list of all supported languages. -- Combined list of all supported languages.
--- ---
languages.all = table.join( languages.all = table.join(
languages.c, languages.c,
languages.cpp, languages.cpp,
languages.dotnet languages.dotnet
) )

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2002-2014 Jason Perkins and the Premake project -- Copyright (c) 2002-2014 Jason Perkins and the Premake project
-- --
premake.option = {} local p = premake
local m = premake.option p.option = {}
local m = p.option
-- --
@ -87,7 +88,7 @@
end end
-- add it to the master list -- add it to the master list
premake.option.list[opt.trigger:lower()] = opt p.option.list[opt.trigger:lower()] = opt
-- if it has a default value, set it. -- if it has a default value, set it.
if opt.default and not _OPTIONS[opt.trigger] then if opt.default and not _OPTIONS[opt.trigger] then
@ -107,7 +108,7 @@
-- --
function m.get(name) function m.get(name)
return premake.option.list[name] return p.option.list[name]
end end
@ -119,7 +120,7 @@
function m.each() function m.each()
-- sort the list by trigger -- sort the list by trigger
local keys = { } local keys = { }
for _, option in pairs(premake.option.list) do for _, option in pairs(p.option.list) do
table.insert(keys, option.trigger) table.insert(keys, option.trigger)
end end
table.sort(keys) table.sort(keys)
@ -127,7 +128,7 @@
local i = 0 local i = 0
return function() return function()
i = i + 1 i = i + 1
return premake.option.list[keys[i]] return p.option.list[keys[i]]
end end
end end
@ -145,7 +146,7 @@
function m.validate(values) function m.validate(values)
for key, value in pairs(values) do for key, value in pairs(values) do
-- does this option exist -- does this option exist
local opt = premake.option.get(key) local opt = p.option.get(key)
if (not opt) then if (not opt) then
return false, "invalid option '" .. key .. "'" return false, "invalid option '" .. key .. "'"
end end

View File

@ -261,7 +261,7 @@
local platform = pairing[2] local platform = pairing[2]
local cfg = oven.bakeConfig(wks, self, buildcfg, platform) local cfg = oven.bakeConfig(wks, self, buildcfg, platform)
if premake.action.supportsconfig(premake.action.current(), cfg) then if p.action.supportsconfig(p.action.current(), cfg) then
self.configs[(buildcfg or "*") .. (platform or "")] = cfg self.configs[(buildcfg or "*") .. (platform or "")] = cfg
end end
end end
@ -405,7 +405,7 @@
local pairings = table.fold(buildcfgs, platforms) local pairings = table.fold(buildcfgs, platforms)
for _, pairing in ipairs(pairings) do for _, pairing in ipairs(pairings) do
local cfg = oven.bakeConfig(wks, nil, pairing[1], pairing[2]) local cfg = oven.bakeConfig(wks, nil, pairing[1], pairing[2])
if premake.action.supportsconfig(premake.action.current(), cfg) then if p.action.supportsconfig(p.action.current(), cfg) then
table.insert(configs, cfg) table.insert(configs, cfg)
end end
end end

View File

@ -49,7 +49,7 @@
fn() fn()
-- build the result -- build the result
local captured = premake.captured() local captured = p.captured()
-- free the capture buffer. -- free the capture buffer.
buffered.close(_captured) buffered.close(_captured)
@ -108,7 +108,7 @@
local result = {} local result = {}
local n = #value local n = #value
for i = 1, n do for i = 1, n do
table.insert(result, premake.esc(value[i])) table.insert(result, p.esc(value[i]))
end end
return result return result
end end
@ -150,13 +150,13 @@
-- --
function premake.generate(obj, ext, callback) function premake.generate(obj, ext, callback)
local output = premake.capture(function () local output = p.capture(function ()
_indentLevel = 0 _indentLevel = 0
callback(obj) callback(obj)
_indentLevel = 0 _indentLevel = 0
end) end)
local fn = premake.filename(obj, ext) local fn = p.filename(obj, ext)
-- make sure output folder exists. -- make sure output folder exists.
local dir = path.getdirectory(fn) local dir = path.getdirectory(fn)
@ -238,8 +238,8 @@ end
--- ---
function premake.outln(s) function premake.outln(s)
premake.out(s) p.out(s)
premake.out(_eol or "\n") p.out(_eol or "\n")
end end
@ -260,7 +260,7 @@ end
_indentLevel = _indentLevel - (i or 1) _indentLevel = _indentLevel - (i or 1)
else else
_indentLevel = _indentLevel - 1 _indentLevel = _indentLevel - 1
premake.w(i, ...) p.w(i, ...)
end end
end end
@ -281,7 +281,7 @@ end
if i == nil or type(i) == "number" then if i == nil or type(i) == "number" then
_indentLevel = _indentLevel + (i or 1) _indentLevel = _indentLevel + (i or 1)
else else
premake.w(i, ...) p.w(i, ...)
_indentLevel = _indentLevel + 1 _indentLevel = _indentLevel + 1
end end
end end
@ -324,9 +324,9 @@ end
function premake.w(...) function premake.w(...)
if select("#", ...) > 0 then if select("#", ...) > 0 then
premake.outln(string.rep(_indentString or "\t", _indentLevel) .. string.format(...)) p.outln(string.rep(_indentString or "\t", _indentLevel) .. string.format(...))
else else
premake.outln(''); p.outln('');
end end
end end
@ -341,9 +341,9 @@ end
function premake.x(msg, ...) function premake.x(msg, ...)
local arg = {...} local arg = {...}
for i = 1, #arg do for i = 1, #arg do
arg[i] = premake.esc(arg[i]) arg[i] = p.esc(arg[i])
end end
premake.w(msg, unpack(arg)) p.w(msg, unpack(arg))
end end
@ -359,7 +359,7 @@ end
function premake.xmlUtf8(upper) function premake.xmlUtf8(upper)
local encoding = iif(upper, "UTF-8", "utf-8") local encoding = iif(upper, "UTF-8", "utf-8")
premake.w('<?xml version="1.0" encoding="%s"?>', encoding) p.w('<?xml version="1.0" encoding="%s"?>', encoding)
end end
@ -381,17 +381,17 @@ end
function _p(i, ...) function _p(i, ...)
if type(i) == "number" then if type(i) == "number" then
_indentLevel = i _indentLevel = i
premake.w(...) p.w(...)
else else
_indentLevel = 0 _indentLevel = 0
premake.w(i, ...) p.w(i, ...)
end end
end end
function _x(i, ...) function _x(i, ...)
local arg = {...} local arg = {...}
for i = 2, #arg do for i = 2, #arg do
arg[i] = premake.esc(arg[i]) arg[i] = p.esc(arg[i])
end end
_p(i, unpack(arg)) _p(i, unpack(arg))
end end

View File

@ -16,7 +16,7 @@
-- @param identifier -- @param identifier
-- A toolset identifier composed of two parts: the toolset name, -- A toolset identifier composed of two parts: the toolset name,
-- which should match of the name of the adapter object ("gcc", -- which should match of the name of the adapter object ("gcc",
-- "clang", etc.) in the premake.tools namespace, and and optional -- "clang", etc.) in the p.tools namespace, and and optional
-- version number, separated by a dash. -- version number, separated by a dash.
-- --
-- To make things more intuitive for Visual Studio users, supports -- To make things more intuitive for Visual Studio users, supports

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2009-2013 Jason Perkins and the Premake project -- Copyright (c) 2009-2013 Jason Perkins and the Premake project
-- --
premake.tree = {} local p = premake
local tree = premake.tree p.tree = {}
local tree = p.tree
-- --

View File

@ -7,10 +7,9 @@
-- Copyright (c) 2002-2015 Jason Perkins and the Premake project -- Copyright (c) 2002-2015 Jason Perkins and the Premake project
--- ---
premake.validation = {}
local m = premake.validation
local p = premake local p = premake
p.validation = {}
local m = p.validation
m.elements = {} m.elements = {}

View File

@ -4,10 +4,11 @@
-- Copyright (c) 2013 Jason Perkins and the Premake project -- Copyright (c) 2013 Jason Perkins and the Premake project
-- --
premake.tools.clang = {} local p = premake
local clang = premake.tools.clang p.tools.clang = {}
local gcc = premake.tools.gcc local clang = p.tools.clang
local config = premake.config local gcc = p.tools.gcc
local config = p.config
@ -194,18 +195,18 @@
}, },
kind = { kind = {
SharedLib = function(cfg) SharedLib = function(cfg)
local r = { iif(cfg.system == premake.MACOSX, "-dynamiclib", "-shared") } local r = { iif(cfg.system == p.MACOSX, "-dynamiclib", "-shared") }
if cfg.system == "windows" and not cfg.flags.NoImportLib then if cfg.system == "windows" and not cfg.flags.NoImportLib then
table.insert(r, '-Wl,--out-implib="' .. cfg.linktarget.relpath .. '"') table.insert(r, '-Wl,--out-implib="' .. cfg.linktarget.relpath .. '"')
elseif cfg.system == premake.LINUX then elseif cfg.system == p.LINUX then
table.insert(r, '-Wl,-soname=' .. premake.quoted(cfg.linktarget.name)) table.insert(r, '-Wl,-soname=' .. p.quoted(cfg.linktarget.name))
elseif cfg.system == premake.MACOSX then elseif cfg.system == p.MACOSX then
table.insert(r, '-Wl,-install_name,' .. premake.quoted('@rpath/' .. cfg.linktarget.name)) table.insert(r, '-Wl,-install_name,' .. p.quoted('@rpath/' .. cfg.linktarget.name))
end end
return r return r
end, end,
WindowedApp = function(cfg) WindowedApp = function(cfg)
if cfg.system == premake.WINDOWS then return "-mwindows" end if cfg.system == p.WINDOWS then return "-mwindows" end
end, end,
}, },
system = { system = {

View File

@ -5,10 +5,11 @@
-- --
premake.tools.dotnet = {} local p = premake
local dotnet = premake.tools.dotnet p.tools.dotnet = {}
local project = premake.project local dotnet = p.tools.dotnet
local config = premake.config local project = p.project
local config = p.config
-- --
@ -50,7 +51,7 @@
info.action = "Resource" info.action = "Resource"
elseif ext == ".xaml" then elseif ext == ".xaml" then
if fcfg.buildaction == "Application" or path.getbasename(fname) == "App" then if fcfg.buildaction == "Application" or path.getbasename(fname) == "App" then
if fcfg.project.kind == premake.SHAREDLIB then if fcfg.project.kind == p.SHAREDLIB then
info.action = "None" info.action = "None"
else else
info.action = "ApplicationDefinition" info.action = "ApplicationDefinition"

View File

@ -199,7 +199,7 @@
table.foreachi(cfg.forceincludes, function(value) table.foreachi(cfg.forceincludes, function(value)
local fn = project.getrelative(cfg.project, value) local fn = project.getrelative(cfg.project, value)
table.insert(result, string.format('-include %s', premake.quoted(fn))) table.insert(result, string.format('-include %s', p.quoted(fn)))
end) end)
return result return result
@ -214,11 +214,11 @@
local result = {} local result = {}
for _, dir in ipairs(dirs) do for _, dir in ipairs(dirs) do
dir = project.getrelative(cfg.project, dir) dir = project.getrelative(cfg.project, dir)
table.insert(result, '-I' .. premake.quoted(dir)) table.insert(result, '-I' .. p.quoted(dir))
end end
for _, dir in ipairs(sysdirs or {}) do for _, dir in ipairs(sysdirs or {}) do
dir = project.getrelative(cfg.project, dir) dir = project.getrelative(cfg.project, dir)
table.insert(result, '-isystem ' .. premake.quoted(dir)) table.insert(result, '-isystem ' .. p.quoted(dir))
end end
return result return result
end end
@ -230,8 +230,8 @@
function gcc.getrunpathdirs(cfg, dirs) function gcc.getrunpathdirs(cfg, dirs)
local result = {} local result = {}
if not ((cfg.system == premake.MACOSX) if not ((cfg.system == p.MACOSX)
or (cfg.system == premake.LINUX)) then or (cfg.system == p.LINUX)) then
return result return result
end end
@ -247,7 +247,7 @@
-- Automatically add linked shared libraries path relative to target directory -- Automatically add linked shared libraries path relative to target directory
for _, sibling in ipairs(config.getlinks(cfg, "siblings", "object")) do for _, sibling in ipairs(config.getlinks(cfg, "siblings", "object")) do
if (sibling.kind == premake.SHAREDLIB) then if (sibling.kind == p.SHAREDLIB) then
local fullpath = sibling.linktarget.directory local fullpath = sibling.linktarget.directory
local rpath = path.getrelative(cfg.buildtarget.directory, fullpath) local rpath = path.getrelative(cfg.buildtarget.directory, fullpath)
if not (table.contains(rpaths, rpath)) then if not (table.contains(rpaths, rpath)) then
@ -257,9 +257,9 @@
end end
for _, rpath in ipairs(rpaths) do for _, rpath in ipairs(rpaths) do
if (cfg.system == premake.MACOSX) then if (cfg.system == p.MACOSX) then
rpath = "@loader_path/" .. rpath rpath = "@loader_path/" .. rpath
elseif (cfg.system == premake.LINUX) then elseif (cfg.system == p.LINUX) then
rpath = iif(rpath == ".", "", "/" .. rpath) rpath = iif(rpath == ".", "", "/" .. rpath)
rpath = "$$ORIGIN" .. rpath rpath = "$$ORIGIN" .. rpath
end end
@ -276,7 +276,7 @@
function gcc.ldsymbols(cfg) function gcc.ldsymbols(cfg)
-- OS X has a bug, see http://lists.apple.com/archives/Darwin-dev/2006/Sep/msg00084.html -- OS X has a bug, see http://lists.apple.com/archives/Darwin-dev/2006/Sep/msg00084.html
return iif(cfg.system == premake.MACOSX, "-Wl,-x", "-s") return iif(cfg.system == p.MACOSX, "-Wl,-x", "-s")
end end
gcc.ldflags = { gcc.ldflags = {
@ -289,18 +289,18 @@
}, },
kind = { kind = {
SharedLib = function(cfg) SharedLib = function(cfg)
local r = { iif(cfg.system == premake.MACOSX, "-dynamiclib", "-shared") } local r = { iif(cfg.system == p.MACOSX, "-dynamiclib", "-shared") }
if cfg.system == premake.WINDOWS and not cfg.flags.NoImportLib then if cfg.system == p.WINDOWS and not cfg.flags.NoImportLib then
table.insert(r, '-Wl,--out-implib="' .. cfg.linktarget.relpath .. '"') table.insert(r, '-Wl,--out-implib="' .. cfg.linktarget.relpath .. '"')
elseif cfg.system == premake.LINUX then elseif cfg.system == p.LINUX then
table.insert(r, '-Wl,-soname=' .. premake.quoted(cfg.linktarget.name)) table.insert(r, '-Wl,-soname=' .. p.quoted(cfg.linktarget.name))
elseif cfg.system == premake.MACOSX then elseif cfg.system == p.MACOSX then
table.insert(r, '-Wl,-install_name,' .. premake.quoted('@rpath/' .. cfg.linktarget.name)) table.insert(r, '-Wl,-install_name,' .. p.quoted('@rpath/' .. cfg.linktarget.name))
end end
return r return r
end, end,
WindowedApp = function(cfg) WindowedApp = function(cfg)
if cfg.system == premake.WINDOWS then return "-mwindows" end if cfg.system == p.WINDOWS then return "-mwindows" end
end, end,
}, },
system = { system = {
@ -327,14 +327,14 @@
architecture = { architecture = {
x86 = function (cfg) x86 = function (cfg)
local r = {} local r = {}
if cfg.system ~= premake.MACOSX then if cfg.system ~= p.MACOSX then
table.insert (r, "-L/usr/lib32") table.insert (r, "-L/usr/lib32")
end end
return r return r
end, end,
x86_64 = function (cfg) x86_64 = function (cfg)
local r = {} local r = {}
if cfg.system ~= premake.MACOSX then if cfg.system ~= p.MACOSX then
table.insert (r, "-L/usr/lib64") table.insert (r, "-L/usr/lib64")
end end
return r return r
@ -352,12 +352,12 @@
-- paths, add those to the list of library search paths. The call -- paths, add those to the list of library search paths. The call
-- config.getlinks() all includes cfg.libdirs. -- config.getlinks() all includes cfg.libdirs.
for _, dir in ipairs(config.getlinks(cfg, "system", "directory")) do for _, dir in ipairs(config.getlinks(cfg, "system", "directory")) do
table.insert(flags, '-L' .. premake.quoted(dir)) table.insert(flags, '-L' .. p.quoted(dir))
end end
if cfg.flags.RelativeLinks then if cfg.flags.RelativeLinks then
for _, dir in ipairs(config.getlinks(cfg, "siblings", "directory")) do for _, dir in ipairs(config.getlinks(cfg, "siblings", "directory")) do
local libFlag = "-L" .. premake.project.getrelative(cfg.project, dir) local libFlag = "-L" .. p.project.getrelative(cfg.project, dir)
if not table.contains(flags, libFlag) then if not table.contains(flags, libFlag) then
table.insert(flags, libFlag) table.insert(flags, libFlag)
end end
@ -365,7 +365,7 @@
end end
for _, dir in ipairs(cfg.syslibdirs) do for _, dir in ipairs(cfg.syslibdirs) do
table.insert(flags, '-L' .. premake.quoted(dir)) table.insert(flags, '-L' .. p.quoted(dir))
end end
return flags return flags

View File

@ -189,7 +189,7 @@
table.foreachi(cfg.forceincludes, function(value) table.foreachi(cfg.forceincludes, function(value)
local fn = project.getrelative(cfg.project, value) local fn = project.getrelative(cfg.project, value)
table.insert(result, "/FI" .. premake.quoted(fn)) table.insert(result, "/FI" .. p.quoted(fn))
end) end)
return result return result
@ -208,7 +208,7 @@
dirs = table.join(dirs, sysdirs) dirs = table.join(dirs, sysdirs)
for _, dir in ipairs(dirs) do for _, dir in ipairs(dirs) do
dir = project.getrelative(cfg.project, dir) dir = project.getrelative(cfg.project, dir)
table.insert(result, '-I' .. premake.quoted(dir)) table.insert(result, '-I' .. p.quoted(dir))
end end
return result return result
end end
@ -241,7 +241,7 @@
} }
function msc.getldflags(cfg) function msc.getldflags(cfg)
local map = iif(cfg.kind ~= premake.STATICLIB, msc.linkerFlags, msc.librarianFlags) local map = iif(cfg.kind ~= p.STATICLIB, msc.linkerFlags, msc.librarianFlags)
local flags = config.mapFlags(cfg, map) local flags = config.mapFlags(cfg, map)
table.insert(flags, 1, "/NOLOGO") table.insert(flags, 1, "/NOLOGO")

View File

@ -4,10 +4,11 @@
-- Copyright (c) 2013 Jason Perkins and the Premake project -- Copyright (c) 2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_clang") local suite = test.declare("make_clang")
local make = premake.make local make = p.make
local cpp = premake.make.cpp local cpp = p.make.cpp
local project = premake.project local project = p.project
-- --
@ -19,7 +20,7 @@
function suite.setup() function suite.setup()
wks = test.createWorkspace() wks = test.createWorkspace()
toolset "clang" toolset "clang"
prj = premake.workspace.getproject(wks, 1) prj = p.workspace.getproject(wks, 1)
end end

View File

@ -4,9 +4,10 @@
-- Copyright (c) 2009-2014 Jason Perkins and the Premake project -- Copyright (c) 2009-2014 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_cpp_file_rules") local suite = test.declare("make_cpp_file_rules")
local make = premake.make local make = p.make
local project = premake.project local project = p.project
-- --
@ -16,12 +17,12 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.escaper(make.esc) p.escaper(make.esc)
wks = test.createWorkspace() wks = test.createWorkspace()
end end
local function prepare() local function prepare()
prj = premake.workspace.getproject(wks, 1) prj = p.workspace.getproject(wks, 1)
make.cppFileRules(prj) make.cppFileRules(prj)
end end

View File

@ -4,9 +4,10 @@
-- Copyright (c) 2012-2015 Jason Perkins and the Premake project -- Copyright (c) 2012-2015 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_flags") local suite = test.declare("make_flags")
local make = premake.make local make = p.make
local project = premake.project local project = p.project
-- --
@ -21,8 +22,8 @@
local function prepare(calls) local function prepare(calls)
local cfg = test.getconfig(prj, "Debug") local cfg = test.getconfig(prj, "Debug")
local toolset = premake.tools.gcc local toolset = p.tools.gcc
premake.callarray(make, calls, cfg, toolset) p.callarray(make, calls, cfg, toolset)
end end

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2012-2015 Jason Perkins and the Premake project -- Copyright (c) 2012-2015 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_ldflags") local suite = test.declare("make_ldflags")
local make = premake.make local make = p.make
-- --
@ -21,7 +22,7 @@
local function prepare(calls) local function prepare(calls)
local cfg = test.getconfig(prj, "Debug") local cfg = test.getconfig(prj, "Debug")
local toolset = premake.tools.gcc local toolset = p.tools.gcc
make.ldFlags(cfg, toolset) make.ldFlags(cfg, toolset)
end end
@ -48,28 +49,28 @@
ALL_LDFLAGS += $(LDFLAGS) -L../libs -Llibs ALL_LDFLAGS += $(LDFLAGS) -L../libs -Llibs
]] ]]
end end
function suite.checkLibDirs_X86_64() function suite.checkLibDirs_X86_64()
architecture ("x86_64") architecture ("x86_64")
system (premake.LINUX) system (p.LINUX)
prepare() prepare()
test.capture [[ test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64
]] ]]
end end
function suite.checkLibDirs_X86() function suite.checkLibDirs_X86()
architecture ("x86") architecture ("x86")
system (premake.LINUX) system (p.LINUX)
prepare() prepare()
test.capture [[ test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32
]] ]]
end end
function suite.checkLibDirs_X86_64_MacOSX() function suite.checkLibDirs_X86_64_MacOSX()
architecture ("x86_64") architecture ("x86_64")
system (premake.MACOSX) system (p.MACOSX)
prepare() prepare()
test.capture [[ test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -m64 ALL_LDFLAGS += $(LDFLAGS) -m64

View File

@ -4,9 +4,10 @@
-- Copyright (c) 2010-2013 Jason Perkins and the Premake project -- Copyright (c) 2010-2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_linking") local suite = test.declare("make_linking")
local make = premake.make local make = p.make
local project = premake.project local project = p.project
-- --
@ -22,8 +23,8 @@
local function prepare(calls) local function prepare(calls)
local cfg = test.getconfig(prj, "Debug") local cfg = test.getconfig(prj, "Debug")
local toolset = premake.tools.gcc local toolset = p.tools.gcc
premake.callarray(make, calls, cfg, toolset) p.callarray(make, calls, cfg, toolset)
end end

View File

@ -4,9 +4,10 @@
-- Copyright (c) 2010-2013 Jason Perkins and the Premake project -- Copyright (c) 2010-2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_pch") local suite = test.declare("make_pch")
local make = premake.make local make = p.make
local project = premake.project local project = p.project

View File

@ -4,9 +4,10 @@
-- Copyright (c) 2009-2013 Jason Perkins and the Premake project -- Copyright (c) 2009-2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_cpp_target_rules") local suite = test.declare("make_cpp_target_rules")
local make = premake.make local make = p.make
local project = premake.project local project = p.project
-- --

View File

@ -4,10 +4,11 @@
-- Copyright (c) 2012-2013 Jason Perkins and the Premake project -- Copyright (c) 2012-2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_tools") local suite = test.declare("make_tools")
local make = premake.make local make = p.make
local cpp = premake.make.cpp local cpp = p.make.cpp
local project = premake.project local project = p.project
-- --
@ -27,7 +28,7 @@
-- --
function suite.usesCorrectTools() function suite.usesCorrectTools()
make.cppTools(cfg, premake.tools.gcc) make.cppTools(cfg, p.tools.gcc)
test.capture [[ test.capture [[
RESCOMP = windres RESCOMP = windres
]] ]]

View File

@ -4,9 +4,10 @@
-- Copyright (c) 2011-2013 Jason Perkins and the Premake project -- Copyright (c) 2011-2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_wiidev") local suite = test.declare("make_wiidev")
local make = premake.make local make = p.make
local project = premake.project local project = p.project
-- --
@ -28,14 +29,14 @@
-- --
function suite.writesCorrectCppFlags() function suite.writesCorrectCppFlags()
make.cppFlags(cfg, premake.tools.gcc) make.cppFlags(cfg, p.tools.gcc)
test.capture [[ test.capture [[
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -I$(LIBOGC_INC) $(MACHDEP) $(DEFINES) $(INCLUDES) ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -I$(LIBOGC_INC) $(MACHDEP) $(DEFINES) $(INCLUDES)
]] ]]
end end
function suite.writesCorrectLinkerFlags() function suite.writesCorrectLinkerFlags()
make.ldFlags(cfg, premake.tools.gcc) make.ldFlags(cfg, p.tools.gcc)
test.capture [[ test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -L$(LIBOGC_LIB) $(MACHDEP) ALL_LDFLAGS += $(LDFLAGS) -L$(LIBOGC_LIB) $(MACHDEP)
]] ]]
@ -47,7 +48,7 @@
-- --
function suite.writesIncludeBlock() function suite.writesIncludeBlock()
make.settings(cfg, premake.tools.gcc) make.settings(cfg, p.tools.gcc)
test.capture [[ test.capture [[
ifeq ($(strip $(DEVKITPPC)),) ifeq ($(strip $(DEVKITPPC)),)
$(error "DEVKITPPC environment variable is not set")' $(error "DEVKITPPC environment variable is not set")'

View File

@ -4,10 +4,11 @@
-- Copyright (c) 2013-2014 Jason Perkins and the Premake project -- Copyright (c) 2013-2014 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_cs_embed_files") local suite = test.declare("make_cs_embed_files")
local make = premake.make local make = p.make
local cs = premake.make.cs local cs = p.make.cs
local project = premake.project local project = p.project
-- --
@ -21,8 +22,8 @@
end end
local function prepare() local function prepare()
prj = premake.workspace.getproject(wks, 1) prj = p.workspace.getproject(wks, 1)
make.csEmbedFiles(prj, premake.tools.dotnet) make.csEmbedFiles(prj, p.tools.dotnet)
end end

View File

@ -4,10 +4,11 @@
-- Copyright (c) 2013 Jason Perkins and the Premake project -- Copyright (c) 2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_cs_flags") local suite = test.declare("make_cs_flags")
local make = premake.make local make = p.make
local cs = premake.make.cs local cs = p.make.cs
local project = premake.project local project = p.project
-- --
@ -22,7 +23,7 @@
local function prepare() local function prepare()
local cfg = test.getconfig(prj, "Debug") local cfg = test.getconfig(prj, "Debug")
make.csFlags(cfg, premake.tools.dotnet) make.csFlags(cfg, p.tools.dotnet)
end end

View File

@ -4,10 +4,11 @@
-- Copyright (c) 2013 Jason Perkins and the Premake project -- Copyright (c) 2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_cs_links") local suite = test.declare("make_cs_links")
local make = premake.make local make = p.make
local cs = premake.make.cs local cs = p.make.cs
local project = premake.project local project = p.project
-- --
-- Setup -- Setup
@ -21,7 +22,7 @@
local function prepare() local function prepare()
local cfg = test.getconfig(prj, "Debug") local cfg = test.getconfig(prj, "Debug")
make.csLinkCmd(cfg, premake.tools.dotnet) make.csLinkCmd(cfg, p.tools.dotnet)
end end

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2009-2013 Jason Perkins and the Premake project -- Copyright (c) 2009-2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_cs_response") local suite = test.declare("make_cs_response")
local make = premake.make local make = p.make
-- --
@ -15,7 +16,7 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.action.set("vs2010") p.action.set("vs2010")
wks = test.createWorkspace() wks = test.createWorkspace()
end end

View File

@ -4,10 +4,11 @@
-- Copyright (c) 2013-2014 Jason Perkins and the Premake project -- Copyright (c) 2013-2014 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_cs_sources") local suite = test.declare("make_cs_sources")
local make = premake.make local make = p.make
local cs = premake.make.cs local cs = p.make.cs
local project = premake.project local project = p.project
-- --
@ -21,8 +22,8 @@
end end
local function prepare() local function prepare()
prj = premake.workspace.getproject(wks, 1) prj = p.workspace.getproject(wks, 1)
make.csSources(prj, premake.tools.dotnet) make.csSources(prj, p.tools.dotnet)
end end

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2010-2012 Jason Perkins and the Premake project -- Copyright (c) 2010-2012 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_escaping") local suite = test.declare("make_escaping")
local make = premake.make local make = p.make
function suite.Escapes_Spaces() function suite.Escapes_Spaces()

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2012 Jason Perkins and the Premake project -- Copyright (c) 2012 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_tovar") local suite = test.declare("make_tovar")
local make = premake.make local make = p.make
-- --

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2012 Jason Perkins and the Premake project -- Copyright (c) 2012 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_config_maps") local suite = test.declare("make_config_maps")
local make = premake.make local make = p.make
-- --

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2012-2015 Jason Perkins and the Premake project -- Copyright (c) 2012-2015 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_group_rule") local suite = test.declare("make_group_rule")
local make = premake.make local make = p.make
-- --

View File

@ -4,6 +4,7 @@
-- Copyright (c) 2012-2015 Jason Perkins and the Premake project -- Copyright (c) 2012-2015 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_help_rule") local suite = test.declare("make_help_rule")
@ -19,7 +20,7 @@
local function prepare() local function prepare()
wks = test.getWorkspace(wks) wks = test.getWorkspace(wks)
premake.make.helprule(wks) p.make.helprule(wks)
end end

View File

@ -4,6 +4,7 @@
-- Copyright (c) 2012-2015 Jason Perkins and the Premake project -- Copyright (c) 2012-2015 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("make_project_rule") local suite = test.declare("make_project_rule")
@ -18,9 +19,9 @@
end end
local function prepare() local function prepare()
premake.oven.bake() p.oven.bake()
wks = test.getWorkspace(wks) wks = test.getWorkspace(wks)
premake.make.projectrules(wks) p.make.projectrules(wks)
end end

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2009-2014 Jason Perkins and the Premake project -- Copyright (c) 2009-2014 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vstudio_cs2005_projectelement") local suite = test.declare("vstudio_cs2005_projectelement")
local cs2005 = premake.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
-- --
@ -29,7 +30,7 @@
-- --
function suite.on2005() function suite.on2005()
premake.action.set("vs2005") p.action.set("vs2005")
prepare() prepare()
test.capture [[ test.capture [[
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
@ -38,7 +39,7 @@
function suite.on2008() function suite.on2008()
premake.action.set("vs2008") p.action.set("vs2008")
prepare() prepare()
test.capture [[ test.capture [[
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
@ -47,7 +48,7 @@
function suite.on2010() function suite.on2010()
premake.action.set("vs2010") p.action.set("vs2010")
prepare() prepare()
test.capture [[ test.capture [[
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
@ -57,7 +58,7 @@
function suite.on2012() function suite.on2012()
premake.action.set("vs2012") p.action.set("vs2012")
prepare() prepare()
test.capture [[ test.capture [[
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
@ -67,7 +68,7 @@
function suite.on2013() function suite.on2013()
premake.action.set("vs2013") p.action.set("vs2013")
prepare() prepare()
test.capture [[ test.capture [[
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2009-2015 Jason Perkins and the Premake project -- Copyright (c) 2009-2015 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vstudio_cs2005_projectsettings") local suite = test.declare("vstudio_cs2005_projectsettings")
local cs2005 = p.vstudio.cs2005
local cs2005 = premake.vstudio.cs2005
-- --
@ -16,7 +16,7 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.action.set("vs2005") p.action.set("vs2005")
wks = test.createWorkspace() wks = test.createWorkspace()
language "C#" language "C#"
uuid "AE61726D-187C-E440-BD07-2556188A6565" uuid "AE61726D-187C-E440-BD07-2556188A6565"
@ -51,7 +51,7 @@
function suite.OnVs2008() function suite.OnVs2008()
premake.action.set("vs2008") p.action.set("vs2008")
prepare() prepare()
test.capture [[ test.capture [[
<PropertyGroup> <PropertyGroup>
@ -70,7 +70,7 @@
function suite.OnVs2010() function suite.OnVs2010()
premake.action.set("vs2010") p.action.set("vs2010")
prepare() prepare()
test.capture [[ test.capture [[
<PropertyGroup> <PropertyGroup>
@ -93,7 +93,7 @@
function suite.onVs2012() function suite.onVs2012()
premake.action.set("vs2012") p.action.set("vs2012")
prepare() prepare()
test.capture [[ test.capture [[
<PropertyGroup> <PropertyGroup>
@ -183,7 +183,7 @@
-- --
function suite.projectTypeGuids_onWPF() function suite.projectTypeGuids_onWPF()
premake.action.set("vs2010") p.action.set("vs2010")
flags { "WPF" } flags { "WPF" }
prepare() prepare()
test.capture [[ test.capture [[

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2012-2015 Jason Perkins and the Premake project -- Copyright (c) 2012-2015 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vstudio_cs2005_assembly_refs") local suite = test.declare("vstudio_cs2005_assembly_refs")
local cs2005 = p.vstudio.cs2005
local cs2005 = premake.vstudio.cs2005
-- --
@ -16,7 +16,7 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.action.set("vs2010") p.action.set("vs2010")
wks = test.createWorkspace() wks = test.createWorkspace()
language "C#" language "C#"
end end

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2012-2013 Jason Perkins and the Premake project -- Copyright (c) 2012-2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vstudio_cs2005_build_events") local suite = test.declare("vstudio_cs2005_build_events")
local cs2005 = premake.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
-- --
@ -15,8 +16,8 @@
local wks, prj, cfg local wks, prj, cfg
function suite.setup() function suite.setup()
premake.action.set("vs2005") p.action.set("vs2005")
premake.escaper(premake.vstudio.vs2010.esc) p.escaper(p.vstudio.vs2010.esc)
wks = test.createWorkspace() wks = test.createWorkspace()
end end

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2013 Jason Perkins and the Premake project -- Copyright (c) 2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vs2012_csproj_common_props") local suite = test.declare("vs2012_csproj_common_props")
local cs2005 = premake.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
-- --
@ -15,7 +16,7 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.action.set("vs2012") p.action.set("vs2012")
wks = test.createWorkspace() wks = test.createWorkspace()
language "C#" language "C#"
end end

View File

@ -4,9 +4,10 @@
-- Copyright (c) 2012-2013 Jason Perkins and the Premake project -- Copyright (c) 2012-2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vstudio_cs2005_compiler_props") local suite = test.declare("vstudio_cs2005_compiler_props")
local cs2005 = premake.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
local project = premake.project local project = p.project
-- --
@ -16,7 +17,7 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.action.set("vs2005") p.action.set("vs2005")
wks, prj = test.createWorkspace() wks, prj = test.createWorkspace()
end end

View File

@ -4,9 +4,10 @@
-- Copyright (c) 2012-2013 Jason Perkins and the Premake project -- Copyright (c) 2012-2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vstudio_cs2005_debug_props") local suite = test.declare("vstudio_cs2005_debug_props")
local cs2005 = premake.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
local project = premake.project local project = p.project
-- --
@ -16,7 +17,7 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.action.set("vs2005") p.action.set("vs2005")
wks, prj = test.createWorkspace() wks, prj = test.createWorkspace()
end end

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2009-2014 Jason Perkins and the Premake project -- Copyright (c) 2009-2014 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vstudio_cs2005_files") local suite = test.declare("vstudio_cs2005_files")
local cs2005 = premake.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
-- --
@ -15,7 +16,7 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.action.set("vs2005") p.action.set("vs2005")
wks = test.createWorkspace() wks = test.createWorkspace()
end end

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2013 Jason Perkins and the Premake project -- Copyright (c) 2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vstudio_cs2005_icon") local suite = test.declare("vstudio_cs2005_icon")
local cs2005 = premake.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
-- --

View File

@ -4,9 +4,10 @@
-- Copyright (c) 2017 Jason Perkins and the Premake project -- Copyright (c) 2017 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vstudio_cs2005_nuget_config") local suite = test.declare("vstudio_cs2005_nuget_config")
local cs2005 = premake.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
local nuget2010 = premake.vstudio.nuget2010 local nuget2010 = p.vstudio.nuget2010
-- --
@ -16,7 +17,7 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.action.set("vs2010") p.action.set("vs2010")
wks = test.createWorkspace() wks = test.createWorkspace()
language "C#" language "C#"
end end

View File

@ -4,9 +4,10 @@
-- Copyright (c) 2012-2015 Jason Perkins and the Premake project -- Copyright (c) 2012-2015 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vstudio_cs2005_nuget_packages_config") local suite = test.declare("vstudio_cs2005_nuget_packages_config")
local cs2005 = premake.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
local nuget2010 = premake.vstudio.nuget2010 local nuget2010 = p.vstudio.nuget2010
-- --
@ -16,7 +17,7 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.action.set("vs2010") p.action.set("vs2010")
wks = test.createWorkspace() wks = test.createWorkspace()
language "C#" language "C#"
end end

View File

@ -4,9 +4,10 @@
-- Copyright (c) 2012-2013 Jason Perkins and the Premake project -- Copyright (c) 2012-2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vstudio_cs2005_output_props") local suite = test.declare("vstudio_cs2005_output_props")
local cs2005 = premake.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
local project = premake.project local project = p.project
-- --
@ -16,7 +17,7 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.action.set("vs2005") p.action.set("vs2005")
wks, prj = test.createWorkspace() wks, prj = test.createWorkspace()
language "C#" language "C#"
end end
@ -45,7 +46,7 @@
-- --
function suite.intermediateDirectory_onVs2008() function suite.intermediateDirectory_onVs2008()
premake.action.set("vs2008") p.action.set("vs2008")
prepare() prepare()
test.capture [[ test.capture [[
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
@ -54,7 +55,7 @@
end end
function suite.intermediateDirectory_onVs2010() function suite.intermediateDirectory_onVs2010()
premake.action.set("vs2010") p.action.set("vs2010")
prepare() prepare()
test.capture [[ test.capture [[
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2009-2015 Jason Perkins and the Premake project -- Copyright (c) 2009-2015 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vstudio_cs2005_platform_groups") local suite = test.declare("vstudio_cs2005_platform_groups")
local cs2005 = premake.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
-- --
-- Setup -- Setup
@ -14,7 +15,7 @@
local wks local wks
function suite.setup() function suite.setup()
premake.action.set("vs2010") p.action.set("vs2010")
wks = workspace("MyWorkspace") wks = workspace("MyWorkspace")
configurations { "Debug", "Release" } configurations { "Debug", "Release" }
language "C#" language "C#"
@ -32,7 +33,7 @@
-- --
function suite.vs2008() function suite.vs2008()
premake.action.set("vs2008") p.action.set("vs2008")
prepare() prepare()
test.capture [[ test.capture [[
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@ -41,7 +42,7 @@
function suite.vs2010() function suite.vs2010()
premake.action.set("vs2010") p.action.set("vs2010")
prepare() prepare()
test.capture [[ test.capture [[
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@ -55,7 +56,7 @@
-- --
function suite.vs2008_onAnyCpu() function suite.vs2008_onAnyCpu()
premake.action.set("vs2008") p.action.set("vs2008")
platforms "Any CPU" platforms "Any CPU"
prepare("Any CPU") prepare("Any CPU")
test.capture [[ test.capture [[
@ -65,7 +66,7 @@
function suite.vs2010_onAnyCpu() function suite.vs2010_onAnyCpu()
premake.action.set("vs2010") p.action.set("vs2010")
platforms "Any CPU" platforms "Any CPU"
prepare("Any CPU") prepare("Any CPU")
test.capture [[ test.capture [[

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2012 Jason Perkins and the Premake project -- Copyright (c) 2012 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vstudio_cs2005_project_refs") local suite = test.declare("vstudio_cs2005_project_refs")
local cs2005 = premake.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
-- --
@ -15,7 +16,7 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.action.set("vs2008") p.action.set("vs2008")
wks = test.createWorkspace() wks = test.createWorkspace()
uuid "00112233-4455-6677-8888-99AABBCCDDEE" uuid "00112233-4455-6677-8888-99AABBCCDDEE"
test.createproject(wks) test.createproject(wks)

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2013 Jason Perkins and the Premake project -- Copyright (c) 2013 Jason Perkins and the Premake project
-- --
local p = premake
local suite = test.declare("vs2012_csproj_targets") local suite = test.declare("vs2012_csproj_targets")
local cs2005 = premake.vstudio.cs2005 local cs2005 = p.vstudio.cs2005
-- --
@ -15,7 +16,7 @@
local wks, prj local wks, prj
function suite.setup() function suite.setup()
premake.action.set("vs2012") p.action.set("vs2012")
wks = test.createWorkspace() wks = test.createWorkspace()
language "C#" language "C#"
end end

Some files were not shown because too many files have changed in this diff Show More