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"))
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
_p(4, '<DebuggerSearchPaths/>')
end
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
_p(4, '<PostConnectCommands/>')
end
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
_p(4, '<StartupCommands/>')
end

View File

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

View File

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

View File

@ -6,7 +6,8 @@
---
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
function suite.setup()
premake.action.set("codelite")
premake.indent(" ")
p.action.set("codelite")
p.indent(" ")
wks = test.createWorkspace()
end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,7 +5,8 @@
---
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
function suite.setup()
premake.action.set("vs2010")
-- premake.escaper(premake.vstudio.vs2005.esc)
premake.indent(" ")
p.action.set("vs2010")
-- p.escaper(p.vstudio.vs2005.esc)
p.indent(" ")
wks = workspace "MyWorkspace"
configurations { "Debug", "Release" }
language "D"
@ -41,8 +42,8 @@
function suite.slnProj()
project "MyProject"
language "D"
premake.vstudio.sln2005.reorderProjects(wks)
premake.vstudio.sln2005.projects(wks)
p.vstudio.sln2005.reorderProjects(wks)
p.vstudio.sln2005.projects(wks)
test.capture [[
Project("{002A2DE9-8BB6-484D-9802-7E4AD4084715}") = "MyProject", "MyProject.visualdproj", "{42B5DBC6-AE1F-903D-F75D-41E363076E92}"
EndProject

View File

@ -6,9 +6,10 @@
local tdmd = {}
local project = premake.project
local config = premake.config
local d = premake.modules.d
local p = premake
local project = p.project
local config = p.config
local d = p.modules.d
--
-- Set default tools
@ -83,7 +84,7 @@
-- skip external project references, since I have no way
-- to know the actual output target path
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
-- path/libname.a to avoid linking a shared library of the same
-- name if one is present
@ -166,7 +167,7 @@
-- to know the actual output target path
if not link.project.externalname then
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))
end
end
@ -177,7 +178,7 @@
for _, link in ipairs(links) do
if path.isobjectfile(link) then
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)
end
end
@ -192,17 +193,17 @@
-- /////////////////////////////////////////////////////////////////////////
-- 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
-- TODO: on windows, we may use OPTLINK or MSLINK (for Win64)...
-- printf("TODO: select proper linker for 32/64 bit code")
premake.tools.dmd = tdmd.optlink
p.tools.dmd = tdmd.optlink
else
premake.tools.dmd = tdmd.gcc
p.tools.dmd = tdmd.gcc
end
local dmd = premake.tools.dmd
local dmd = p.tools.dmd
--
@ -265,18 +266,18 @@
if cfg.flags.Documentation then
if cfg.docname then
table.insert(flags, "-Df" .. premake.quoted(cfg.docname))
table.insert(flags, "-Df" .. p.quoted(cfg.docname))
end
if cfg.docdir then
table.insert(flags, "-Dd" .. premake.quoted(cfg.docdir))
table.insert(flags, "-Dd" .. p.quoted(cfg.docdir))
end
end
if cfg.flags.GenerateHeader then
if cfg.headername then
table.insert(flags, "-Hf" .. premake.quoted(cfg.headername))
table.insert(flags, "-Hf" .. p.quoted(cfg.headername))
end
if cfg.headerdir then
table.insert(flags, "-Hd" .. premake.quoted(cfg.headerdir))
table.insert(flags, "-Hd" .. p.quoted(cfg.headerdir))
end
end
@ -324,7 +325,7 @@
local result = {}
for _, dir in ipairs(dirs) do
dir = project.getrelative(cfg.project, dir)
table.insert(result, '-I' .. premake.quoted(dir))
table.insert(result, '-I' .. p.quoted(dir))
end
return result
end

View File

@ -4,12 +4,13 @@
-- 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 project = premake.project
local config = premake.config
local d = premake.modules.d
local gdc = p.tools.gdc
local project = p.project
local config = p.config
local d = p.modules.d
--
-- Set default tools
@ -83,18 +84,18 @@
if cfg.flags.Documentation then
if cfg.docname then
table.insert(flags, "-fdoc-file=" .. premake.quoted(cfg.docname))
table.insert(flags, "-fdoc-file=" .. p.quoted(cfg.docname))
end
if cfg.docdir then
table.insert(flags, "-fdoc-dir=" .. premake.quoted(cfg.docdir))
table.insert(flags, "-fdoc-dir=" .. p.quoted(cfg.docdir))
end
end
if cfg.flags.GenerateHeader then
if cfg.headername then
table.insert(flags, "-fintfc-file=" .. premake.quoted(cfg.headername))
table.insert(flags, "-fintfc-file=" .. p.quoted(cfg.headername))
end
if cfg.headerdir then
table.insert(flags, "-fintfc-dir=" .. premake.quoted(cfg.headerdir))
table.insert(flags, "-fintfc-dir=" .. p.quoted(cfg.headerdir))
end
end
@ -142,7 +143,7 @@
local result = {}
for _, dir in ipairs(dirs) do
dir = project.getrelative(cfg.project, dir)
table.insert(result, '-I' .. premake.quoted(dir))
table.insert(result, '-I' .. p.quoted(dir))
end
return result
end
@ -168,14 +169,14 @@
},
kind = {
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
table.insert(r, '-Wl,--out-implib="' .. cfg.linktarget.relpath .. '"')
end
return r
end,
WindowedApp = function(cfg)
if cfg.system == premake.WINDOWS then return "-mwindows" end
if cfg.system == p.WINDOWS then return "-mwindows" end
end,
},
}
@ -224,7 +225,7 @@
-- skip external project references, since I have no way
-- to know the actual output target path
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
-- path/libname.a to avoid linking a shared library of the same
-- name if one is present

