From fa3328440e2ecf111e4c5387e7fba68d58935140 Mon Sep 17 00:00:00 2001 From: Sam Surtees Date: Tue, 25 Apr 2017 15:44:13 +1000 Subject: [PATCH] Increased consistency of p. usage --- modules/codelite/codelite_project.lua | 6 +-- .../codelite/tests/test_codelite_config.lua | 7 +-- .../codelite/tests/test_codelite_project.lua | 9 ++-- .../tests/test_codelite_workspace.lua | 7 +-- modules/d/d.lua | 2 +- modules/d/tests/test_dmd.lua | 15 ++++--- modules/d/tests/test_gdc.lua | 15 ++++--- modules/d/tests/test_gmake.lua | 17 +++---- modules/d/tests/test_ldc.lua | 15 ++++--- modules/d/tests/test_visualstudio.lua | 13 +++--- modules/d/tools/dmd.lua | 31 ++++++------- modules/d/tools/gdc.lua | 27 +++++------ modules/d/tools/ldc.lua | 23 +++++----- modules/raw/raw_action.lua | 5 ++- modules/self-test/test_assertions.lua | 8 ++-- modules/xcode/tests/test_header_footer.lua | 3 +- modules/xcode/tests/test_xcode4_project.lua | 7 +-- modules/xcode/tests/test_xcode4_workspace.lua | 3 +- .../xcode/tests/test_xcode_dependencies.lua | 7 +-- modules/xcode/tests/test_xcode_project.lua | 17 +++---- modules/xcode/xcode4_workspace.lua | 2 +- modules/xcode/xcode_common.lua | 16 +++---- modules/xcode/xcode_project.lua | 2 +- src/_premake_main.lua | 24 +++++----- src/actions/make/_make.lua | 32 ++++++------- src/actions/make/make_cpp.lua | 24 +++++----- src/actions/make/make_csharp.lua | 45 ++++++++++--------- src/actions/make/make_makefile.lua | 10 ++--- src/actions/make/make_utility.lua | 10 ++--- src/actions/make/make_workspace.lua | 8 ++-- src/actions/vstudio/_vstudio.lua | 16 +++---- src/actions/vstudio/vs2005.lua | 12 ++--- src/actions/vstudio/vs2005_csproj.lua | 24 +++++----- src/actions/vstudio/vs2005_solution.lua | 14 +++--- src/actions/vstudio/vs2008.lua | 7 +-- src/actions/vstudio/vs200x_vcproj.lua | 8 ++-- src/actions/vstudio/vs2010.lua | 6 +-- src/actions/vstudio/vs2010_nuget.lua | 6 +-- src/actions/vstudio/vs2010_rules_props.lua | 10 ++--- src/actions/vstudio/vs2010_rules_targets.lua | 9 ++-- src/actions/vstudio/vs2010_rules_xml.lua | 9 ++-- src/actions/vstudio/vs2010_vcxproj.lua | 6 +-- .../vstudio/vs2010_vcxproj_filters.lua | 2 +- src/actions/vstudio/vs2010_vcxproj_user.lua | 2 +- src/actions/vstudio/vs2012.lua | 5 +-- src/actions/vstudio/vs2013.lua | 4 +- src/actions/vstudio/vs2015.lua | 4 +- src/actions/vstudio/vs2017.lua | 4 +- src/base/action.lua | 6 +-- src/base/api.lua | 32 ++++++------- src/base/config.lua | 6 +-- src/base/detoken.lua | 4 +- src/base/field.lua | 9 ++-- src/base/fileconfig.lua | 6 +-- src/base/languages.lua | 6 +-- src/base/option.lua | 15 ++++--- src/base/oven.lua | 4 +- src/base/premake.lua | 32 ++++++------- src/base/tools.lua | 2 +- src/base/tree.lua | 5 ++- src/base/validation.lua | 5 +-- src/tools/clang.lua | 21 ++++----- src/tools/dotnet.lua | 11 ++--- src/tools/gcc.lua | 42 ++++++++--------- src/tools/msc.lua | 6 +-- tests/actions/make/cpp/test_clang.lua | 9 ++-- tests/actions/make/cpp/test_file_rules.lua | 9 ++-- tests/actions/make/cpp/test_flags.lua | 9 ++-- tests/actions/make/cpp/test_ldflags.lua | 17 +++---- tests/actions/make/cpp/test_make_linking.lua | 9 ++-- tests/actions/make/cpp/test_make_pch.lua | 5 ++- tests/actions/make/cpp/test_target_rules.lua | 5 ++- tests/actions/make/cpp/test_tools.lua | 9 ++-- tests/actions/make/cpp/test_wiidev.lua | 11 ++--- tests/actions/make/cs/test_embed_files.lua | 11 ++--- tests/actions/make/cs/test_flags.lua | 9 ++-- tests/actions/make/cs/test_links.lua | 9 ++-- tests/actions/make/cs/test_response.lua | 5 ++- tests/actions/make/cs/test_sources.lua | 11 ++--- tests/actions/make/test_make_escaping.lua | 3 +- tests/actions/make/test_make_tovar.lua | 3 +- .../make/workspace/test_config_maps.lua | 3 +- .../make/workspace/test_group_rule.lua | 3 +- .../actions/make/workspace/test_help_rule.lua | 3 +- .../make/workspace/test_project_rule.lua | 5 ++- .../actions/vstudio/cs2005/projectelement.lua | 13 +++--- .../vstudio/cs2005/projectsettings.lua | 14 +++--- .../vstudio/cs2005/test_assembly_refs.lua | 6 +-- .../vstudio/cs2005/test_build_events.lua | 7 +-- .../vstudio/cs2005/test_common_props.lua | 5 ++- .../vstudio/cs2005/test_compiler_props.lua | 7 +-- .../vstudio/cs2005/test_debug_props.lua | 7 +-- tests/actions/vstudio/cs2005/test_files.lua | 5 ++- tests/actions/vstudio/cs2005/test_icon.lua | 3 +- .../vstudio/cs2005/test_nuget_config.lua | 7 +-- .../cs2005/test_nuget_packages_config.lua | 7 +-- .../vstudio/cs2005/test_output_props.lua | 11 ++--- .../vstudio/cs2005/test_platform_groups.lua | 13 +++--- .../vstudio/cs2005/test_project_refs.lua | 5 ++- tests/actions/vstudio/cs2005/test_targets.lua | 5 ++- .../actions/vstudio/cs2005/test_user_file.lua | 5 ++- .../vstudio/sln2005/test_dependencies.lua | 9 ++-- tests/actions/vstudio/sln2005/test_header.lua | 13 +++--- .../vstudio/sln2005/test_nested_projects.lua | 6 +-- .../vstudio/sln2005/test_platforms.lua | 5 ++- .../actions/vstudio/sln2005/test_projects.lua | 7 +-- .../actions/vstudio/sln2005/test_sections.lua | 7 +-- .../vstudio/vc200x/test_assembly_refs.lua | 5 ++- .../vstudio/vc200x/test_build_steps.lua | 5 ++- .../vstudio/vc200x/test_compiler_block.lua | 11 ++--- .../vstudio/vc200x/test_configuration.lua | 9 ++-- .../vstudio/vc200x/test_debug_settings.lua | 9 ++-- .../vstudio/vc200x/test_excluded_configs.lua | 7 +-- tests/actions/vstudio/vc200x/test_files.lua | 7 +-- .../vstudio/vc200x/test_linker_block.lua | 7 +-- .../vstudio/vc200x/test_manifest_block.lua | 5 ++- .../vstudio/vc200x/test_nmake_settings.lua | 5 ++- .../actions/vstudio/vc200x/test_platforms.lua | 5 ++- tests/actions/vstudio/vc200x/test_project.lua | 3 +- .../vstudio/vc200x/test_project_refs.lua | 5 ++- .../vstudio/vc200x/test_resource_compiler.lua | 5 ++- .../actions/vstudio/vc200x/test_user_file.lua | 5 ++- .../vstudio/vc2010/test_assembly_refs.lua | 5 ++- .../vstudio/vc2010/test_build_events.lua | 5 ++- .../actions/vstudio/vc2010/test_build_log.lua | 5 ++- .../vstudio/vc2010/test_character_set.lua | 3 +- .../vstudio/vc2010/test_compile_settings.lua | 15 ++++--- .../vstudio/vc2010/test_config_props.lua | 7 +-- .../vstudio/vc2010/test_debug_settings.lua | 7 +-- .../vc2010/test_ensure_nuget_imports.lua | 9 ++-- .../vstudio/vc2010/test_excluded_configs.lua | 5 ++- .../vc2010/test_extension_settings.lua | 7 +-- .../vstudio/vc2010/test_extension_targets.lua | 7 +-- tests/actions/vstudio/vc2010/test_files.lua | 5 ++- .../vstudio/vc2010/test_filter_ids.lua | 5 ++- tests/actions/vstudio/vc2010/test_filters.lua | 5 ++- .../vstudio/vc2010/test_floatingpoint.lua | 5 ++- tests/actions/vstudio/vc2010/test_globals.lua | 9 ++-- tests/actions/vstudio/vc2010/test_header.lua | 9 ++-- .../vstudio/vc2010/test_imagexex_settings.lua | 5 ++- .../vstudio/vc2010/test_item_def_group.lua | 5 ++- .../vstudio/vc2010/test_language_settings.lua | 7 +-- .../vstudio/vc2010/test_language_targets.lua | 7 +-- tests/actions/vstudio/vc2010/test_link.lua | 21 ++++----- .../actions/vstudio/vc2010/test_manifest.lua | 7 +-- .../vstudio/vc2010/test_nmake_props.lua | 9 ++-- .../vc2010/test_nuget_packages_config.lua | 11 ++--- .../vstudio/vc2010/test_output_props.lua | 5 ++- .../vstudio/vc2010/test_platform_toolset.lua | 11 ++--- .../vstudio/vc2010/test_project_configs.lua | 5 ++- .../vstudio/vc2010/test_project_refs.lua | 5 ++- .../vstudio/vc2010/test_prop_sheet.lua | 7 +-- .../vstudio/vc2010/test_resource_compile.lua | 9 ++-- .../vstudio/vc2010/test_rule_props.lua | 8 ++-- .../vstudio/vc2010/test_rule_targets.lua | 8 ++-- .../actions/vstudio/vc2010/test_rule_vars.lua | 6 +-- .../actions/vstudio/vc2010/test_rule_xml.lua | 8 ++-- .../vstudio/vc2010/test_target_machine.lua | 3 +- .../actions/vstudio/vc2010/test_user_file.lua | 5 ++- .../vstudio/vc2010/test_vectorextensions.lua | 13 +++--- tests/api/test_boolean_kind.lua | 3 +- tests/api/test_containers.lua | 5 ++- tests/api/test_deprecations.lua | 3 +- tests/api/test_directory_kind.lua | 3 +- tests/api/test_list_kind.lua | 3 +- tests/api/test_path_kind.lua | 3 +- tests/api/test_register.lua | 5 ++- tests/api/test_string_kind.lua | 3 +- tests/api/test_table_kind.lua | 3 +- tests/base/test_configset.lua | 6 +-- tests/base/test_context.lua | 8 ++-- tests/base/test_criteria.lua | 8 ++-- tests/base/test_detoken.lua | 6 +-- tests/base/test_include.lua | 15 ++++--- tests/base/test_module_loader.lua | 3 +- tests/base/test_option.lua | 3 +- tests/base/test_override.lua | 11 ++--- tests/base/test_tree.lua | 3 +- tests/config/test_linkinfo.lua | 5 ++- tests/config/test_links.lua | 5 ++- tests/config/test_targetinfo.lua | 5 ++- tests/oven/test_filtering.lua | 5 ++- tests/oven/test_objdirs.lua | 3 +- tests/project/test_eachconfig.lua | 3 +- tests/project/test_sources.lua | 5 ++- tests/project/test_vpaths.lua | 3 +- tests/tools/test_dotnet.lua | 3 +- tests/tools/test_gcc.lua | 5 ++- tests/tools/test_msc.lua | 3 +- tests/tools/test_snc.lua | 3 +- tests/workspace/test_objdirs.lua | 5 ++- 191 files changed, 868 insertions(+), 735 deletions(-) diff --git a/modules/codelite/codelite_project.lua b/modules/codelite/codelite_project.lua index b842e8a4..102ca1ee 100755 --- a/modules/codelite/codelite_project.lua +++ b/modules/codelite/codelite_project.lua @@ -281,17 +281,17 @@ _p(3, '', 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, '%s', table.concat(premake.esc(project.getrelative(cfg.project, cfg.debugsearchpaths)), "\n")) + _p(4, '%s', table.concat(p.esc(project.getrelative(cfg.project, cfg.debugsearchpaths)), "\n")) else _p(4, '') end if #cfg.debugconnectcommands > 0 then - _p(4, '%s', table.concat(premake.esc(cfg.debugconnectcommands), "\n")) + _p(4, '%s', table.concat(p.esc(cfg.debugconnectcommands), "\n")) else _p(4, '') end if #cfg.debugstartupcommands > 0 then - _p(4, '%s', table.concat(premake.esc(cfg.debugstartupcommands), "\n")) + _p(4, '%s', table.concat(p.esc(cfg.debugstartupcommands), "\n")) else _p(4, '') end diff --git a/modules/codelite/tests/test_codelite_config.lua b/modules/codelite/tests/test_codelite_config.lua index f17f9a78..0719d771 100644 --- a/modules/codelite/tests/test_codelite_config.lua +++ b/modules/codelite/tests/test_codelite_config.lua @@ -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 diff --git a/modules/codelite/tests/test_codelite_project.lua b/modules/codelite/tests/test_codelite_project.lua index 631ab7e1..ff72ebb5 100644 --- a/modules/codelite/tests/test_codelite_project.lua +++ b/modules/codelite/tests/test_codelite_project.lua @@ -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 diff --git a/modules/codelite/tests/test_codelite_workspace.lua b/modules/codelite/tests/test_codelite_workspace.lua index f63453bf..cd56fd07 100644 --- a/modules/codelite/tests/test_codelite_workspace.lua +++ b/modules/codelite/tests/test_codelite_workspace.lua @@ -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 diff --git a/modules/d/d.lua b/modules/d/d.lua index cc7908bb..45c2152d 100644 --- a/modules/d/d.lua +++ b/modules/d/d.lua @@ -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 -- diff --git a/modules/d/tests/test_dmd.lua b/modules/d/tests/test_dmd.lua index a12f5bc6..98f5205d 100644 --- a/modules/d/tests/test_dmd.lua +++ b/modules/d/tests/test_dmd.lua @@ -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 diff --git a/modules/d/tests/test_gdc.lua b/modules/d/tests/test_gdc.lua index a22ba25c..c0e9c670 100644 --- a/modules/d/tests/test_gdc.lua +++ b/modules/d/tests/test_gdc.lua @@ -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 diff --git a/modules/d/tests/test_gmake.lua b/modules/d/tests/test_gmake.lua index af70043d..73b69162 100644 --- a/modules/d/tests/test_gmake.lua +++ b/modules/d/tests/test_gmake.lua @@ -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 diff --git a/modules/d/tests/test_ldc.lua b/modules/d/tests/test_ldc.lua index 94cd13aa..358883c6 100644 --- a/modules/d/tests/test_ldc.lua +++ b/modules/d/tests/test_ldc.lua @@ -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 diff --git a/modules/d/tests/test_visualstudio.lua b/modules/d/tests/test_visualstudio.lua index c0bc19de..da6a53fe 100644 --- a/modules/d/tests/test_visualstudio.lua +++ b/modules/d/tests/test_visualstudio.lua @@ -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 diff --git a/modules/d/tools/dmd.lua b/modules/d/tools/dmd.lua index fc0796d8..59161946 100644 --- a/modules/d/tools/dmd.lua +++ b/modules/d/tools/dmd.lua @@ -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 diff --git a/modules/d/tools/gdc.lua b/modules/d/tools/gdc.lua index d8e42558..21dc08c3 100644 --- a/modules/d/tools/gdc.lua +++ b/modules/d/tools/gdc.lua @@ -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 diff --git a/modules/d/tools/ldc.lua b/modules/d/tools/ldc.lua index 6c79840a..4d461885 100644 --- a/modules/d/tools/ldc.lua +++ b/modules/d/tools/ldc.lua @@ -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 diff --git a/modules/raw/raw_action.lua b/modules/raw/raw_action.lua index 2d06fdf0..f2539105 100644 --- a/modules/raw/raw_action.lua +++ b/modules/raw/raw_action.lua @@ -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) diff --git a/modules/self-test/test_assertions.lua b/modules/self-test/test_assertions.lua index 16d3e574..32f97d56 100644 --- a/modules/self-test/test_assertions.lua +++ b/modules/self-test/test_assertions.lua @@ -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 diff --git a/modules/xcode/tests/test_header_footer.lua b/modules/xcode/tests/test_header_footer.lua index dadac52d..9f140c24 100644 --- a/modules/xcode/tests/test_header_footer.lua +++ b/modules/xcode/tests/test_header_footer.lua @@ -6,7 +6,8 @@ --- local suite = test.declare("xcode_header") - local xcode = premake.modules.xcode + local p = premake + local xcode = p.modules.xcode -- diff --git a/modules/xcode/tests/test_xcode4_project.lua b/modules/xcode/tests/test_xcode4_project.lua index bf4b3961..8507547b 100644 --- a/modules/xcode/tests/test_xcode4_project.lua +++ b/modules/xcode/tests/test_xcode4_project.lua @@ -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 diff --git a/modules/xcode/tests/test_xcode4_workspace.lua b/modules/xcode/tests/test_xcode4_workspace.lua index d0f25abf..e4427ed4 100644 --- a/modules/xcode/tests/test_xcode4_workspace.lua +++ b/modules/xcode/tests/test_xcode4_workspace.lua @@ -7,7 +7,8 @@ --- local suite = test.declare("xcode4_workspace") - local xcode = premake.modules.xcode + local p = premake + local xcode = p.modules.xcode -- diff --git a/modules/xcode/tests/test_xcode_dependencies.lua b/modules/xcode/tests/test_xcode_dependencies.lua index 6bb952d7..d9b9dc0e 100644 --- a/modules/xcode/tests/test_xcode_dependencies.lua +++ b/modules/xcode/tests/test_xcode_dependencies.lua @@ -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 diff --git a/modules/xcode/tests/test_xcode_project.lua b/modules/xcode/tests/test_xcode_project.lua index de9d02e1..9c89fa14 100644 --- a/modules/xcode/tests/test_xcode_project.lua +++ b/modules/xcode/tests/test_xcode_project.lua @@ -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 diff --git a/modules/xcode/xcode4_workspace.lua b/modules/xcode/xcode4_workspace.lua index b1e0e5c0..58bf0fd1 100644 --- a/modules/xcode/xcode4_workspace.lua +++ b/modules/xcode/xcode4_workspace.lua @@ -38,7 +38,7 @@ function m.workspaceTail() -- Don't output final newline. Xcode doesn't. - premake.out('') + p.out('') end diff --git a/modules/xcode/xcode_common.lua b/modules/xcode/xcode_common.lua index de7cd4de..c15992ba 100644 --- a/modules/xcode/xcode_common.lua +++ b/modules/xcode/xcode_common.lua @@ -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 = { diff --git a/modules/xcode/xcode_project.lua b/modules/xcode/xcode_project.lua index e823e6f7..8a968e46 100644 --- a/modules/xcode/xcode_project.lua +++ b/modules/xcode/xcode_project.lua @@ -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 diff --git a/src/_premake_main.lua b/src/_premake_main.lua index 77e956bd..3e13a7c2 100644 --- a/src/_premake_main.lua +++ b/src/_premake_main.lua @@ -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 diff --git a/src/actions/make/_make.lua b/src/actions/make/_make.lua index dbd09b02..d9c5d85b 100644 --- a/src/actions/make/_make.lua +++ b/src/actions/make/_make.lua @@ -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 diff --git a/src/actions/make/make_cpp.lua b/src/actions/make/make_cpp.lua index 07addc0e..fb3a227f 100644 --- a/src/actions/make/make_cpp.lua +++ b/src/actions/make/make_cpp.lua @@ -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 diff --git a/src/actions/make/make_csharp.lua b/src/actions/make/make_csharp.lua index 01d622a0..f629ee95 100644 --- a/src/actions/make/make_csharp.lua +++ b/src/actions/make/make_csharp.lua @@ -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 diff --git a/src/actions/make/make_makefile.lua b/src/actions/make/make_makefile.lua index 0dea1efd..739995b0 100644 --- a/src/actions/make/make_makefile.lua +++ b/src/actions/make/make_makefile.lua @@ -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 diff --git a/src/actions/make/make_utility.lua b/src/actions/make/make_utility.lua index 596334ee..bb10205f 100644 --- a/src/actions/make/make_utility.lua +++ b/src/actions/make/make_utility.lua @@ -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 diff --git a/src/actions/make/make_workspace.lua b/src/actions/make/make_workspace.lua index a2e9812f..e171b304 100644 --- a/src/actions/make/make_workspace.lua +++ b/src/actions/make/make_workspace.lua @@ -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) diff --git a/src/actions/vstudio/_vstudio.lua b/src/actions/vstudio/_vstudio.lua index e0b8e0c0..a29a2d0e 100644 --- a/src/actions/vstudio/_vstudio.lua +++ b/src/actions/vstudio/_vstudio.lua @@ -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 diff --git a/src/actions/vstudio/vs2005.lua b/src/actions/vstudio/vs2005.lua index 91630755..0d8b6695 100644 --- a/src/actions/vstudio/vs2005.lua +++ b/src/actions/vstudio/vs2005.lua @@ -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) diff --git a/src/actions/vstudio/vs2005_csproj.lua b/src/actions/vstudio/vs2005_csproj.lua index 207078f0..b6d5ab01 100644 --- a/src/actions/vstudio/vs2005_csproj.lua +++ b/src/actions/vstudio/vs2005_csproj.lua @@ -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,'') 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,'') local cfg = project.getfirstconfig(prj) - premake.callarray(cs2005, cs2005.elements.projectProperties, cfg) + p.callarray(cs2005, cs2005.elements.projectProperties, cfg) _p(1,'') 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,'') 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,'%s', 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,'%s', 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,'v%s', framework) diff --git a/src/actions/vstudio/vs2005_solution.lua b/src/actions/vstudio/vs2005_solution.lua index 6ce5fb02..cad2ff75 100644 --- a/src/actions/vstudio/vs2005_solution.lua +++ b/src/actions/vstudio/vs2005_solution.lua @@ -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 diff --git a/src/actions/vstudio/vs2008.lua b/src/actions/vstudio/vs2008.lua index 07e131c9..5da95b9f 100644 --- a/src/actions/vstudio/vs2008.lua +++ b/src/actions/vstudio/vs2008.lua @@ -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 --- diff --git a/src/actions/vstudio/vs200x_vcproj.lua b/src/actions/vstudio/vs200x_vcproj.lua index 299b7adc..e42e8cc4 100644 --- a/src/actions/vstudio/vs200x_vcproj.lua +++ b/src/actions/vstudio/vs200x_vcproj.lua @@ -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 diff --git a/src/actions/vstudio/vs2010.lua b/src/actions/vstudio/vs2010.lua index df99f540..4ad01840 100644 --- a/src/actions/vstudio/vs2010.lua +++ b/src/actions/vstudio/vs2010.lua @@ -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 diff --git a/src/actions/vstudio/vs2010_nuget.lua b/src/actions/vstudio/vs2010_nuget.lua index ae9f305a..a0ced58e 100644 --- a/src/actions/vstudio/vs2010_nuget.lua +++ b/src/actions/vstudio/vs2010_nuget.lua @@ -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 diff --git a/src/actions/vstudio/vs2010_rules_props.lua b/src/actions/vstudio/vs2010_rules_props.lua index 6209b208..8923af87 100644 --- a/src/actions/vstudio/vs2010_rules_props.lua +++ b/src/actions/vstudio/vs2010_rules_props.lua @@ -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 = {} --- diff --git a/src/actions/vstudio/vs2010_rules_targets.lua b/src/actions/vstudio/vs2010_rules_targets.lua index 6503469e..b0da8775 100644 --- a/src/actions/vstudio/vs2010_rules_targets.lua +++ b/src/actions/vstudio/vs2010_rules_targets.lua @@ -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 = {} --- diff --git a/src/actions/vstudio/vs2010_rules_xml.lua b/src/actions/vstudio/vs2010_rules_xml.lua index 7090f8a9..b5a56f7b 100644 --- a/src/actions/vstudio/vs2010_rules_xml.lua +++ b/src/actions/vstudio/vs2010_rules_xml.lua @@ -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 = {} --- diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index 9d325e12..b4a0bf33 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -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 = {} diff --git a/src/actions/vstudio/vs2010_vcxproj_filters.lua b/src/actions/vstudio/vs2010_vcxproj_filters.lua index 752755d8..279c09a6 100644 --- a/src/actions/vstudio/vs2010_vcxproj_filters.lua +++ b/src/actions/vstudio/vs2010_vcxproj_filters.lua @@ -29,7 +29,7 @@ -- function m.filtersProject() - local action = premake.action.current() + local action = p.action.current() p.push('', action.vstudio.filterToolsVersion or action.vstudio.toolsVersion) end diff --git a/src/actions/vstudio/vs2010_vcxproj_user.lua b/src/actions/vstudio/vs2010_vcxproj_user.lua index ab29a6fa..180a8ec5 100755 --- a/src/actions/vstudio/vs2010_vcxproj_user.lua +++ b/src/actions/vstudio/vs2010_vcxproj_user.lua @@ -53,7 +53,7 @@ -- function m.userProject() - local action = premake.action.current() + local action = p.action.current() p.push('', action.vstudio.toolsVersion) end diff --git a/src/actions/vstudio/vs2012.lua b/src/actions/vstudio/vs2012.lua index e257b664..abdba2c3 100644 --- a/src/actions/vstudio/vs2012.lua +++ b/src/actions/vstudio/vs2012.lua @@ -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. diff --git a/src/actions/vstudio/vs2013.lua b/src/actions/vstudio/vs2013.lua index 0a5c53fc..086f4e76 100644 --- a/src/actions/vstudio/vs2013.lua +++ b/src/actions/vstudio/vs2013.lua @@ -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 diff --git a/src/actions/vstudio/vs2015.lua b/src/actions/vstudio/vs2015.lua index 5ddf83a0..7413401b 100644 --- a/src/actions/vstudio/vs2015.lua +++ b/src/actions/vstudio/vs2015.lua @@ -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 diff --git a/src/actions/vstudio/vs2017.lua b/src/actions/vstudio/vs2017.lua index 12121e61..95caa77b 100644 --- a/src/actions/vstudio/vs2017.lua +++ b/src/actions/vstudio/vs2017.lua @@ -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 diff --git a/src/base/action.lua b/src/base/action.lua index f5e5857a..3820911b 100644 --- a/src/base/action.lua +++ b/src/base/action.lua @@ -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 diff --git a/src/base/api.lua b/src/base/api.lua index fb953e32..659290a2 100755 --- a/src/base/api.lua +++ b/src/base/api.lua @@ -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 diff --git a/src/base/config.lua b/src/base/config.lua index a011ec75..879a5fe2 100755 --- a/src/base/config.lua +++ b/src/base/config.lua @@ -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") diff --git a/src/base/detoken.lua b/src/base/detoken.lua index 698c9dc9..a8cb0bc5 100644 --- a/src/base/detoken.lua +++ b/src/base/detoken.lua @@ -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 diff --git a/src/base/field.lua b/src/base/field.lua index 76d974a1..299039ad 100644 --- a/src/base/field.lua +++ b/src/base/field.lua @@ -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 diff --git a/src/base/fileconfig.lua b/src/base/fileconfig.lua index 81afa395..adf4703c 100644 --- a/src/base/fileconfig.lua +++ b/src/base/fileconfig.lua @@ -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 diff --git a/src/base/languages.lua b/src/base/languages.lua index c130432f..156be43a 100644 --- a/src/base/languages.lua +++ b/src/base/languages.lua @@ -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 ) diff --git a/src/base/option.lua b/src/base/option.lua index 276f60ad..a8cf8b1f 100644 --- a/src/base/option.lua +++ b/src/base/option.lua @@ -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 diff --git a/src/base/oven.lua b/src/base/oven.lua index 7ce8c9ee..45cef581 100644 --- a/src/base/oven.lua +++ b/src/base/oven.lua @@ -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 diff --git a/src/base/premake.lua b/src/base/premake.lua index cde0c8e2..962c642d 100644 --- a/src/base/premake.lua +++ b/src/base/premake.lua @@ -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('', encoding) + p.w('', 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 diff --git a/src/base/tools.lua b/src/base/tools.lua index f67292b3..65488bd5 100644 --- a/src/base/tools.lua +++ b/src/base/tools.lua @@ -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 diff --git a/src/base/tree.lua b/src/base/tree.lua index 8aaa5915..46e4b021 100644 --- a/src/base/tree.lua +++ b/src/base/tree.lua @@ -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 -- diff --git a/src/base/validation.lua b/src/base/validation.lua index 335cc26c..379c82fd 100644 --- a/src/base/validation.lua +++ b/src/base/validation.lua @@ -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 = {} diff --git a/src/tools/clang.lua b/src/tools/clang.lua index 2928fcb5..ee6f20da 100644 --- a/src/tools/clang.lua +++ b/src/tools/clang.lua @@ -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 = { diff --git a/src/tools/dotnet.lua b/src/tools/dotnet.lua index ffa02809..18b06ed1 100644 --- a/src/tools/dotnet.lua +++ b/src/tools/dotnet.lua @@ -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" diff --git a/src/tools/gcc.lua b/src/tools/gcc.lua index 65159700..df8997f2 100644 --- a/src/tools/gcc.lua +++ b/src/tools/gcc.lua @@ -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 diff --git a/src/tools/msc.lua b/src/tools/msc.lua index cde83e29..b30158ed 100644 --- a/src/tools/msc.lua +++ b/src/tools/msc.lua @@ -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") diff --git a/tests/actions/make/cpp/test_clang.lua b/tests/actions/make/cpp/test_clang.lua index 27e851e9..3410b26a 100644 --- a/tests/actions/make/cpp/test_clang.lua +++ b/tests/actions/make/cpp/test_clang.lua @@ -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 diff --git a/tests/actions/make/cpp/test_file_rules.lua b/tests/actions/make/cpp/test_file_rules.lua index 67ff9e48..17647d3f 100644 --- a/tests/actions/make/cpp/test_file_rules.lua +++ b/tests/actions/make/cpp/test_file_rules.lua @@ -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 diff --git a/tests/actions/make/cpp/test_flags.lua b/tests/actions/make/cpp/test_flags.lua index 6d16d7db..21f798f6 100644 --- a/tests/actions/make/cpp/test_flags.lua +++ b/tests/actions/make/cpp/test_flags.lua @@ -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 diff --git a/tests/actions/make/cpp/test_ldflags.lua b/tests/actions/make/cpp/test_ldflags.lua index a6cd8587..0007b68f 100644 --- a/tests/actions/make/cpp/test_ldflags.lua +++ b/tests/actions/make/cpp/test_ldflags.lua @@ -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 diff --git a/tests/actions/make/cpp/test_make_linking.lua b/tests/actions/make/cpp/test_make_linking.lua index 0b952638..4d13597e 100644 --- a/tests/actions/make/cpp/test_make_linking.lua +++ b/tests/actions/make/cpp/test_make_linking.lua @@ -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 diff --git a/tests/actions/make/cpp/test_make_pch.lua b/tests/actions/make/cpp/test_make_pch.lua index c807b790..9b374f06 100644 --- a/tests/actions/make/cpp/test_make_pch.lua +++ b/tests/actions/make/cpp/test_make_pch.lua @@ -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 diff --git a/tests/actions/make/cpp/test_target_rules.lua b/tests/actions/make/cpp/test_target_rules.lua index e3a586b4..f8fb3cc0 100644 --- a/tests/actions/make/cpp/test_target_rules.lua +++ b/tests/actions/make/cpp/test_target_rules.lua @@ -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 -- diff --git a/tests/actions/make/cpp/test_tools.lua b/tests/actions/make/cpp/test_tools.lua index 8b234acc..80ebd4f6 100644 --- a/tests/actions/make/cpp/test_tools.lua +++ b/tests/actions/make/cpp/test_tools.lua @@ -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 ]] diff --git a/tests/actions/make/cpp/test_wiidev.lua b/tests/actions/make/cpp/test_wiidev.lua index 4294ba8b..54a6113e 100644 --- a/tests/actions/make/cpp/test_wiidev.lua +++ b/tests/actions/make/cpp/test_wiidev.lua @@ -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")' diff --git a/tests/actions/make/cs/test_embed_files.lua b/tests/actions/make/cs/test_embed_files.lua index 1a0d759d..36b8d141 100644 --- a/tests/actions/make/cs/test_embed_files.lua +++ b/tests/actions/make/cs/test_embed_files.lua @@ -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 diff --git a/tests/actions/make/cs/test_flags.lua b/tests/actions/make/cs/test_flags.lua index 40d028b2..ac22a2c3 100644 --- a/tests/actions/make/cs/test_flags.lua +++ b/tests/actions/make/cs/test_flags.lua @@ -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 diff --git a/tests/actions/make/cs/test_links.lua b/tests/actions/make/cs/test_links.lua index 82ef9ba0..6116eb40 100644 --- a/tests/actions/make/cs/test_links.lua +++ b/tests/actions/make/cs/test_links.lua @@ -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 diff --git a/tests/actions/make/cs/test_response.lua b/tests/actions/make/cs/test_response.lua index d766d45a..5ffed6a8 100644 --- a/tests/actions/make/cs/test_response.lua +++ b/tests/actions/make/cs/test_response.lua @@ -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 diff --git a/tests/actions/make/cs/test_sources.lua b/tests/actions/make/cs/test_sources.lua index 60ec08bd..0789c6c9 100644 --- a/tests/actions/make/cs/test_sources.lua +++ b/tests/actions/make/cs/test_sources.lua @@ -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 diff --git a/tests/actions/make/test_make_escaping.lua b/tests/actions/make/test_make_escaping.lua index a1ad1937..fa24937f 100644 --- a/tests/actions/make/test_make_escaping.lua +++ b/tests/actions/make/test_make_escaping.lua @@ -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() diff --git a/tests/actions/make/test_make_tovar.lua b/tests/actions/make/test_make_tovar.lua index b4b1832a..0c73474e 100644 --- a/tests/actions/make/test_make_tovar.lua +++ b/tests/actions/make/test_make_tovar.lua @@ -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 -- diff --git a/tests/actions/make/workspace/test_config_maps.lua b/tests/actions/make/workspace/test_config_maps.lua index 5f71ff96..38506239 100644 --- a/tests/actions/make/workspace/test_config_maps.lua +++ b/tests/actions/make/workspace/test_config_maps.lua @@ -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 -- diff --git a/tests/actions/make/workspace/test_group_rule.lua b/tests/actions/make/workspace/test_group_rule.lua index 16000841..aebb3f82 100644 --- a/tests/actions/make/workspace/test_group_rule.lua +++ b/tests/actions/make/workspace/test_group_rule.lua @@ -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 -- diff --git a/tests/actions/make/workspace/test_help_rule.lua b/tests/actions/make/workspace/test_help_rule.lua index a4be6fc4..3e3ab50a 100644 --- a/tests/actions/make/workspace/test_help_rule.lua +++ b/tests/actions/make/workspace/test_help_rule.lua @@ -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 diff --git a/tests/actions/make/workspace/test_project_rule.lua b/tests/actions/make/workspace/test_project_rule.lua index 3fd94dd7..3615bd2a 100644 --- a/tests/actions/make/workspace/test_project_rule.lua +++ b/tests/actions/make/workspace/test_project_rule.lua @@ -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 diff --git a/tests/actions/vstudio/cs2005/projectelement.lua b/tests/actions/vstudio/cs2005/projectelement.lua index df216aca..ec640fde 100755 --- a/tests/actions/vstudio/cs2005/projectelement.lua +++ b/tests/actions/vstudio/cs2005/projectelement.lua @@ -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 [[ @@ -38,7 +39,7 @@ function suite.on2008() - premake.action.set("vs2008") + p.action.set("vs2008") prepare() test.capture [[ @@ -47,7 +48,7 @@ function suite.on2010() - premake.action.set("vs2010") + p.action.set("vs2010") prepare() test.capture [[ @@ -57,7 +58,7 @@ function suite.on2012() - premake.action.set("vs2012") + p.action.set("vs2012") prepare() test.capture [[ @@ -67,7 +68,7 @@ function suite.on2013() - premake.action.set("vs2013") + p.action.set("vs2013") prepare() test.capture [[ diff --git a/tests/actions/vstudio/cs2005/projectsettings.lua b/tests/actions/vstudio/cs2005/projectsettings.lua index b52b0d87..25a4397b 100755 --- a/tests/actions/vstudio/cs2005/projectsettings.lua +++ b/tests/actions/vstudio/cs2005/projectsettings.lua @@ -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 [[ @@ -70,7 +70,7 @@ function suite.OnVs2010() - premake.action.set("vs2010") + p.action.set("vs2010") prepare() test.capture [[ @@ -93,7 +93,7 @@ function suite.onVs2012() - premake.action.set("vs2012") + p.action.set("vs2012") prepare() test.capture [[ @@ -183,7 +183,7 @@ -- function suite.projectTypeGuids_onWPF() - premake.action.set("vs2010") + p.action.set("vs2010") flags { "WPF" } prepare() test.capture [[ diff --git a/tests/actions/vstudio/cs2005/test_assembly_refs.lua b/tests/actions/vstudio/cs2005/test_assembly_refs.lua index 6a68ceaa..f4bb5189 100644 --- a/tests/actions/vstudio/cs2005/test_assembly_refs.lua +++ b/tests/actions/vstudio/cs2005/test_assembly_refs.lua @@ -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 diff --git a/tests/actions/vstudio/cs2005/test_build_events.lua b/tests/actions/vstudio/cs2005/test_build_events.lua index 5f626ec1..52223ae5 100644 --- a/tests/actions/vstudio/cs2005/test_build_events.lua +++ b/tests/actions/vstudio/cs2005/test_build_events.lua @@ -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 diff --git a/tests/actions/vstudio/cs2005/test_common_props.lua b/tests/actions/vstudio/cs2005/test_common_props.lua index 18783398..1c5d9751 100644 --- a/tests/actions/vstudio/cs2005/test_common_props.lua +++ b/tests/actions/vstudio/cs2005/test_common_props.lua @@ -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 diff --git a/tests/actions/vstudio/cs2005/test_compiler_props.lua b/tests/actions/vstudio/cs2005/test_compiler_props.lua index dfd3323e..075ea1ef 100644 --- a/tests/actions/vstudio/cs2005/test_compiler_props.lua +++ b/tests/actions/vstudio/cs2005/test_compiler_props.lua @@ -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 diff --git a/tests/actions/vstudio/cs2005/test_debug_props.lua b/tests/actions/vstudio/cs2005/test_debug_props.lua index 917ecbf4..7a5ca240 100644 --- a/tests/actions/vstudio/cs2005/test_debug_props.lua +++ b/tests/actions/vstudio/cs2005/test_debug_props.lua @@ -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 diff --git a/tests/actions/vstudio/cs2005/test_files.lua b/tests/actions/vstudio/cs2005/test_files.lua index 6586da4c..4e5d5176 100755 --- a/tests/actions/vstudio/cs2005/test_files.lua +++ b/tests/actions/vstudio/cs2005/test_files.lua @@ -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 diff --git a/tests/actions/vstudio/cs2005/test_icon.lua b/tests/actions/vstudio/cs2005/test_icon.lua index 778d6146..b41f30fd 100644 --- a/tests/actions/vstudio/cs2005/test_icon.lua +++ b/tests/actions/vstudio/cs2005/test_icon.lua @@ -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 -- diff --git a/tests/actions/vstudio/cs2005/test_nuget_config.lua b/tests/actions/vstudio/cs2005/test_nuget_config.lua index 88a48099..8be35526 100644 --- a/tests/actions/vstudio/cs2005/test_nuget_config.lua +++ b/tests/actions/vstudio/cs2005/test_nuget_config.lua @@ -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 diff --git a/tests/actions/vstudio/cs2005/test_nuget_packages_config.lua b/tests/actions/vstudio/cs2005/test_nuget_packages_config.lua index 65a16961..0247c569 100644 --- a/tests/actions/vstudio/cs2005/test_nuget_packages_config.lua +++ b/tests/actions/vstudio/cs2005/test_nuget_packages_config.lua @@ -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 diff --git a/tests/actions/vstudio/cs2005/test_output_props.lua b/tests/actions/vstudio/cs2005/test_output_props.lua index a0324e15..3ac0f8e7 100644 --- a/tests/actions/vstudio/cs2005/test_output_props.lua +++ b/tests/actions/vstudio/cs2005/test_output_props.lua @@ -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 [[ bin\Debug\ @@ -54,7 +55,7 @@ end function suite.intermediateDirectory_onVs2010() - premake.action.set("vs2010") + p.action.set("vs2010") prepare() test.capture [[ bin\Debug\ diff --git a/tests/actions/vstudio/cs2005/test_platform_groups.lua b/tests/actions/vstudio/cs2005/test_platform_groups.lua index 733f9182..51fdedb8 100644 --- a/tests/actions/vstudio/cs2005/test_platform_groups.lua +++ b/tests/actions/vstudio/cs2005/test_platform_groups.lua @@ -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 [[ @@ -41,7 +42,7 @@ function suite.vs2010() - premake.action.set("vs2010") + p.action.set("vs2010") prepare() test.capture [[ @@ -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 [[ diff --git a/tests/actions/vstudio/cs2005/test_project_refs.lua b/tests/actions/vstudio/cs2005/test_project_refs.lua index 1b2a8311..687ecb27 100644 --- a/tests/actions/vstudio/cs2005/test_project_refs.lua +++ b/tests/actions/vstudio/cs2005/test_project_refs.lua @@ -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) diff --git a/tests/actions/vstudio/cs2005/test_targets.lua b/tests/actions/vstudio/cs2005/test_targets.lua index 0e06c698..4e0b3300 100644 --- a/tests/actions/vstudio/cs2005/test_targets.lua +++ b/tests/actions/vstudio/cs2005/test_targets.lua @@ -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 diff --git a/tests/actions/vstudio/cs2005/test_user_file.lua b/tests/actions/vstudio/cs2005/test_user_file.lua index cbebe606..97f16b8d 100644 --- a/tests/actions/vstudio/cs2005/test_user_file.lua +++ b/tests/actions/vstudio/cs2005/test_user_file.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2015 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_cs2005_user_file") - local cs2005 = premake.vstudio.cs2005 + local cs2005 = p.vstudio.cs2005 -- @@ -15,7 +16,7 @@ local wks function suite.setup() - premake.action.set("vs2008") + p.action.set("vs2008") wks = test.createWorkspace() language "C#" end diff --git a/tests/actions/vstudio/sln2005/test_dependencies.lua b/tests/actions/vstudio/sln2005/test_dependencies.lua index 67960a72..6d2e585f 100755 --- a/tests/actions/vstudio/sln2005/test_dependencies.lua +++ b/tests/actions/vstudio/sln2005/test_dependencies.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2009-2012 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_sln2005_dependencies") - local sln2005 = premake.vstudio.sln2005 + local sln2005 = p.vstudio.sln2005 -- @@ -15,7 +16,7 @@ local wks, prj1, prj2 function suite.setup() - premake.action.set("vs2005") + p.action.set("vs2005") wks, prj1 = test.createWorkspace() uuid "AE61726D-187C-E440-BD07-2556188A6565" prj2 = test.createproject(wks) @@ -70,7 +71,7 @@ EndProjectSection -- function suite.dependency_onCSharpProjectsVs2010() - premake.action.set("vs2010") + p.action.set("vs2010") prepare("C#") test.capture [[ ProjectSection(ProjectDependencies) = postProject @@ -86,7 +87,7 @@ EndProjectSection -- function suite.dependency_onCSharpProjectsVs2012() - premake.action.set("vs2012") + p.action.set("vs2012") prepare("C#") test.capture [[ ProjectSection(ProjectDependencies) = postProject diff --git a/tests/actions/vstudio/sln2005/test_header.lua b/tests/actions/vstudio/sln2005/test_header.lua index 69118f90..117b6f3c 100755 --- a/tests/actions/vstudio/sln2005/test_header.lua +++ b/tests/actions/vstudio/sln2005/test_header.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2009-2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_sln2005_header") - local sln2005 = premake.vstudio.sln2005 + local sln2005 = p.vstudio.sln2005 -- @@ -28,7 +29,7 @@ -- function suite.on2005() - premake.action.set("vs2005") + p.action.set("vs2005") prepare() test.capture [[ Microsoft Visual Studio Solution File, Format Version 9.00 @@ -38,7 +39,7 @@ Microsoft Visual Studio Solution File, Format Version 9.00 function suite.on2008() - premake.action.set("vs2008") + p.action.set("vs2008") prepare() test.capture [[ Microsoft Visual Studio Solution File, Format Version 10.00 @@ -48,7 +49,7 @@ Microsoft Visual Studio Solution File, Format Version 10.00 function suite.on2010() - premake.action.set("vs2010") + p.action.set("vs2010") prepare() test.capture [[ Microsoft Visual Studio Solution File, Format Version 11.00 @@ -58,7 +59,7 @@ Microsoft Visual Studio Solution File, Format Version 11.00 function suite.on2012() - premake.action.set("vs2012") + p.action.set("vs2012") prepare() test.capture [[ Microsoft Visual Studio Solution File, Format Version 12.00 @@ -68,7 +69,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 function suite.on2013() - premake.action.set("vs2013") + p.action.set("vs2013") prepare() test.capture [[ Microsoft Visual Studio Solution File, Format Version 12.00 diff --git a/tests/actions/vstudio/sln2005/test_nested_projects.lua b/tests/actions/vstudio/sln2005/test_nested_projects.lua index 2026dcd3..e8dc9920 100644 --- a/tests/actions/vstudio/sln2005/test_nested_projects.lua +++ b/tests/actions/vstudio/sln2005/test_nested_projects.lua @@ -4,9 +4,9 @@ -- Copyright (c) 2012-2015 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_sln2005_nested_projects") - - local sln2005 = premake.vstudio.sln2005 + local sln2005 = p.vstudio.sln2005 -- @@ -16,7 +16,7 @@ local wks function suite.setup() - premake.action.set("vs2008") + p.action.set("vs2008") wks = workspace("MyWorkspace") configurations { "Debug", "Release" } language "C++" diff --git a/tests/actions/vstudio/sln2005/test_platforms.lua b/tests/actions/vstudio/sln2005/test_platforms.lua index a58e95fc..5e3d7d21 100644 --- a/tests/actions/vstudio/sln2005/test_platforms.lua +++ b/tests/actions/vstudio/sln2005/test_platforms.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2009-2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_sln2005_platforms") - local sln2005 = premake.vstudio.sln2005 + local sln2005 = p.vstudio.sln2005 -- @@ -15,7 +16,7 @@ local wks function suite.setup() - premake.action.set("vs2008") + p.action.set("vs2008") wks = workspace("MyWorkspace") configurations { "Debug", "Release" } language "C++" diff --git a/tests/actions/vstudio/sln2005/test_projects.lua b/tests/actions/vstudio/sln2005/test_projects.lua index 54aea72b..1ce5cae2 100755 --- a/tests/actions/vstudio/sln2005/test_projects.lua +++ b/tests/actions/vstudio/sln2005/test_projects.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2009-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_sln2005_projects") - local sln2005 = premake.vstudio.sln2005 + local sln2005 = p.vstudio.sln2005 -- @@ -15,8 +16,8 @@ local wks function suite.setup() - premake.action.set("vs2005") - premake.escaper(premake.vstudio.vs2005.esc) + p.action.set("vs2005") + p.escaper(p.vstudio.vs2005.esc) wks = workspace("MyWorkspace") configurations { "Debug", "Release" } language "C++" diff --git a/tests/actions/vstudio/sln2005/test_sections.lua b/tests/actions/vstudio/sln2005/test_sections.lua index 5b244a0b..9f2f2f37 100644 --- a/tests/actions/vstudio/sln2005/test_sections.lua +++ b/tests/actions/vstudio/sln2005/test_sections.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2009-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_sln2005_sections") - local sln2005 = premake.vstudio.sln2005 + local sln2005 = p.vstudio.sln2005 -- @@ -17,7 +18,7 @@ function suite.setup() _MAIN_SCRIPT = "c:\\test\\premake5.lua" - premake.escaper(premake.vstudio.vs2005.esc) + p.escaper(p.vstudio.vs2005.esc) wks = workspace("MyWorkspace") wks.location = "c:\\test\\build" @@ -46,7 +47,7 @@ GlobalSection(ExtensibilityGlobals) = postSolution project "MyProject" sln2005.extensibilityGlobals(wks) - local res = premake.captured() + local res = p.captured() if (#res > 0) then test.fail("no editorintegration output was expected"); end diff --git a/tests/actions/vstudio/vc200x/test_assembly_refs.lua b/tests/actions/vstudio/vc200x/test_assembly_refs.lua index 7d6e6d9a..957e0160 100644 --- a/tests/actions/vstudio/vc200x/test_assembly_refs.lua +++ b/tests/actions/vstudio/vc200x/test_assembly_refs.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs200x_assembly_refs") - local vc200x = premake.vstudio.vc200x + local vc200x = p.vstudio.vc200x -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2005") + p.action.set("vs2005") wks = test.createWorkspace() clr "On" end diff --git a/tests/actions/vstudio/vc200x/test_build_steps.lua b/tests/actions/vstudio/vc200x/test_build_steps.lua index 2285ad41..69ee1ac2 100644 --- a/tests/actions/vstudio/vc200x/test_build_steps.lua +++ b/tests/actions/vstudio/vc200x/test_build_steps.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs200x_build_steps") - local vc200x = premake.vstudio.vc200x + local vc200x = p.vstudio.vc200x -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.escaper(premake.vstudio.vs2005.esc) + p.escaper(p.vstudio.vs2005.esc) wks, prj = test.createWorkspace() end diff --git a/tests/actions/vstudio/vc200x/test_compiler_block.lua b/tests/actions/vstudio/vc200x/test_compiler_block.lua index 2fee6b2d..e409f51b 100644 --- a/tests/actions/vstudio/vc200x/test_compiler_block.lua +++ b/tests/actions/vstudio/vc200x/test_compiler_block.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2011-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs200x_compiler_block") - local vc200x = premake.vstudio.vc200x + local vc200x = p.vstudio.vc200x -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2008") + p.action.set("vs2008") wks, prj = test.createWorkspace() end @@ -383,7 +384,7 @@ -- function suite._64BitPortabilityOn_onVS2005() - premake.action.set("vs2005") + p.action.set("vs2005") prepare() test.capture [[ " } prepare() test.capture [[ @@ -284,7 +285,7 @@ Level3 &;<;>;%(PreprocessorDefinitions) ]] - premake.escaper(nil) + p.escaper(nil) end @@ -561,7 +562,7 @@ function suite.exceptions_onNoExceptionsVS2013() exceptionhandling "Off" - premake.action.set("vs2013") + p.action.set("vs2013") prepare() test.capture [[ @@ -836,7 +837,7 @@ -- function suite.onNoSymbolsVS2015() symbols 'Off' - premake.action.set("vs2015") + p.action.set("vs2015") prepare() test.capture [[ diff --git a/tests/actions/vstudio/vc2010/test_config_props.lua b/tests/actions/vstudio/vc2010/test_config_props.lua index 7d702dc9..64dd68be 100755 --- a/tests/actions/vstudio/vc2010/test_config_props.lua +++ b/tests/actions/vstudio/vc2010/test_config_props.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2011-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vs2010_config_props") - local vc2010 = premake.vstudio.vc2010 - local project = premake.project + local vc2010 = p.vstudio.vc2010 + local project = p.project -- @@ -16,7 +17,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks, prj = test.createWorkspace() end diff --git a/tests/actions/vstudio/vc2010/test_debug_settings.lua b/tests/actions/vstudio/vc2010/test_debug_settings.lua index 3c268c60..e43c09ff 100755 --- a/tests/actions/vstudio/vc2010/test_debug_settings.lua +++ b/tests/actions/vstudio/vc2010/test_debug_settings.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2011-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vs2010_debug_settings") - local vc2010 = premake.vstudio.vc2010 - local project = premake.project + local vc2010 = p.vstudio.vc2010 + local project = p.project -- @@ -16,7 +17,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks, prj = test.createWorkspace() end diff --git a/tests/actions/vstudio/vc2010/test_ensure_nuget_imports.lua b/tests/actions/vstudio/vc2010/test_ensure_nuget_imports.lua index d691a92d..9c3ce54e 100644 --- a/tests/actions/vstudio/vc2010/test_ensure_nuget_imports.lua +++ b/tests/actions/vstudio/vc2010/test_ensure_nuget_imports.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2016 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs2010_ensure_nuget_imports") - local vc2010 = premake.vstudio.vc2010 - local project = premake.project + local vc2010 = p.vstudio.vc2010 + local project = p.project -- @@ -16,12 +17,12 @@ local wks function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks = test.createWorkspace() end local function prepare() - local prj = premake.solution.getproject(wks, 1) + local prj = p.solution.getproject(wks, 1) vc2010.ensureNuGetPackageBuildImports(prj) end diff --git a/tests/actions/vstudio/vc2010/test_excluded_configs.lua b/tests/actions/vstudio/vc2010/test_excluded_configs.lua index cdb28d21..34fa07a7 100644 --- a/tests/actions/vstudio/vc2010/test_excluded_configs.lua +++ b/tests/actions/vstudio/vc2010/test_excluded_configs.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2012-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs2010_excluded_configs") - local vc2010 = premake.vstudio.vc2010 + local vc2010 = p.vstudio.vc2010 -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks = workspace("MyWorkspace") configurations { "Debug", "Release" } diff --git a/tests/actions/vstudio/vc2010/test_extension_settings.lua b/tests/actions/vstudio/vc2010/test_extension_settings.lua index 01059b3c..e52120c0 100644 --- a/tests/actions/vstudio/vc2010/test_extension_settings.lua +++ b/tests/actions/vstudio/vc2010/test_extension_settings.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs2010_extension_settings") - local vc2010 = premake.vstudio.vc2010 - local project = premake.project + local vc2010 = p.vstudio.vc2010 + local project = p.project -- @@ -16,7 +17,7 @@ local wks function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") rule "MyRules" rule "MyOtherRules" wks = test.createWorkspace() diff --git a/tests/actions/vstudio/vc2010/test_extension_targets.lua b/tests/actions/vstudio/vc2010/test_extension_targets.lua index 5575a2b5..1503cf40 100644 --- a/tests/actions/vstudio/vc2010/test_extension_targets.lua +++ b/tests/actions/vstudio/vc2010/test_extension_targets.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs2010_extension_targets") - local vc2010 = premake.vstudio.vc2010 - local project = premake.project + local vc2010 = p.vstudio.vc2010 + local project = p.project -- @@ -16,7 +17,7 @@ local wks function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") rule "MyRules" rule "MyOtherRules" wks = test.createWorkspace() diff --git a/tests/actions/vstudio/vc2010/test_files.lua b/tests/actions/vstudio/vc2010/test_files.lua index 6775cbf8..26375b33 100755 --- a/tests/actions/vstudio/vc2010/test_files.lua +++ b/tests/actions/vstudio/vc2010/test_files.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2011-2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vs2010_files") - local vc2010 = premake.vstudio.vc2010 + local vc2010 = p.vstudio.vc2010 -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") rule "Animation" fileextension ".dae" diff --git a/tests/actions/vstudio/vc2010/test_filter_ids.lua b/tests/actions/vstudio/vc2010/test_filter_ids.lua index e28e2952..e256de96 100644 --- a/tests/actions/vstudio/vc2010/test_filter_ids.lua +++ b/tests/actions/vstudio/vc2010/test_filter_ids.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2011-2012 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs2010_filter_ids") - local vc2010 = premake.vstudio.vc2010 + local vc2010 = p.vstudio.vc2010 -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks = test.createWorkspace() end diff --git a/tests/actions/vstudio/vc2010/test_filters.lua b/tests/actions/vstudio/vc2010/test_filters.lua index 9c69b62b..d895412c 100644 --- a/tests/actions/vstudio/vc2010/test_filters.lua +++ b/tests/actions/vstudio/vc2010/test_filters.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2011-2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs2010_filters") - local vc2010 = premake.vstudio.vc2010 + local vc2010 = p.vstudio.vc2010 -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks = test.createWorkspace() end diff --git a/tests/actions/vstudio/vc2010/test_floatingpoint.lua b/tests/actions/vstudio/vc2010/test_floatingpoint.lua index 1816ff24..4a402dd0 100644 --- a/tests/actions/vstudio/vc2010/test_floatingpoint.lua +++ b/tests/actions/vstudio/vc2010/test_floatingpoint.lua @@ -6,14 +6,15 @@ -- Copyright (c) 2015 Jason Perkins and the Premake project --- + local p = premake local suite = test.declare("vs2010_vc_floatingpoint") - local m = premake.vstudio.vc2010 + local m = p.vstudio.vc2010 local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks, prj = test.createWorkspace() end diff --git a/tests/actions/vstudio/vc2010/test_globals.lua b/tests/actions/vstudio/vc2010/test_globals.lua index dccee468..898a15a6 100755 --- a/tests/actions/vstudio/vc2010/test_globals.lua +++ b/tests/actions/vstudio/vc2010/test_globals.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2011-2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vs2010_globals") - local vc2010 = premake.vstudio.vc2010 + local vc2010 = p.vstudio.vc2010 -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks = test.createWorkspace() end @@ -78,7 +79,7 @@ end function suite.frameworkVersionIsCorrect_on2013() - premake.action.set("vs2013") + p.action.set("vs2013") clr "On" prepare() test.capture [[ @@ -180,7 +181,7 @@ -- function suite.structureIsCorrect_on2013() - premake.action.set("vs2013") + p.action.set("vs2013") prepare() test.capture [[ diff --git a/tests/actions/vstudio/vc2010/test_header.lua b/tests/actions/vstudio/vc2010/test_header.lua index bbd93602..58f901bc 100644 --- a/tests/actions/vstudio/vc2010/test_header.lua +++ b/tests/actions/vstudio/vc2010/test_header.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2011-2012 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vc2010_header") - local vc2010 = premake.vstudio.vc2010 + local vc2010 = p.vstudio.vc2010 -- @@ -14,7 +15,7 @@ -- function suite.project_on2010() - premake.action.set("vs2010") + p.action.set("vs2010") vc2010.project() test.capture [[ @@ -22,7 +23,7 @@ end function suite.project_on2011() - premake.action.set("vs2012") + p.action.set("vs2012") vc2010.project() test.capture [[ @@ -30,7 +31,7 @@ end function suite.project_on2013() - premake.action.set("vs2013") + p.action.set("vs2013") vc2010.project() test.capture [[ diff --git a/tests/actions/vstudio/vc2010/test_imagexex_settings.lua b/tests/actions/vstudio/vc2010/test_imagexex_settings.lua index 573d2ed9..a2303939 100644 --- a/tests/actions/vstudio/vc2010/test_imagexex_settings.lua +++ b/tests/actions/vstudio/vc2010/test_imagexex_settings.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2011-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vs2010_imagexex_settings") - local vc2010 = premake.vstudio.vc2010 - local project = premake.project + local vc2010 = p.vstudio.vc2010 + local project = p.project -- diff --git a/tests/actions/vstudio/vc2010/test_item_def_group.lua b/tests/actions/vstudio/vc2010/test_item_def_group.lua index 76d00b58..1c92f2e2 100644 --- a/tests/actions/vstudio/vc2010/test_item_def_group.lua +++ b/tests/actions/vstudio/vc2010/test_item_def_group.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs2010_item_def_group") - local vc2010 = premake.vstudio.vc2010 - local project = premake.project + local vc2010 = p.vstudio.vc2010 + local project = p.project -- diff --git a/tests/actions/vstudio/vc2010/test_language_settings.lua b/tests/actions/vstudio/vc2010/test_language_settings.lua index 188c35cc..58cf6996 100644 --- a/tests/actions/vstudio/vc2010/test_language_settings.lua +++ b/tests/actions/vstudio/vc2010/test_language_settings.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs2010_language_settings") - local vc2010 = premake.vstudio.vc2010 - local project = premake.project + local vc2010 = p.vstudio.vc2010 + local project = p.project -- @@ -16,7 +17,7 @@ local wks function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") rule "MyRules" rule "MyOtherRules" wks = test.createWorkspace() diff --git a/tests/actions/vstudio/vc2010/test_language_targets.lua b/tests/actions/vstudio/vc2010/test_language_targets.lua index 1054b634..1065f24d 100644 --- a/tests/actions/vstudio/vc2010/test_language_targets.lua +++ b/tests/actions/vstudio/vc2010/test_language_targets.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs2010_language_targets") - local vc2010 = premake.vstudio.vc2010 - local project = premake.project + local vc2010 = p.vstudio.vc2010 + local project = p.project -- @@ -16,7 +17,7 @@ local wks function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") rule "MyRules" rule "MyOtherRules" wks = test.createWorkspace() diff --git a/tests/actions/vstudio/vc2010/test_link.lua b/tests/actions/vstudio/vc2010/test_link.lua index 56a74cf8..4455d935 100644 --- a/tests/actions/vstudio/vc2010/test_link.lua +++ b/tests/actions/vstudio/vc2010/test_link.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2011-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs2010_link") - local vc2010 = premake.vstudio.vc2010 - local project = premake.project + local vc2010 = p.vstudio.vc2010 + local project = p.project -- @@ -16,7 +17,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks, prj = test.createWorkspace() kind "SharedLib" end @@ -130,7 +131,7 @@ -- function suite.generateDebugInfo_onSymbolsOn_on2010() - premake.action.set("vs2010") + p.action.set("vs2010") symbols "On" prepare() test.capture [[ @@ -141,7 +142,7 @@ end function suite.generateDebugInfo_onSymbolsFastLink_on2010() - premake.action.set("vs2010") + p.action.set("vs2010") symbols "FastLink" prepare() test.capture [[ @@ -152,7 +153,7 @@ end function suite.generateDebugInfo_onSymbolsFull_on2010() - premake.action.set("vs2010") + p.action.set("vs2010") symbols "Full" prepare() test.capture [[ @@ -163,7 +164,7 @@ end function suite.generateDebugInfo_onSymbolsOn_on2015() - premake.action.set("vs2015") + p.action.set("vs2015") symbols "On" prepare() test.capture [[ @@ -174,7 +175,7 @@ end function suite.generateDebugInfo_onSymbolsFastLink_on2015() - premake.action.set("vs2015") + p.action.set("vs2015") symbols "FastLink" prepare() test.capture [[ @@ -186,7 +187,7 @@ end function suite.generateDebugInfo_onSymbolsFull_on2015() - premake.action.set("vs2015") + p.action.set("vs2015") symbols "Full" prepare() test.capture [[ @@ -197,7 +198,7 @@ end function suite.generateDebugInfo_onSymbolsFull_on2017() - premake.action.set("vs2017") + p.action.set("vs2017") symbols "Full" prepare() test.capture [[ diff --git a/tests/actions/vstudio/vc2010/test_manifest.lua b/tests/actions/vstudio/vc2010/test_manifest.lua index 456c8153..1cb1907f 100644 --- a/tests/actions/vstudio/vc2010/test_manifest.lua +++ b/tests/actions/vstudio/vc2010/test_manifest.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2009-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs2010_manifest") - local vc2010 = premake.vstudio.vc2010 - local project = premake.project + local vc2010 = p.vstudio.vc2010 + local project = p.project -- @@ -16,7 +17,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks, prj = test.createWorkspace() kind "ConsoleApp" end diff --git a/tests/actions/vstudio/vc2010/test_nmake_props.lua b/tests/actions/vstudio/vc2010/test_nmake_props.lua index a34a0644..ab93f516 100644 --- a/tests/actions/vstudio/vc2010/test_nmake_props.lua +++ b/tests/actions/vstudio/vc2010/test_nmake_props.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs2010_nmake_props") - local vc2010 = premake.vstudio.vc2010 + local vc2010 = p.vstudio.vc2010 -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks, prj = test.createWorkspace() kind "Makefile" end @@ -127,7 +128,7 @@ command 2 end function suite.onEscapedDefines() - premake.escaper(premake.vstudio.vs2010.esc) + p.escaper(p.vstudio.vs2010.esc) defines { "&", "<", ">" } prepare() test.capture [[ @@ -136,7 +137,7 @@ command 2 &;<;>;$(NMakePreprocessorDefinitions) ]] - premake.escaper(nil) + p.escaper(nil) end function suite.onIncludeDirs() diff --git a/tests/actions/vstudio/vc2010/test_nuget_packages_config.lua b/tests/actions/vstudio/vc2010/test_nuget_packages_config.lua index 44c4b89c..45e41523 100644 --- a/tests/actions/vstudio/vc2010/test_nuget_packages_config.lua +++ b/tests/actions/vstudio/vc2010/test_nuget_packages_config.lua @@ -4,10 +4,11 @@ -- Copyright (c) 2017 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs2010_nuget_packages_config") - local vc2010 = premake.vstudio.vc2010 - local nuget2010 = premake.vstudio.nuget2010 - local project = premake.project + local vc2010 = p.vstudio.vc2010 + local nuget2010 = p.vstudio.nuget2010 + local project = p.project -- @@ -17,12 +18,12 @@ local wks function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks = test.createWorkspace() end local function prepare() - local prj = premake.solution.getproject(wks, 1) + local prj = p.solution.getproject(wks, 1) nuget2010.generatePackagesConfig(prj) end diff --git a/tests/actions/vstudio/vc2010/test_output_props.lua b/tests/actions/vstudio/vc2010/test_output_props.lua index 93f4357e..1b2edf6f 100755 --- a/tests/actions/vstudio/vc2010/test_output_props.lua +++ b/tests/actions/vstudio/vc2010/test_output_props.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2011-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vs2010_output_props") - local vc2010 = premake.vstudio.vc2010 + local vc2010 = p.vstudio.vc2010 -- @@ -15,7 +16,7 @@ local wks function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks, prj = test.createWorkspace() end diff --git a/tests/actions/vstudio/vc2010/test_platform_toolset.lua b/tests/actions/vstudio/vc2010/test_platform_toolset.lua index 464131d4..44748ff7 100644 --- a/tests/actions/vstudio/vc2010/test_platform_toolset.lua +++ b/tests/actions/vstudio/vc2010/test_platform_toolset.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2013-2015 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vs2010_platform_toolset") - local vc2010 = premake.vstudio.vc2010 + local vc2010 = p.vstudio.vc2010 -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2012") + p.action.set("vs2012") wks, prj = test.createWorkspace() files "hello.cpp" end @@ -32,14 +33,14 @@ -- function suite.correctDefault_onVS2010() - premake.action.set("vs2010") + p.action.set("vs2010") prepare() test.isemptycapture() end function suite.correctDefault_onVS2012() - premake.action.set("vs2012") + p.action.set("vs2012") prepare() test.capture [[ v110 @@ -48,7 +49,7 @@ function suite.correctDefault_onVS2013() - premake.action.set("vs2013") + p.action.set("vs2013") prepare() test.capture [[ v120 diff --git a/tests/actions/vstudio/vc2010/test_project_configs.lua b/tests/actions/vstudio/vc2010/test_project_configs.lua index 6fdd11db..989b9e04 100755 --- a/tests/actions/vstudio/vc2010/test_project_configs.lua +++ b/tests/actions/vstudio/vc2010/test_project_configs.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2009-2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vc2010_project_configs") - local vc2010 = premake.vstudio.vc2010 + local vc2010 = p.vstudio.vc2010 -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks = test.createWorkspace() end diff --git a/tests/actions/vstudio/vc2010/test_project_refs.lua b/tests/actions/vstudio/vc2010/test_project_refs.lua index 58fcfa31..d4b66332 100644 --- a/tests/actions/vstudio/vc2010/test_project_refs.lua +++ b/tests/actions/vstudio/vc2010/test_project_refs.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2011-2012 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vs2010_project_refs") - local vc2010 = premake.vstudio.vc2010 + local vc2010 = p.vstudio.vc2010 -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks = test.createWorkspace() uuid "00112233-4455-6677-8888-99AABBCCDDEE" test.createproject(wks) diff --git a/tests/actions/vstudio/vc2010/test_prop_sheet.lua b/tests/actions/vstudio/vc2010/test_prop_sheet.lua index 175f6f00..a3437834 100755 --- a/tests/actions/vstudio/vc2010/test_prop_sheet.lua +++ b/tests/actions/vstudio/vc2010/test_prop_sheet.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2011-2012 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vs2010_prop_sheet") - local vc2010 = premake.vstudio.vc2010 - local project = premake.project + local vc2010 = p.vstudio.vc2010 + local project = p.project -- @@ -16,7 +17,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks, prj = test.createWorkspace() end diff --git a/tests/actions/vstudio/vc2010/test_resource_compile.lua b/tests/actions/vstudio/vc2010/test_resource_compile.lua index e7423dd0..8135d557 100755 --- a/tests/actions/vstudio/vc2010/test_resource_compile.lua +++ b/tests/actions/vstudio/vc2010/test_resource_compile.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2011-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vs2010_resource_compiler") - local vc2010 = premake.vstudio.vc2010 - local project = premake.project + local vc2010 = p.vstudio.vc2010 + local project = p.project -- @@ -16,8 +17,8 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") - premake.escaper(premake.vstudio.vs2010.esc) + p.action.set("vs2010") + p.escaper(p.vstudio.vs2010.esc) wks, prj = test.createWorkspace() end diff --git a/tests/actions/vstudio/vc2010/test_rule_props.lua b/tests/actions/vstudio/vc2010/test_rule_props.lua index 767f4102..b5f34ea7 100644 --- a/tests/actions/vstudio/vc2010/test_rule_props.lua +++ b/tests/actions/vstudio/vc2010/test_rule_props.lua @@ -5,10 +5,10 @@ -- Copyright (c) 2016 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vs2010_rule_props") - - local vc2010 = premake.vstudio.vc2010 - local m = premake.vstudio.vs2010.rules.props + local vc2010 = p.vstudio.vc2010 + local m = p.vstudio.vs2010.rules.props -- @@ -18,7 +18,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") rule 'example' display 'Example compiler' fileExtension '.example' diff --git a/tests/actions/vstudio/vc2010/test_rule_targets.lua b/tests/actions/vstudio/vc2010/test_rule_targets.lua index f17a3745..21bda828 100644 --- a/tests/actions/vstudio/vc2010/test_rule_targets.lua +++ b/tests/actions/vstudio/vc2010/test_rule_targets.lua @@ -5,10 +5,10 @@ -- Copyright (c) 2016 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vs2010_rule_targets") - - local vc2010 = premake.vstudio.vc2010 - local m = premake.vstudio.vs2010.rules.targets + local vc2010 = p.vstudio.vc2010 + local m = p.vstudio.vs2010.rules.targets @@ -19,7 +19,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") rule 'example' display 'Example compiler' fileExtension '.example' diff --git a/tests/actions/vstudio/vc2010/test_rule_vars.lua b/tests/actions/vstudio/vc2010/test_rule_vars.lua index 6314a75c..50872e74 100644 --- a/tests/actions/vstudio/vc2010/test_rule_vars.lua +++ b/tests/actions/vstudio/vc2010/test_rule_vars.lua @@ -5,9 +5,9 @@ -- Copyright (c) 2014-2015 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vs2010_rule_vars") - - local vc2010 = premake.vstudio.vc2010 + local vc2010 = p.vstudio.vc2010 @@ -18,7 +18,7 @@ local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") rule "MyRule" wks, prj = test.createWorkspace() rules { "MyRule" } diff --git a/tests/actions/vstudio/vc2010/test_rule_xml.lua b/tests/actions/vstudio/vc2010/test_rule_xml.lua index 015434b8..a47bb77f 100644 --- a/tests/actions/vstudio/vc2010/test_rule_xml.lua +++ b/tests/actions/vstudio/vc2010/test_rule_xml.lua @@ -5,10 +5,10 @@ -- Copyright (c) 2016 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vs2010_rule_xml") - - local vc2010 = premake.vstudio.vc2010 - local m = premake.vstudio.vs2010.rules.xml + local vc2010 = p.vstudio.vc2010 + local m = p.vstudio.vs2010.rules.xml -- @@ -16,7 +16,7 @@ -- function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") rule "MyRule" wks, prj = test.createWorkspace() rules { "MyRule" } diff --git a/tests/actions/vstudio/vc2010/test_target_machine.lua b/tests/actions/vstudio/vc2010/test_target_machine.lua index 8402772b..73968bc3 100644 --- a/tests/actions/vstudio/vc2010/test_target_machine.lua +++ b/tests/actions/vstudio/vc2010/test_target_machine.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2015 Jason Perkins and the Premake project --- + local p = premake local suite = test.declare("vstudio_vs2010_target_machine") - local vc2010 = premake.vstudio.vc2010 + local vc2010 = p.vstudio.vc2010 -- diff --git a/tests/actions/vstudio/vc2010/test_user_file.lua b/tests/actions/vstudio/vc2010/test_user_file.lua index 1a995655..d34b9c44 100644 --- a/tests/actions/vstudio/vc2010/test_user_file.lua +++ b/tests/actions/vstudio/vc2010/test_user_file.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2015 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("vstudio_vs2010_user_file") - local vc2010 = premake.vstudio.vc2010 + local vc2010 = p.vstudio.vc2010 -- @@ -15,7 +16,7 @@ local wks function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks = test.createWorkspace() end diff --git a/tests/actions/vstudio/vc2010/test_vectorextensions.lua b/tests/actions/vstudio/vc2010/test_vectorextensions.lua index 7c50df72..313248dc 100644 --- a/tests/actions/vstudio/vc2010/test_vectorextensions.lua +++ b/tests/actions/vstudio/vc2010/test_vectorextensions.lua @@ -6,14 +6,15 @@ -- Copyright (c) 2015 Jason Perkins and the Premake project --- + local p = premake local suite = test.declare("vs2010_vc_vectorextensions") - local m = premake.vstudio.vc2010 + local m = p.vstudio.vc2010 local wks, prj function suite.setup() - premake.action.set("vs2010") + p.action.set("vs2010") wks, prj = test.createWorkspace() end @@ -36,7 +37,7 @@ end function suite.instructionSet_onIA32() - premake.action.set("vs2012") + p.action.set("vs2012") vectorextensions "IA32" prepare() test.capture [[ @@ -61,7 +62,7 @@ end function suite.instructionSet_onAVX() - premake.action.set("vs2013") + p.action.set("vs2013") vectorextensions "AVX" prepare() test.capture [[ @@ -76,7 +77,7 @@ end function suite.instructionSet_onAVX2() - premake.action.set("vs2013") + p.action.set("vs2013") vectorextensions "AVX2" prepare() test.capture [[ @@ -85,7 +86,7 @@ end function suite.instructionSet_onAVX2_onVS2012() - premake.action.set("vs2012") + p.action.set("vs2012") vectorextensions "AVX2" prepare() test.isemptycapture() diff --git a/tests/api/test_boolean_kind.lua b/tests/api/test_boolean_kind.lua index 77ab4bdf..78178764 100644 --- a/tests/api/test_boolean_kind.lua +++ b/tests/api/test_boolean_kind.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("api_boolean_kind") - local api = premake.api + local api = p.api -- diff --git a/tests/api/test_containers.lua b/tests/api/test_containers.lua index 5406dc63..eb500040 100644 --- a/tests/api/test_containers.lua +++ b/tests/api/test_containers.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2013-2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("api_containers") - local api = premake.api + local api = p.api -- @@ -24,7 +25,7 @@ -- function suite.workspace_createsOnFirstUse() - test.isnotnil(premake.global.getWorkspace("MyWorkspace")) + test.isnotnil(p.global.getWorkspace("MyWorkspace")) end function suite.project_createsOnFirstUse() diff --git a/tests/api/test_deprecations.lua b/tests/api/test_deprecations.lua index 13323e51..4a129e48 100644 --- a/tests/api/test_deprecations.lua +++ b/tests/api/test_deprecations.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2012-2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("api_deprecations") - local api = premake.api + local api = p.api function suite.setup() diff --git a/tests/api/test_directory_kind.lua b/tests/api/test_directory_kind.lua index a7a5cfcc..383ad0a1 100644 --- a/tests/api/test_directory_kind.lua +++ b/tests/api/test_directory_kind.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("api_directory_kind") - local api = premake.api + local api = p.api -- diff --git a/tests/api/test_list_kind.lua b/tests/api/test_list_kind.lua index 31682c07..e60218cb 100644 --- a/tests/api/test_list_kind.lua +++ b/tests/api/test_list_kind.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2012 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("api_list_kind") - local api = premake.api + local api = p.api -- diff --git a/tests/api/test_path_kind.lua b/tests/api/test_path_kind.lua index 8bb87c16..9d99c5cd 100644 --- a/tests/api/test_path_kind.lua +++ b/tests/api/test_path_kind.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2012 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("api_path_kind") - local api = premake.api + local api = p.api -- diff --git a/tests/api/test_register.lua b/tests/api/test_register.lua index 2fead38b..28ac9c4c 100644 --- a/tests/api/test_register.lua +++ b/tests/api/test_register.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2012 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("api_register") - local api = premake.api + local api = p.api -- @@ -23,7 +24,7 @@ -- function suite.registerFunctionExists() - test.isequal("function", type(premake.api.register)) + test.isequal("function", type(p.api.register)) end diff --git a/tests/api/test_string_kind.lua b/tests/api/test_string_kind.lua index 00e459d4..e6714fed 100644 --- a/tests/api/test_string_kind.lua +++ b/tests/api/test_string_kind.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2012 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("api_string_kind") - local api = premake.api + local api = p.api -- diff --git a/tests/api/test_table_kind.lua b/tests/api/test_table_kind.lua index 28f5d455..8a4b30aa 100644 --- a/tests/api/test_table_kind.lua +++ b/tests/api/test_table_kind.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2012-2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("api_table_kind") - local api = premake.api + local api = p.api -- diff --git a/tests/base/test_configset.lua b/tests/base/test_configset.lua index c31c7240..e65737a7 100644 --- a/tests/base/test_configset.lua +++ b/tests/base/test_configset.lua @@ -4,10 +4,10 @@ -- Copyright (c) 2012-2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("configset") - - local configset = premake.configset - local field = premake.field + local configset = p.configset + local field = p.field -- diff --git a/tests/base/test_context.lua b/tests/base/test_context.lua index eeee0e8b..f04ee7ba 100644 --- a/tests/base/test_context.lua +++ b/tests/base/test_context.lua @@ -4,11 +4,11 @@ -- Copyright (c) 2012-2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("context") - - local context = premake.context - local configset = premake.configset - local field = premake.field + local context = p.context + local configset = p.configset + local field = p.field -- diff --git a/tests/base/test_criteria.lua b/tests/base/test_criteria.lua index 49bdebbf..78f29f31 100644 --- a/tests/base/test_criteria.lua +++ b/tests/base/test_criteria.lua @@ -4,9 +4,9 @@ -- Copyright (c) 2012-2015 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("criteria") - - local criteria = premake.criteria + local criteria = p.criteria -- @@ -315,13 +315,13 @@ -- function suite.passes_onAliasedValue() - premake.api.addAliases("system", { ["gnu-linux"] = "linux" }) + p.api.addAliases("system", { ["gnu-linux"] = "linux" }) crit = criteria.new { "system:gnu-linux" } test.istrue(criteria.matches(crit, { system="linux" })) end function suite.passes_onAliasedValue_withMixedCase() - premake.api.addAliases("system", { ["gnu-linux"] = "linux" }) + p.api.addAliases("system", { ["gnu-linux"] = "linux" }) crit = criteria.new { "System:GNU-Linux" } test.istrue(criteria.matches(crit, { system="linux" })) end diff --git a/tests/base/test_detoken.lua b/tests/base/test_detoken.lua index c4d1d16c..51524180 100644 --- a/tests/base/test_detoken.lua +++ b/tests/base/test_detoken.lua @@ -4,9 +4,9 @@ -- Copyright (c) 2011-2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("detoken") - - local detoken = premake.detoken + local detoken = p.detoken -- @@ -17,7 +17,7 @@ local environ = {} function suite.setup() - action = premake.action.get("test") + action = p.action.get("test") end function suite.teardown() diff --git a/tests/base/test_include.lua b/tests/base/test_include.lua index 9c7aa1cb..42b1ce6d 100644 --- a/tests/base/test_include.lua +++ b/tests/base/test_include.lua @@ -5,6 +5,7 @@ -- + local p = premake local suite = test.declare("include") @@ -24,43 +25,43 @@ function suite.include_findsPremakeFile_onFolderNameOnly() include (_TESTS_DIR .. "/folder") - test.isequal("ok", premake.captured()) + test.isequal("ok", p.captured()) end function suite.include_onExactFilename() include (_TESTS_DIR .. "/folder/premake5.lua") - test.isequal("ok", premake.captured()) + test.isequal("ok", p.captured()) end function suite.include_runsOnlyOnce_onMultipleIncludes() include (_TESTS_DIR .. "/folder/premake5.lua") include (_TESTS_DIR .. "/folder/premake5.lua") - test.isequal("ok", premake.captured()) + test.isequal("ok", p.captured()) end function suite.include_runsOnlyOnce_onMultipleIncludesWithDifferentPaths() include (_TESTS_DIR .. "/folder/premake5.lua") include (_TESTS_DIR .. "/../tests/folder/premake5.lua") - test.isequal("ok", premake.captured()) + test.isequal("ok", p.captured()) end function suite.includeexternal_runs() includeexternal (_TESTS_DIR .. "/folder/premake5.lua") - test.isequal("ok", premake.captured()) + test.isequal("ok", p.captured()) end function suite.includeexternal_runsAfterInclude() include (_TESTS_DIR .. "/folder/premake5.lua") includeexternal (_TESTS_DIR .. "/folder/premake5.lua") - test.isequal("okok", premake.captured()) + test.isequal("okok", p.captured()) end function suite.includeexternal_runsTwiceAfterInclude() include (_TESTS_DIR .. "/folder/premake5.lua") includeexternal (_TESTS_DIR .. "/folder/premake5.lua") includeexternal (_TESTS_DIR .. "/folder/premake5.lua") - test.isequal("okokok", premake.captured()) + test.isequal("okokok", p.captured()) end diff --git a/tests/base/test_module_loader.lua b/tests/base/test_module_loader.lua index 3f747ff5..78eebf9e 100644 --- a/tests/base/test_module_loader.lua +++ b/tests/base/test_module_loader.lua @@ -4,6 +4,7 @@ -- Copyright (c) 2012-2015 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("module_loader") -- @@ -14,7 +15,7 @@ function suite.setup() table.insert(package.loaders, function (name) - premake.out(name) + p.out(name) return loadstring("") end) loaderIndex = #package.loaders diff --git a/tests/base/test_option.lua b/tests/base/test_option.lua index 6489b4b0..c3181839 100644 --- a/tests/base/test_option.lua +++ b/tests/base/test_option.lua @@ -4,6 +4,7 @@ -- Copyright (c) 2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("base_option") @@ -40,5 +41,5 @@ description = "Testing", } - test.isnotnil(premake.option.get("testopt2")) + test.isnotnil(p.option.get("testopt2")) end diff --git a/tests/base/test_override.lua b/tests/base/test_override.lua index dabdc891..284af330 100644 --- a/tests/base/test_override.lua +++ b/tests/base/test_override.lua @@ -5,6 +5,7 @@ -- + local p = premake local suite = test.declare("base_override") @@ -26,7 +27,7 @@ -- function suite.canOverride() - premake.override(X, "testfunc", function() + p.override(X, "testfunc", function() return "canOverride" end) test.isequal("canOverride", X.testfunc()) @@ -38,7 +39,7 @@ -- function suite.canCallOriginal() - premake.override(X, "testfunc", function(base) + p.override(X, "testfunc", function(base) return "canOverride > " .. base() end) test.isequal("canOverride > testfunc", X.testfunc()) @@ -50,7 +51,7 @@ -- function suite.canPassThroughArguments() - premake.override(X, "testfunc", function(base, value) + p.override(X, "testfunc", function(base, value) return value .. " > " .. base() end) test.isequal("testval > testfunc", X.testfunc("testval")) @@ -62,11 +63,11 @@ -- function suite.canOverrideMultipleTimes() - premake.override(X, "testfunc", function(base, value) + p.override(X, "testfunc", function(base, value) return string.format("[%s > %s]", value, base("base1")) end) - premake.override(X, "testfunc", function(base, value) + p.override(X, "testfunc", function(base, value) return string.format("{%s > %s}", value, base("base2")) end) diff --git a/tests/base/test_tree.lua b/tests/base/test_tree.lua index eafa7501..7591ef43 100644 --- a/tests/base/test_tree.lua +++ b/tests/base/test_tree.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2009-2012 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("base_tree") - local tree = premake.tree + local tree = p.tree -- diff --git a/tests/config/test_linkinfo.lua b/tests/config/test_linkinfo.lua index 4bcdaa37..1365c377 100755 --- a/tests/config/test_linkinfo.lua +++ b/tests/config/test_linkinfo.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2012-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("config_linkinfo") - local config = premake.config + local config = p.config -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.action.set("test") + p.action.set("test") wks, prj = test.createWorkspace() kind "StaticLib" system "Windows" diff --git a/tests/config/test_links.lua b/tests/config/test_links.lua index 67f68a33..3acad79e 100755 --- a/tests/config/test_links.lua +++ b/tests/config/test_links.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2012-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("config_links") - local config = premake.config + local config = p.config -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.action.set("test") + p.action.set("test") _TARGET_OS = "windows" wks, prj = test.createWorkspace() end diff --git a/tests/config/test_targetinfo.lua b/tests/config/test_targetinfo.lua index bad4b393..12252a4c 100755 --- a/tests/config/test_targetinfo.lua +++ b/tests/config/test_targetinfo.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2011-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("config_targetinfo") - local config = premake.config + local config = p.config -- @@ -15,7 +16,7 @@ local wks, prj function suite.setup() - premake.action.set("test") + p.action.set("test") wks, prj = test.createWorkspace() system "macosx" end diff --git a/tests/oven/test_filtering.lua b/tests/oven/test_filtering.lua index f556bd7b..a9906a5b 100644 --- a/tests/oven/test_filtering.lua +++ b/tests/oven/test_filtering.lua @@ -4,6 +4,7 @@ -- Copyright (c) 2011-2014 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("oven_filtering") @@ -29,7 +30,7 @@ -- function suite.onAction() - premake.action.set("vs2012") + p.action.set("vs2012") filter { "action:vs2012" } defines { "USE_VS2012" } prepare() @@ -37,7 +38,7 @@ end function suite.onActionMismatch() - premake.action.set("vs2010") + p.action.set("vs2010") filter { "action:vs2012" } defines { "USE_VS2012" } prepare() diff --git a/tests/oven/test_objdirs.lua b/tests/oven/test_objdirs.lua index 0fad6620..ecb5019c 100644 --- a/tests/oven/test_objdirs.lua +++ b/tests/oven/test_objdirs.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2014-2015 Jason Perkins and the Premake project --- + local p = premake local suite = test.declare("oven_objdirs") - local oven = premake.oven + local oven = p.oven --- -- Setup diff --git a/tests/project/test_eachconfig.lua b/tests/project/test_eachconfig.lua index 7ef4d903..08bb354b 100755 --- a/tests/project/test_eachconfig.lua +++ b/tests/project/test_eachconfig.lua @@ -4,6 +4,7 @@ -- Copyright (c) 2011-2015 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("project_eachconfig") @@ -23,7 +24,7 @@ configurations ( buildcfgs ) end prj = test.getproject(wks, 1) - for cfg in premake.project.eachconfig(prj) do + for cfg in p.project.eachconfig(prj) do _p(2,'%s:%s', cfg.buildcfg or "", cfg.platform or "") end end diff --git a/tests/project/test_sources.lua b/tests/project/test_sources.lua index c5d52c93..84f5ee57 100644 --- a/tests/project/test_sources.lua +++ b/tests/project/test_sources.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2011-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("project_sources") - local project = premake.project + local project = p.project -- @@ -25,7 +26,7 @@ os.chdir(cwd) -- Create a token to be used in search paths - premake.api.register { name = "mytoken", kind = "string", scope = "config" } + p.api.register { name = "mytoken", kind = "string", scope = "config" } mytoken "test" end diff --git a/tests/project/test_vpaths.lua b/tests/project/test_vpaths.lua index 84850b49..63a58d8d 100644 --- a/tests/project/test_vpaths.lua +++ b/tests/project/test_vpaths.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2011-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("project_vpaths") - local project = premake.project + local project = p.project -- diff --git a/tests/tools/test_dotnet.lua b/tests/tools/test_dotnet.lua index cd86946b..8ed7c8a7 100644 --- a/tests/tools/test_dotnet.lua +++ b/tests/tools/test_dotnet.lua @@ -4,8 +4,9 @@ -- Copyright (c) 2012-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("tools_dotnet") - local dotnet = premake.tools.dotnet + local dotnet = p.tools.dotnet -- diff --git a/tests/tools/test_gcc.lua b/tests/tools/test_gcc.lua index 7aa35e42..06f6d812 100644 --- a/tests/tools/test_gcc.lua +++ b/tests/tools/test_gcc.lua @@ -4,10 +4,11 @@ -- Copyright (c) 2009-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("tools_gcc") - local gcc = premake.tools.gcc - local project = premake.project + local gcc = p.tools.gcc + local project = p.project -- diff --git a/tests/tools/test_msc.lua b/tests/tools/test_msc.lua index 78456367..efc8cc8c 100644 --- a/tests/tools/test_msc.lua +++ b/tests/tools/test_msc.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2012-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("tools_msc") - local msc = premake.tools.msc + local msc = p.tools.msc -- diff --git a/tests/tools/test_snc.lua b/tests/tools/test_snc.lua index 2acba0f8..fefc6e8f 100644 --- a/tests/tools/test_snc.lua +++ b/tests/tools/test_snc.lua @@ -4,9 +4,10 @@ -- Copyright (c) 2012-2013 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("tools_snc") - local snc = premake.tools.snc + local snc = p.tools.snc -- diff --git a/tests/workspace/test_objdirs.lua b/tests/workspace/test_objdirs.lua index c2590e8f..ad74c9f7 100644 --- a/tests/workspace/test_objdirs.lua +++ b/tests/workspace/test_objdirs.lua @@ -4,6 +4,7 @@ -- Copyright (c) 2012-2015 Jason Perkins and the Premake project -- + local p = premake local suite = test.declare("workspace_objdir") @@ -14,7 +15,7 @@ local wks function suite.setup() - premake.action.set("test") + p.action.set("test") wks = workspace("MyWorkspace") system "macosx" end @@ -23,7 +24,7 @@ local platforms = wks.platforms or {} local prj = project("MyProject") local cfg = test.getconfig(prj, "Debug", platforms[1]) - return premake.project.getrelative(cfg.project, cfg.objdir) + return p.project.getrelative(cfg.project, cfg.objdir) end