Re-standardize all project APIs to Lua's all-lowercase style

See [this discussion topic](https://groups.google.com/forum/#!topic/premake-development/W1rRPcMmM0k)
This commit is contained in:
Jason Perkins 2015-05-05 14:46:00 -04:00
parent 1503a14fbd
commit 2df200eb2d
15 changed files with 53 additions and 65 deletions

View File

@ -69,7 +69,6 @@
},
}
api.register {
name = "buildcommands",
scope = { "config", "rule" },
@ -78,18 +77,14 @@
pathVars = true,
}
api.alias("buildcommands", "buildCommands")
api.register {
name = "buildDependencies",
name = "builddependencies",
scope = { "rule" },
kind = "list:string",
tokens = true,
pathVars = true,
}
api.register {
name = "buildlog",
scope = { "config" },
@ -98,7 +93,6 @@
pathVars = true,
}
api.register {
name = "buildmessage",
scope = { "config", "rule" },
@ -107,9 +101,6 @@
pathVars = true,
}
api.alias("buildmessage", "buildMessage")
api.register {
name = "buildoptions",
scope = "config",
@ -118,7 +109,6 @@
pathVars = true,
}
api.register {
name = "buildoutputs",
scope = { "config", "rule" },
@ -127,9 +117,6 @@
pathVars = true,
}
api.alias("buildoutputs", "buildOutputs")
api.register {
name = "buildinputs",
scope = "config",
@ -153,14 +140,12 @@
pathVars = true,
}
api.register {
name = "cleanExtensions",
name = "cleanextensions",
scope = "config",
kind = "list:string",
}
api.register {
name = "clr",
scope = "config",
@ -174,16 +159,14 @@
}
}
api.register {
name = "configmap",
scope = "project",
kind = "list:keyed:array:string",
}
api.register {
name = "configFile",
name = "configfile",
scope = "config",
kind = "string",
tokens = true,
@ -344,7 +327,6 @@
tokens = true,
}
api.register {
name = "disablewarnings",
scope = "config",
@ -352,21 +334,18 @@
tokens = true,
}
api.register {
name = "display",
scope = "rule",
kind = "string",
}
api.register {
name = "editAndContinue",
name = "editandcontinue",
scope = "config",
kind = "boolean",
}
api.register {
name = "enablewarnings",
scope = "config",
@ -385,12 +364,6 @@
},
}
-- For backward compatibility, excludes() is now an alias for removefiles()
function excludes(value)
removefiles(value)
end
api.register {
name = "fatalwarnings",
scope = "config",
@ -398,14 +371,12 @@
tokens = true,
}
api.register {
name = "fileExtension",
name = "fileextension",
scope = "rule",
kind = "string",
}
api.register {
name = "filename",
scope = { "project", "rule" },
@ -519,7 +490,6 @@
}
}
api.register {
name = "framework",
scope = "config",
@ -792,7 +762,7 @@
}
api.register {
name = "propertyDefinition",
name = "propertydefinition",
scope = "rule",
kind = "list:table",
}
@ -983,6 +953,24 @@
}
-----------------------------------------------------------------------------
--
-- Field name aliases for backward compatibility
--
-----------------------------------------------------------------------------
api.alias("buildcommands", "buildCommands")
api.alias("builddependencies", "buildDependencies")
api.alias("buildmessage", "buildMessage")
api.alias("buildoutputs", "buildOutputs")
api.alias("cleanextensions", "cleanExtensions")
api.alias("configfile", "configFile")
api.alias("editandcontinue", "editAndContinue")
api.alias("fileextension", "fileExtension")
api.alias("propertydefinition", "propertyDefinition")
api.alias("removefiles", "excludes")
-----------------------------------------------------------------------------
--
-- Handlers for deprecated fields and values.
@ -1088,10 +1076,10 @@
api.deprecateValue("flags", "NoEditAndContinue", nil,
function(value)
editAndContinue "Off"
editandcontinue "Off"
end,
function(value)
editAndContinue "On"
editandcontinue "On"
end)
@ -1211,7 +1199,7 @@
-----------------------------------------------------------------------------
clr "Off"
editAndContinue "On"
editandcontinue "On"
-- Setting a default language makes some validation easier later

View File

@ -753,7 +753,7 @@
return 1
else
-- Edit-and-continue doesn't work for some configurations
if not cfg.editAndContinue or
if not cfg.editandcontinue or
config.isOptimizedBuild(cfg) or
cfg.clr ~= p.OFF or
cfg.architecture == p.X86_64

View File

@ -105,7 +105,7 @@
---
function m.propertyDefaults(r)
local defs = r.propertyDefinition
local defs = r.propertydefinition
for i = 1, #defs do
local def = defs[i]
local value = def.value
@ -125,7 +125,7 @@
---
function m.additionalDependencies(r)
local deps = table.concat(r.buildDependencies, ";")
local deps = table.concat(r.builddependencies, ";")
p.x('<AdditionalDependencies>%s</AdditionalDependencies>', deps)
end