View File

@ -4,12 +4,13 @@
-- 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 project = premake.project
local config = premake.config
local d = premake.modules.d
local ldc = p.tools.ldc
local project = p.project
local config = p.config
local d = p.modules.d
--
@ -89,18 +90,18 @@
if cfg.flags.Documentation then
if cfg.docname then
table.insert(flags, "-Df=" .. premake.quoted(cfg.docname))
table.insert(flags, "-Df=" .. p.quoted(cfg.docname))
end
if cfg.docdir then
table.insert(flags, "-Dd=" .. premake.quoted(cfg.docdir))
table.insert(flags, "-Dd=" .. p.quoted(cfg.docdir))
end
end
if cfg.flags.GenerateHeader then
if cfg.headername then
table.insert(flags, "-Hf=" .. premake.quoted(cfg.headername))
table.insert(flags, "-Hf=" .. p.quoted(cfg.headername))
end
if cfg.headerdir then
table.insert(flags, "-Hd=" .. premake.quoted(cfg.headerdir))
table.insert(flags, "-Hd=" .. p.quoted(cfg.headerdir))
end
end
@ -148,7 +149,7 @@
local result = {}
for _, dir in ipairs(dirs) do
dir = project.getrelative(cfg.project, dir)
table.insert(result, '-I=' .. premake.quoted(dir))
table.insert(result, '-I=' .. p.quoted(dir))
end
return result
end
@ -222,7 +223,7 @@
-- skip external project references, since I have no way
-- to know the actual output target path
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
-- path/libname.a to avoid linking a shared library of the same
-- name if one is present

View File

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

View File

@ -16,10 +16,10 @@
function m.capture(expected)
local actual = premake.captured() .. premake.eol()
local actual = p.captured() .. p.eol()
-- 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")
-- compare each value line by line
@ -109,7 +109,7 @@
function m.hasoutput()
local actual = premake.captured()
local actual = p.captured()
if actual == "" then
m.fail("expected output, received none");
end
@ -118,7 +118,7 @@
function m.isemptycapture()
local actual = premake.captured()
local actual = p.captured()
if actual ~= "" then
m.fail("expected empty capture, but was %s", actual);
end

View File

@ -6,7 +6,8 @@
---
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 xcode = premake.modules.xcode
local p = premake
local xcode = p.modules.xcode
--
@ -56,9 +57,9 @@
end
local function prepare()
wks = premake.oven.bakeWorkspace(wks)
wks = p.oven.bakeWorkspace(wks)
xcode.prepareWorkspace(wks)
local prj = premake.workspace.getproject(wks, 1)
local prj = p.workspace.getproject(wks, 1)
tr = xcode.buildprjtree(prj)
end

View File

@ -7,7 +7,8 @@
---
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 xcode = premake.modules.xcode
local p = premake
local xcode = p.modules.xcode
---------------------------------------------------------------------------
@ -35,9 +36,9 @@
end
local function prepare()
wks = premake.oven.bakeWorkspace(wks)
wks = p.oven.bakeWorkspace(wks)
xcode.prepareWorkspace(wks)
local prj3 = premake.workspace.getproject(wks, 1)
local prj3 = p.workspace.getproject(wks, 1)
--prj2 = test.getproject(wks, 2)
tr = xcode.buildprjtree(prj3)
end

View File

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

View File

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

View File

