Turn off deprecation warnings for fields and values that can be easily translated.
To ease the transition to 5.0, allow these values to continue to work while marking them deprecated in the documentation. Will put the messages back some time after release when folks have had a chance to switch.
This commit is contained in:
parent
24050ebc2c
commit
3b960f01be
@ -777,7 +777,7 @@
|
||||
|
||||
-- 09 Apr 2013
|
||||
|
||||
api.deprecateField("buildrule", DOC_URL .. "Custom_Build_Commands",
|
||||
api.deprecateField("buildrule", nil,
|
||||
function(value)
|
||||
if value.description then
|
||||
buildmessage(value.description)
|
||||
@ -788,14 +788,14 @@
|
||||
|
||||
-- 17 Jun 2013
|
||||
|
||||
api.deprecateValue("flags", "Component", DOC_URL .. "buildaction",
|
||||
api.deprecateValue("flags", "Component", nil,
|
||||
function(value)
|
||||
buildaction "Component"
|
||||
end)
|
||||
|
||||
-- 26 Sep 2013
|
||||
|
||||
api.deprecateValue("flags", { "EnableSSE", "EnableSSE2" }, DOC_URL .. "vectorextensions",
|
||||
api.deprecateValue("flags", { "EnableSSE", "EnableSSE2" }, nil,
|
||||
function(value)
|
||||
vectorextensions(value:sub(7))
|
||||
end,
|
||||
@ -803,7 +803,7 @@
|
||||
vectorextension "Default"
|
||||
end)
|
||||
|
||||
api.deprecateValue("flags", { "FloatFast", "FloatStrict" }, DOC_URL .. "floatingpoint",
|
||||
api.deprecateValue("flags", { "FloatFast", "FloatStrict" }, nil,
|
||||
function(value)
|
||||
floatingpoint(value:sub(6))
|
||||
end,
|
||||
@ -811,7 +811,7 @@
|
||||
floatingpoint "Default"
|
||||
end)
|
||||
|
||||
api.deprecateValue("flags", { "NativeWChar", "NoNativeWChar" }, DOC_URL .. "nativewchar",
|
||||
api.deprecateValue("flags", { "NativeWChar", "NoNativeWChar" }, nil,
|
||||
function(value)
|
||||
local map = { NativeWChar = "On", NoNativeWChar = "Off" }
|
||||
nativewchar(map[value] or "Default")
|
||||
@ -820,7 +820,7 @@
|
||||
nativewchar "Default"
|
||||
end)
|
||||
|
||||
api.deprecateValue("flags", { "Optimize", "OptimizeSize", "OptimizeSpeed" }, DOC_URL .. "optimize",
|
||||
api.deprecateValue("flags", { "Optimize", "OptimizeSize", "OptimizeSpeed" }, nil,
|
||||
function(value)
|
||||
local map = { Optimize = "On", OptimizeSize = "Size", OptimizeSpeed = "Speed" }
|
||||
optimize (map[value] or "Off")
|
||||
@ -829,7 +829,7 @@
|
||||
optimize "Off"
|
||||
end)
|
||||
|
||||
api.deprecateValue("flags", { "Optimise", "OptimiseSize", "OptimiseSpeed" }, DOC_URL .. "optimize",
|
||||
api.deprecateValue("flags", { "Optimise", "OptimiseSize", "OptimiseSpeed" }, nil,
|
||||
function(value)
|
||||
local map = { Optimise = "On", OptimiseSize = "Size", OptimiseSpeed = "Speed" }
|
||||
optimize (map[value] or "Off")
|
||||
@ -838,7 +838,7 @@
|
||||
optimize "Off"
|
||||
end)
|
||||
|
||||
api.deprecateValue("flags", { "ExtraWarnings", "NoWarnings" }, DOC_URL .. "warnings",
|
||||
api.deprecateValue("flags", { "ExtraWarnings", "NoWarnings" }, nil,
|
||||
function(value)
|
||||
local map = { ExtraWarnings = "Extra", NoWarnings = "Off" }
|
||||
warnings (map[value] or "Default")
|
||||
|
@ -491,8 +491,8 @@
|
||||
|
||||
if field.deprecated and type(field.deprecated.handler) == "function" then
|
||||
field.deprecated.handler(value)
|
||||
if api._deprecations ~= "off" then
|
||||
premake.warnOnce(field.name, "the field %s has been deprecated.\n %s", field.name, field.deprecated.message or "")
|
||||
if field.deprecated.message and api._deprecations ~= "off" then
|
||||
premake.warnOnce(field.name, "the field %s has been deprecated.\n %s", field.name, field.deprecated.message)
|
||||
if api._deprecations == "error" then error("deprecation errors enabled", 3) end
|
||||
end
|
||||
end
|
||||
@ -542,9 +542,9 @@
|
||||
if field.deprecated[value] then
|
||||
local handler = field.deprecated[value]
|
||||
if handler.remove then handler.remove(value) end
|
||||
if api._deprecations ~= "off" then
|
||||
if handler.message and api._deprecations ~= "off" then
|
||||
local key = field.name .. "_" .. value
|
||||
premake.warnOnce(key, "the %s value %s has been deprecated.\n %s", field.name, value, handler.message or "")
|
||||
premake.warnOnce(key, "the %s value %s has been deprecated.\n %s", field.name, value, handler.message)
|
||||
if api._deprecations == "error" then
|
||||
error { msg="deprecation errors enabled" }
|
||||
end
|
||||
@ -643,9 +643,9 @@
|
||||
if field.deprecated and field.deprecated[canonical] then
|
||||
local handler = field.deprecated[canonical]
|
||||
handler.add(canonical)
|
||||
if api._deprecations ~= "off" then
|
||||
if handler.message and api._deprecations ~= "off" then
|
||||
local key = field.name .. "_" .. value
|
||||
premake.warnOnce(key, "the %s value %s has been deprecated.\n %s", field.name, canonical, handler.message or "")
|
||||
premake.warnOnce(key, "the %s value %s has been deprecated.\n %s", field.name, canonical, handler.message)
|
||||
if api._deprecations == "error" then
|
||||
return nil, "deprecation errors enabled"
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user