View File

@ -308,7 +308,7 @@
function m.properties(r)
local defs = r.propertyDefinition
local defs = r.propertydefinition
for i = 1, #defs do
local name = defs[i].name
p.w('%s="%%(%s.%s)"', name, r.name, name)
@ -353,7 +353,7 @@
function m.targetInputs(r)
local extra = {}
local defs = r.propertyDefinition
local defs = r.propertydefinition
for i = 1, #defs do
local def = defs[i]
if def.dependency then
@ -385,7 +385,7 @@
function m.tlogProperties(r)
local defs = r.propertyDefinition
local defs = r.propertydefinition
for i = 1, #defs do
local def = defs[i]
if def.dependency then
@ -398,7 +398,7 @@
function m.tlogRead(r)
local extra = {}
local defs = r.propertyDefinition
local defs = r.propertydefinition
for i = 1, #defs do
local def = defs[i]
if def.dependency then

View File

@ -110,7 +110,7 @@
---
function m.properties(r)
local defs = r.propertyDefinition
local defs = r.propertydefinition
for i = 1, #defs do
local def = defs[i]
if def.kind == "boolean" then
@ -339,7 +339,7 @@
function m.fileExtension(r)
p.push('<FileExtension')
p.w('Name="*%s"', r.fileExtension)
p.w('Name="*%s"', r.fileextension)
p.w('ContentType="%s" />', r.name)
p.pop()
end

View File

@ -1033,7 +1033,7 @@
elseif cfg.architecture == "x86_64" or
cfg.clr ~= p.OFF or
config.isOptimizedBuild(cfg) or
not cfg.editAndContinue
not cfg.editandcontinue
then
value = "ProgramDatabase"
else
@ -1103,8 +1103,8 @@
function m.extensionsToDeleteOnClean(cfg)
if #cfg.cleanExtensions > 0 then
local value = table.implode(cfg.cleanExtensions, "*", ";", "")
if #cfg.cleanextensions > 0 then
local value = table.implode(cfg.cleanextensions, "*", ";", "")
m.element("ExtensionsToDeleteOnClean", nil, value .. "$(ExtensionsToDeleteOnClean)")
end
end
@ -1177,8 +1177,8 @@
function m.imageXex(cfg)
if cfg.system == premake.XBOX360 then
_p(2,'<ImageXex>')
if cfg.configFile then
_p(3,'<ConfigurationFile>%s</ConfigurationFile>', cfg.configFile)
if cfg.configfile then
_p(3,'<ConfigurationFile>%s</ConfigurationFile>', cfg.configfile)
else
_p(3,'<ConfigurationFile>')
_p(3,'</ConfigurationFile>')

View File

@ -80,7 +80,7 @@
local ext = path.getextension(fname):lower()
for rule in global.eachRule() do
if not rules or table.contains(rules, rule.name) then
if rule.fileExtension == ext then
if rule.fileextension == ext then
return rule
end
end

View File

@ -200,7 +200,7 @@
function p.rule.bake(r)
table.sort(r.propertyDefinition, function (a, b)
table.sort(r.propertydefinition, function (a, b)
return a.name < b.name
end)
end

View File

@ -38,7 +38,7 @@
---
function rule.eachProperty(self)
local props = self.propertyDefinition
local props = self.propertydefinition
local i = 0
return function ()
i = i + 1
@ -60,7 +60,7 @@
---
function rule.getProperty(self, name)
local props = self.propertyDefinition
local props = self.propertydefinition
for i = 1, #props do
local prop = props[i]
if prop.name == name then

View File

@ -580,12 +580,12 @@
--
-- Check the handling of the editAndContinue flag.
-- Check the handling of the editandcontinue flag.
--
function suite.debugFormat_onEditAndContinueOff()
flags { "Symbols" }
editAndContinue "Off"
editandcontinue "Off"
prepare()
test.capture [[
<ClCompile>

View File

@ -18,8 +18,8 @@
_ACTION = "vs2010"
rule "Animation"
fileExtension ".dae"
propertyDefinition {
fileextension ".dae"
propertydefinition {
name = "AdditionalOptions",
kind = "list",
separator = ";"

View File

@ -175,7 +175,7 @@
files { "hello.dae" }
rule "Animation"
fileExtension ".dae"
fileextension ".dae"
prepare()
test.capture [[

View File

@ -44,7 +44,7 @@
-- Ensure configuration file is output in ImageXex block
--
function suite.defaultSettings()
configFile "testconfig.xml"
configfile "testconfig.xml"
prepare()
test.capture [[
<ImageXex>

View File

@ -240,7 +240,7 @@
--
function suite.extensionsToDeleteOnClean()
cleanExtensions { ".temp1", ".temp2" }
cleanextensions { ".temp1", ".temp2" }
prepare()
test.capture [[
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

View File

@ -24,7 +24,7 @@
local function createVar(def)
rule "MyRule"
propertyDefinition(def)
propertydefinition(def)
project "MyProject"
end