@ -287,7 +287,7 @@
function xcode.getxcodeprojname(prj)
-- if there is a workspace with matching name, then use "projectname1.xcodeproj"
-- just get something working for now
local fname = premake.filename(prj, ".xcodeproj")
local fname = p.filename(prj, ".xcodeproj")
return fname
end
@ -336,7 +336,7 @@
-- create and cache a list of supported platforms
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
local cfg = project.getconfig(prj, prj.configurations[1], prj.platforms[1])
@ -346,7 +346,7 @@
bundlepath = cfg.project.name
end
local node = premake.tree.new(path.getname(bundlepath))
local node = p.tree.new(path.getname(bundlepath))
node.cfg = cfg
node.id = xcode.newid(node.name, "product")
@ -1065,13 +1065,13 @@
local includedirs = project.getrelative(cfg.project, cfg.includedirs)
for i,v in ipairs(includedirs) do
cfg.includedirs[i] = premake.quoted(v)
cfg.includedirs[i] = p.quoted(v)
end
settings['USER_HEADER_SEARCH_PATHS'] = cfg.includedirs
local sysincludedirs = project.getrelative(cfg.project, cfg.sysincludedirs)
for i,v in ipairs(sysincludedirs) do
cfg.sysincludedirs[i] = premake.quoted(v)
cfg.sysincludedirs[i] = p.quoted(v)
end
if not table.isempty(cfg.sysincludedirs) then
table.insert(cfg.sysincludedirs, "$(inherited)")
@ -1079,19 +1079,19 @@
settings['HEADER_SEARCH_PATHS'] = cfg.sysincludedirs
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
settings['LIBRARY_SEARCH_PATHS'] = cfg.libdirs
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
settings['FRAMEWORK_SEARCH_PATHS'] = cfg.frameworkdirs
local objDir = path.getrelative(tr.project.location, cfg.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
local checks = {

View File

@ -145,7 +145,7 @@
xcnode.targetdependid = xcode.newid(xcnode.name, "targdep")
-- 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])
node = tree.insert(xcnode, tree.new(cfg.linktarget.name))
node.path = cfg.linktarget.fullpath

View File

@ -96,7 +96,7 @@
function m.prepareEnvironment()
math.randomseed(os.time())
_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
@ -171,14 +171,14 @@
-- The "next-gen" actions have now replaced their deprecated counterparts.
-- Provide a warning for a little while before I remove them entirely.
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
premake.action.set(_ACTION)
p.action.set(_ACTION)
-- Allow the action to initialize stuff.
local action = premake.action.current()
local action = p.action.current()
if action then
premake.action.initialize(action.trigger)
p.action.initialize(action.trigger)
end
end
@ -218,13 +218,13 @@
end
if (_OPTIONS["help"]) then
premake.showhelp()
p.showhelp()
os.exit(1)
end
-- Validate the command-line arguments. This has to happen after the
-- 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
print("Error: " .. err)
os.exit(1)
@ -237,7 +237,7 @@
os.exit(1)
end
local action = premake.action.current()
local action = p.action.current()
if not action then
print("Error: no such action '" .. _ACTION .. "'")
os.exit(1)
@ -268,7 +268,7 @@
function m.bake()
if p.action.isConfigurable() then
premake.oven.bake()
p.oven.bake()
end
end
@ -317,7 +317,7 @@
---
function m.preAction()
local action = premake.action.current()
local action = p.action.current()
printf("Running action '%s'...", action.trigger)
end
@ -327,8 +327,8 @@
---
function m.callAction()
local action = premake.action.current()
premake.action.call(action.trigger)
local action = p.action.current()
p.action.call(action.trigger)
end

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2002-2015 Jason Perkins and the Premake project
--
premake.make = {}
local p = premake
p.make = {}
local make = p.make
local project = p.project
@ -34,32 +34,32 @@
end,
onWorkspace = function(wks)
premake.escaper(make.esc)
premake.generate(wks, make.getmakefilename(wks, false), make.generate_workspace)
p.escaper(make.esc)
p.generate(wks, make.getmakefilename(wks, false), make.generate_workspace)
end,
onProject = function(prj)
premake.escaper(make.esc)
p.escaper(make.esc)
local makefile = make.getmakefilename(prj, true)
if prj.kind == premake.UTILITY then
premake.generate(prj, makefile, make.utility.generate)
elseif prj.kind == premake.MAKEFILE then
premake.generate(prj, makefile, make.makefile.generate)
if prj.kind == p.UTILITY then
p.generate(prj, makefile, make.utility.generate)
elseif prj.kind == p.MAKEFILE then
p.generate(prj, makefile, make.makefile.generate)
else
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
premake.generate(prj, makefile, make.cpp.generate)
p.generate(prj, makefile, make.cpp.generate)
end
end
end,
onCleanWorkspace = function(wks)
premake.clean.file(wks, make.getmakefilename(wks, false))
p.clean.file(wks, make.getmakefilename(wks, false))
end,
onCleanProject = function(prj)
premake.clean.file(prj, make.getmakefilename(prj, true))
p.clean.file(prj, make.getmakefilename(prj, true))
end
}
@ -144,7 +144,7 @@
function make.header(target)
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('')
if kind == "workspace" then
@ -205,7 +205,7 @@
if #result then
result = result .. " "
end
result = result .. premake.quoted(v)
result = result .. p.quoted(v)
end
return result
else
@ -236,7 +236,7 @@
---------------------------------------------------------------------------
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

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 = {}
@ -44,8 +44,8 @@
end
function make.cpp.generate(prj)
premake.eol("\n")
premake.callArray(cpp.elements.makefile, prj)
p.eol("\n")
p.callArray(cpp.elements.makefile, prj)
end
@ -84,13 +84,13 @@
-- identify the toolset used by this configurations (would be nicer if
-- 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
error("Invalid toolset '" .. cfg.toolset .. "'")
end
_x('ifeq ($(config),%s)', cfg.shortname)
premake.callArray(cpp.elements.configuration, cfg, toolset)
p.callArray(cpp.elements.configuration, cfg, toolset)
_p('endif')
_p('')
end
@ -122,7 +122,7 @@
function make.cppFileRules(prj)
local tr = project.getsourcetree(prj)
premake.tree.traverse(tr, {
p.tree.traverse(tr, {
onleaf = function(node, depth)
-- check to see if this file has custom rules
local rules
@ -207,7 +207,7 @@
-- now walk the list of files in the project
local tr = project.getsourcetree(prj)
premake.tree.traverse(tr, {
p.tree.traverse(tr, {
onleaf = function(node, depth)
-- figure out what configurations contain this file, and
-- if it uses custom build rules
@ -316,7 +316,7 @@
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('\t@:')
_p('')
@ -423,7 +423,7 @@
function make.ldDeps(cfg, toolset)
local deps = config.getlinks(cfg, "siblings", "fullpath")
_p(' LDDEPS +=%s', make.list(premake.esc(deps)))
_p(' LDDEPS +=%s', make.list(p.esc(deps)))
end
@ -440,13 +440,13 @@
function make.linkCmd(cfg, toolset)
if cfg.kind == premake.STATICLIB then
if cfg.architecture == premake.UNIVERSAL then
if cfg.kind == p.STATICLIB then
if cfg.architecture == p.UNIVERSAL then
_p(' LINKCMD = libtool -o "$@" $(OBJECTS)')
else
_p(' LINKCMD = $(AR) ' .. (toolset.arargs or '-rcs') ..' "$@" $(OBJECTS)')
end
elseif cfg.kind == premake.UTILITY then
elseif cfg.kind == p.UTILITY then
-- Empty LINKCMD for Utility (only custom build rules)
_p(' LINKCMD =')
else

View File

@ -4,16 +4,17 @@
-- Copyright (c) 2002-2013 Jason Perkins and the Premake project
--
premake.make.cs = {}
local make = premake.make
local cs = premake.make.cs
local project = premake.project
local config = premake.config
local fileconfig = premake.fileconfig
local p = premake
p.make.cs = {}
local make = p.make
local cs = p.make.cs
local project = p.project
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 = {}
@ -52,9 +53,9 @@
--
function make.cs.generate(prj)
premake.eol("\n")
local toolset = premake.tools.dotnet
premake.callArray(cs.elements.makefile, prj, toolset)
p.eol("\n")
local toolset = p.tools.dotnet
p.callArray(cs.elements.makefile, prj, toolset)
end
@ -79,7 +80,7 @@
function make.csConfigs(prj, toolset)
for cfg in project.eachconfig(prj) do
_x('ifeq ($(config),%s)', cfg.shortname)
premake.callArray(cs.elements.configuration, cfg, toolset)
p.callArray(cs.elements.configuration, cfg, toolset)
_p('endif')
_p('')
end
@ -98,7 +99,7 @@
if dir ~= "." then
name = name .. path.translate(dir, ".") .. "."
end
return "$(OBJDIR)/" .. premake.esc(name .. path.getbasename(fname)) .. ".resources"
return "$(OBJDIR)/" .. p.esc(name .. path.getbasename(fname)) .. ".resources"
else
return fname
end
@ -111,7 +112,7 @@
function cs.listsources(prj, selector)
local tr = project.getsourcetree(prj)
premake.tree.traverse(tr, {
p.tree.traverse(tr, {
onleaf = function(node, depth)
local value = selector(node)
if value then
@ -186,9 +187,9 @@
function make.csResponseRules(prj)
local toolset = premake.tools.dotnet
local toolset = p.tools.dotnet
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)
_p('$(RESPONSE): %s', makefile)
@ -202,7 +203,7 @@
local sep = os.istarget("windows") and "\\" or "/"
local tr = project.getsourcetree(prj)
premake.tree.traverse(tr, {
p.tree.traverse(tr, {
onleaf = function(node, depth)
if toolset.fileinfo(node).action == "Compile" then
_x('\t@echo %s >> $(RESPONSE)', path.translate(node.relpath, sep))
@ -232,10 +233,10 @@
--[[
-- porting from 4.x
_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())
for target, source in pairs(cfgpairs[cfg]) do
premake.make_copyrule(source, target)
p.make_copyrule(source, target)
end
_p('endif')
_p('')
@ -243,7 +244,7 @@
_p('# Copied file rules')
for target, source in pairs(copypairs) do
premake.make_copyrule(source, target)
p.make_copyrule(source, target)
end
_p('# Embedded file rules')
@ -264,7 +265,7 @@
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(' REFERENCES = %s', table.implode(deps, "/r:", "", " "))
end
@ -276,10 +277,10 @@
local cfg = project.getfirstconfig(prj)
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), " "))
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('')
end

View File

@ -14,7 +14,7 @@
local fileconfig = p.fileconfig
---
-- Add namespace for element definition lists for premake.callarray()
-- Add namespace for element definition lists for p.callarray()
---
makefile.elements = {}
@ -30,8 +30,8 @@
}
function make.makefile.generate(prj)
premake.eol("\n")
premake.callarray(make, makefile.elements.makefile, prj)
p.eol("\n")
p.callarray(make, makefile.elements.makefile, prj)
end
@ -46,13 +46,13 @@
-- identify the toolset used by this configurations (would be nicer if
-- 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
error("Invalid toolset '" .. cfg.toolset .. "'")
end
_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('')
end

View File

@ -14,7 +14,7 @@
local fileconfig = p.fileconfig
---
-- Add namespace for element definition lists for premake.callarray()
-- Add namespace for element definition lists for p.callarray()
---
utility.elements = {}
@ -30,8 +30,8 @@
}
function make.utility.generate(prj)
premake.eol("\n")
premake.callarray(make, utility.elements.makefile, prj)
p.eol("\n")
p.callarray(make, utility.elements.makefile, prj)
end
@ -46,13 +46,13 @@
-- identify the toolset used by this configurations (would be nicer if
-- 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
error("Invalid toolset '" .. cfg.toolset .. "'")
end
_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('')
end

View File

@ -58,7 +58,7 @@
function make.cleanrules(wks)
_p('clean:')
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 prjname = path.getname(prjpath)
_x(1,'@${MAKE} --no-print-directory -C %s -f %s clean', prjdir, prjname)
@ -101,7 +101,7 @@
--
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('')
end
@ -167,14 +167,14 @@
for prj in p.workspace.eachproject(wks) do
local deps = project.getdependencies(prj)
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)
_p('ifneq (,$(%s_config))', 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 prjname = path.getname(prjpath)

View File

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

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2008-2015 Jason Perkins and the Premake project
--
premake.vstudio.vs2005 = {}
local p = premake
p.vstudio.vs2005 = {}
local vs2005 = p.vstudio.vs2005
local vstudio = p.vstudio
@ -20,7 +20,7 @@
p.eol("\r\n")
p.escaper(vs2005.esc)
premake.generate(wks, ".sln", vstudio.sln2005.generate)
p.generate(wks, ".sln", vstudio.sln2005.generate)
end
@ -29,8 +29,8 @@
p.eol("\r\n")
p.escaper(vs2005.esc)
if premake.project.isdotnet(prj) then
premake.generate(prj, ".csproj", vstudio.cs2005.generate)
if p.project.isdotnet(prj) then
p.generate(prj, ".csproj", vstudio.cs2005.generate)
-- Skip generation of empty user files
local user = p.capture(function() vstudio.cs2005.generateUser(prj) end)
@ -38,7 +38,7 @@
p.generate(prj, ".csproj.user", function() p.outln(user) end)
end
else
premake.generate(prj, ".vcproj", vstudio.vc200x.generate)
p.generate(prj, ".vcproj", vstudio.vc200x.generate)
-- Skip generation of empty user files
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
--
premake.vstudio.cs2005 = {}
local p = premake
p.vstudio.cs2005 = {}
local vstudio = p.vstudio
local cs2005 = p.vstudio.cs2005
local project = p.project
@ -35,7 +35,7 @@
function cs2005.generate(prj)
p.utf8()
premake.callarray(cs2005, cs2005.elements.project, prj)
p.callarray(cs2005, cs2005.elements.project, prj)
_p(1,'<ItemGroup>')
cs2005.files(prj)
@ -55,7 +55,7 @@
function cs2005.projectElement(prj)
local ver = ''
local action = premake.action.current()
local action = p.action.current()
if action.vstudio.toolsVersion then
ver = string.format(' ToolsVersion="%s"', action.vstudio.toolsVersion)
end
@ -86,7 +86,7 @@
function cs2005.projectProperties(prj)
_p(1,'<PropertyGroup>')
local cfg = project.getfirstconfig(prj)
premake.callarray(cs2005, cs2005.elements.projectProperties, cfg)
p.callarray(cs2005, cs2005.elements.projectProperties, cfg)
_p(1,'</PropertyGroup>')
end
@ -109,7 +109,7 @@
end
function cs2005.configuration(cfg)
premake.callarray(cs2005, cs2005.elements.configuration, cfg)
p.callarray(cs2005, cs2005.elements.configuration, cfg)
_p(1,'</PropertyGroup>')
end
@ -142,7 +142,7 @@
-- Process any sub-elements required by this file; choose the write
-- 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
local elements = {
"AutoGen",
@ -190,7 +190,7 @@
local firstcfg = project.getfirstconfig(prj)
local tr = project.getsourcetree(prj)
premake.tree.traverse(tr, {
p.tree.traverse(tr, {
onleaf = function(node, depth)
-- test if all fileinfo's are going to be the same for each config.
local allsame = true
@ -373,7 +373,7 @@
local packageAPIInfo = vstudio.nuget2010.packageAPIInfo(prj, package)
local cfg = p.project.getfirstconfig(prj)
local action = premake.action.current()
local action = p.action.current()
local targetFramework = cfg.dotnetframework or action.vstudio.targetFramework
-- This is a bit janky. To compare versions, we extract all
@ -601,7 +601,7 @@
function cs2005.productVersion(cfg)
local action = premake.action.current()
local action = p.action.current()
if action.vstudio.productVersion then
_p(2,'<ProductVersion>%s</ProductVersion>', action.vstudio.productVersion)
end
@ -625,7 +625,7 @@
function cs2005.schemaVersion(cfg)
local action = premake.action.current()
local action = p.action.current()
if action.vstudio.csprojSchemaVersion then
_p(2,'<SchemaVersion>%s</SchemaVersion>', action.vstudio.csprojSchemaVersion)
end
@ -633,7 +633,7 @@
function cs2005.targetFrameworkVersion(cfg)
local action = premake.action.current()
local action = p.action.current()
local framework = cfg.dotnetframework or action.vstudio.targetFramework
if framework then
_p(2,'<TargetFrameworkVersion>v%s</TargetFrameworkVersion>', framework)

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2009-2015 Jason Perkins and the Premake project
--
premake.vstudio.sln2005 = {}
local p = premake
p.vstudio.sln2005 = {}
local vstudio = p.vstudio
local sln2005 = p.vstudio.sln2005
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 = {}
@ -41,8 +41,8 @@
function sln2005.generate(wks)
-- Mark the file as Unicode
premake.utf8()
premake.outln('')
p.utf8()
p.outln('')
sln2005.reorderProjects(wks)
@ -62,7 +62,7 @@
--
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('# Visual Studio %s', action.vstudio.versionName)
end
@ -200,7 +200,7 @@
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)
end
end

View File

@ -4,9 +4,10 @@
-- Copyright (c) 2008-2013 Jason Perkins and the Premake project
--
premake.vstudio.vs2008 = {}
local vs2008 = premake.vstudio.vs2008
local vstudio = premake.vstudio
local p = premake
p.vstudio.vs2008 = {}
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
--
premake.vstudio.vc200x = {}
local m = premake.vstudio.vc200x
local p = premake
p.vstudio.vc200x = {}
local m = p.vstudio.vc200x
local vstudio = p.vstudio
local context = p.context
local project = p.project
@ -219,7 +219,7 @@
end
function m.tools(cfg)
premake.callArray(m.elements.tools, cfg, config.toolset(cfg))
p.callArray(m.elements.tools, cfg, config.toolset(cfg))
end

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2009-2015 Jason Perkins and the Premake project
--
premake.vstudio.vs2010 = {}
local p = premake
p.vstudio.vs2010 = {}
local vs2010 = p.vstudio.vs2010
local vstudio = p.vstudio
local project = p.project
@ -69,7 +69,7 @@
-- Only generate a filters file if the source tree actually has subfolders
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

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2016 Jason Perkins and the Premake project
--
premake.vstudio.nuget2010 = {}
local p = premake
p.vstudio.nuget2010 = {}
local vstudio = p.vstudio
local nuget2010 = p.vstudio.nuget2010
local cs2005 = p.vstudio.cs2005
@ -30,7 +30,7 @@
function nuget2010.packageFramework(prj)
if p.project.isdotnet(prj) then
local cfg = p.project.getfirstconfig(prj)
local action = premake.action.current()
local action = p.action.current()
local framework = cfg.dotnetframework or action.vstudio.targetFramework
return cs2005.formatNuGetFrameworkVersion(framework)
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
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
---
premake.vstudio.vs2010.rules.targets = {}
local m = premake.vstudio.vs2010.rules.targets
m.elements = {}
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
--
premake.vstudio.vs2010.rules.xml = {}
local m = premake.vstudio.vs2010.rules.xml
m.elements = {}
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
--
premake.vstudio.vc2010 = {}
local p = premake
p.vstudio.vc2010 = {}
local vstudio = p.vstudio
local project = p.project
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 = {}

View File

@ -29,7 +29,7 @@
--
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">',
action.vstudio.filterToolsVersion or action.vstudio.toolsVersion)
end

View File

@ -53,7 +53,7 @@
--
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">',
action.vstudio.toolsVersion)
end

View File

@ -4,12 +4,11 @@
-- 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 vc2010 = vstudio.vc2010
local p = premake
---
-- Define the Visual Studio 2010 export action.

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@
local p = premake
p.action = {}
local action = premake.action
local action = p.action
@ -62,7 +62,7 @@
end
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.os = nil
end
@ -272,7 +272,7 @@
-- @return
-- True if the configuration is supported, false otherwise.
--
function premake.action.supportsconfig(action, cfg)
function p.action.supportsconfig(action, cfg)
if not action then
return false
end

View File

@ -8,7 +8,7 @@
local p = premake
p.api = {}
local api = premake.api
local api = p.api
local configset = p.configset
@ -81,7 +81,7 @@
---
function includeexternal(fname)
local fullPath = premake.findProjectScript(fname)
local fullPath = p.findProjectScript(fname)
api._isIncludingExternal = true
fname = fullPath or fname
dofile(fname)
@ -248,7 +248,7 @@
end
-- add this new field to my master list
field, err = premake.field.new(field)
field, err = p.field.new(field)
if not field then
error(err)
end
@ -258,7 +258,7 @@
-- use this information when expanding tokens, to ensure that the paths
-- 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
-- lists to speed up value checking later on.
@ -281,7 +281,7 @@
return api.storeField(field, value)
end
if premake.field.removes(field) then
if p.field.removes(field) then
_G["remove" .. name] = function(value)
return api.remove(field, value)
end
@ -299,9 +299,9 @@
function api.unregister(field)
if type(field) == "string" then
field = premake.field.get(field)
field = p.field.get(field)
end
premake.field.unregister(field)
p.field.unregister(field)
_G[field.name] = nil
_G["remove" .. field.name] = nil
end
@ -338,7 +338,7 @@
--
function api.addAllowed(fieldName, value)
local field = premake.field.get(fieldName)
local field = p.field.get(fieldName)
if not field then
error("No such field: " .. fieldName, 2)
end
@ -367,7 +367,7 @@
--
function api.addAliases(fieldName, value)
local field = premake.field.get(fieldName)
local field = p.field.get(fieldName)
if not field then
error("No such field: " .. fieldName, 2)
end
@ -395,7 +395,7 @@
--
function api.deprecateField(name, message, handler)
premake.fields[name].deprecated = {
p.fields[name].deprecated = {
handler = handler,
message = message
}
@ -427,7 +427,7 @@
api.deprecateValue(name, v, message, addHandler, removeHandler)
end
else
local field = premake.fields[name]
local field = p.fields[name]
field.deprecated = field.deprecated or {}
field.deprecated[value] = {
add = addHandler,
@ -490,7 +490,7 @@
if field.deprecated and type(field.deprecated.handler) == "function" then
field.deprecated.handler(value)
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
end
end
@ -542,7 +542,7 @@
if handler.remove then handler.remove(value) end
if handler.message and api._deprecations ~= "off" then
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
error { msg="deprecation errors enabled" }
end
@ -648,7 +648,7 @@
handler.add(canonical)
if handler.message and api._deprecations ~= "off" then
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
return nil, "deprecation errors enabled"
end
@ -1142,7 +1142,7 @@
--
function newaction(a)
premake.action.add(a)
p.action.add(a)
end
@ -1154,5 +1154,5 @@
--
function newoption(opt)
premake.option.add(opt)
p.option.add(opt)
end

View File

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

View File

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

View File

@ -12,8 +12,9 @@
-- Copyright (c) 2014 Jason Perkins and the Premake project
---
premake.field = {}
local field = premake.field
local p = premake
p.field = {}
local field = p.field
-- 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
-- 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
-- picked up by future operations.
---
function field.override(fieldName, accessorName, func)
local kind = field.kind(fieldName)
premake.override(kind, accessorName, func)
p.override(kind, accessorName, func)
field._accessors = {}
end

View File

@ -4,9 +4,9 @@
-- Copyright (c) 2011-2014 Jason Perkins and the Premake project
--
premake.fileconfig = {}
local p = premake
p.fileconfig = {}
local fileconfig = p.fileconfig
local context = p.context
local project = p.project
@ -184,7 +184,7 @@
--
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
local value = fcfg[field.name]
if value then

View File

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

View File

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

View File

@ -261,7 +261,7 @@
local platform = pairing[2]
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
end
end
@ -405,7 +405,7 @@
local pairings = table.fold(buildcfgs, platforms)
for _, pairing in ipairs(pairings) do
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)
end
end

View File

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

View File

@ -16,7 +16,7 @@
-- @param identifier
-- A toolset identifier composed of two parts: the toolset name,
-- 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.
--
-- 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
--
premake.tree = {}
local tree = premake.tree
local p = premake
p.tree = {}
local tree = p.tree
--

View File

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

View File

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

View File

@ -5,10 +5,11 @@
--
premake.tools.dotnet = {}
local dotnet = premake.tools.dotnet
local project = premake.project
local config = premake.config
local p = premake
p.tools.dotnet = {}
local dotnet = p.tools.dotnet
local project = p.project
local config = p.config
--
@ -50,7 +51,7 @@
info.action = "Resource"
elseif ext == ".xaml" 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"
else
info.action = "ApplicationDefinition"

View File

@ -199,7 +199,7 @@
table.foreachi(cfg.forceincludes, function(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)
return result
@ -214,11 +214,11 @@
local result = {}
for _, dir in ipairs(dirs) do
dir = project.getrelative(cfg.project, dir)
table.insert(result, '-I' .. premake.quoted(dir))
table.insert(result, '-I' .. p.quoted(dir))
end
for _, dir in ipairs(sysdirs or {}) do
dir = project.getrelative(cfg.project, dir)
table.insert(result, '-isystem ' .. premake.quoted(dir))
table.insert(result, '-isystem ' .. p.quoted(dir))
end
return result
end
@ -230,8 +230,8 @@
function gcc.getrunpathdirs(cfg, dirs)
local result = {}
if not ((cfg.system == premake.MACOSX)
or (cfg.system == premake.LINUX)) then
if not ((cfg.system == p.MACOSX)
or (cfg.system == p.LINUX)) then
return result
end
@ -247,7 +247,7 @@
-- Automatically add linked shared libraries path relative to target directory
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 rpath = path.getrelative(cfg.buildtarget.directory, fullpath)
if not (table.contains(rpaths, rpath)) then
@ -257,9 +257,9 @@
end
for _, rpath in ipairs(rpaths) do
if (cfg.system == premake.MACOSX) then
if (cfg.system == p.MACOSX) then
rpath = "@loader_path/" .. rpath
elseif (cfg.system == premake.LINUX) then
elseif (cfg.system == p.LINUX) then
rpath = iif(rpath == ".", "", "/" .. rpath)
rpath = "$$ORIGIN" .. rpath
end
@ -276,7 +276,7 @@
function gcc.ldsymbols(cfg)
-- 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
gcc.ldflags = {
@ -289,18 +289,18 @@
},
kind = {
SharedLib = function(cfg)
local r = { iif(cfg.system == premake.MACOSX, "-dynamiclib", "-shared") }
if cfg.system == premake.WINDOWS and not cfg.flags.NoImportLib then
local r = { iif(cfg.system == p.MACOSX, "-dynamiclib", "-shared") }
if cfg.system == p.WINDOWS and not cfg.flags.NoImportLib then
table.insert(r, '-Wl,--out-implib="' .. cfg.linktarget.relpath .. '"')
elseif cfg.system == premake.LINUX then
table.insert(r, '-Wl,-soname=' .. premake.quoted(cfg.linktarget.name))
elseif cfg.system == premake.MACOSX then
table.insert(r, '-Wl,-install_name,' .. premake.quoted('@rpath/' .. cfg.linktarget.name))
elseif cfg.system == p.LINUX then
table.insert(r, '-Wl,-soname=' .. p.quoted(cfg.linktarget.name))
elseif cfg.system == p.MACOSX then
table.insert(r, '-Wl,-install_name,' .. p.quoted('@rpath/' .. cfg.linktarget.name))
end
return r
end,
WindowedApp = function(cfg)
if cfg.system == premake.WINDOWS then return "-mwindows" end
if cfg.system == p.WINDOWS then return "-mwindows" end
end,
},
system = {
@ -327,14 +327,14 @@
architecture = {
x86 = function (cfg)
local r = {}
if cfg.system ~= premake.MACOSX then
if cfg.system ~= p.MACOSX then
table.insert (r, "-L/usr/lib32")
end
return r
end,
x86_64 = function (cfg)
local r = {}
if cfg.system ~= premake.MACOSX then
if cfg.system ~= p.MACOSX then
table.insert (r, "-L/usr/lib64")
end
return r
@ -352,12 +352,12 @@
-- paths, add those to the list of library search paths. The call
-- config.getlinks() all includes cfg.libdirs.
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
if cfg.flags.RelativeLinks then
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
table.insert(flags, libFlag)
end
@ -365,7 +365,7 @@
end
for _, dir in ipairs(cfg.syslibdirs) do
table.insert(flags, '-L' .. premake.quoted(dir))
table.insert(flags, '-L' .. p.quoted(dir))
end
return flags

View File

@ -189,7 +189,7 @@
table.foreachi(cfg.forceincludes, function(value)
local fn = project.getrelative(cfg.project, value)
table.insert(result, "/FI" .. premake.quoted(fn))
table.insert(result, "/FI" .. p.quoted(fn))
end)
return result
@ -208,7 +208,7 @@
dirs = table.join(dirs, sysdirs)
for _, dir in ipairs(dirs) do
dir = project.getrelative(cfg.project, dir)
table.insert(result, '-I' .. premake.quoted(dir))
table.insert(result, '-I' .. p.quoted(dir))
end
return result
end
@ -241,7 +241,7 @@
}
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)
table.insert(flags, 1, "/NOLOGO")

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2012 Jason Perkins and the Premake project
--
local p = premake
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
--
local p = premake
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
--
local p = premake
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
--
local p = premake
local suite = test.declare("make_help_rule")
@ -19,7 +20,7 @@
local function prepare()
wks = test.getWorkspace(wks)
premake.make.helprule(wks)
p.make.helprule(wks)
end

View File

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

View File

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

View File

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

View File

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

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2012-2013 Jason Perkins and the Premake project
--
local p = premake
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
function suite.setup()
premake.action.set("vs2005")
premake.escaper(premake.vstudio.vs2010.esc)
p.action.set("vs2005")
p.escaper(p.vstudio.vs2010.esc)
wks = test.createWorkspace()
end

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2013 Jason Perkins and the Premake project
--
local p = premake
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
function suite.setup()
premake.action.set("vs2012")
p.action.set("vs2012")
wks = test.createWorkspace()
language "C#"
end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,8 +4,9 @@
-- Copyright (c) 2012 Jason Perkins and the Premake project
--
local p = premake
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
function suite.setup()
premake.action.set("vs2008")
p.action.set("vs2008")
wks = test.createWorkspace()
uuid "00112233-4455-6677-8888-99AABBCCDDEE"
test.createproject(wks)

View File

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

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