Split rule file generation into namespaces to prevent function name overlaps

This commit is contained in:
Jason Perkins 2014-08-14 17:45:44 -04:00
parent 643a0067f0
commit f99293bee2
4 changed files with 22 additions and 16 deletions

View File

@ -48,9 +48,9 @@
p.indent(" ")
p.escaper(vs2010.esc)
p.generate(rule, ".props", vstudio.rules.generateRuleProps)
p.generate(rule, ".targets", vstudio.rules.generateRuleTargets)
p.generate(rule, ".xml", vstudio.rules.generateRuleXml)
p.generate(rule, ".props", vstudio.rules.props.generate)
p.generate(rule, ".targets", vstudio.rules.targets.generate)
p.generate(rule, ".xml", vstudio.rules.xml.generate)
end

View File

@ -5,11 +5,12 @@
--
premake.vstudio.rules = {}
local m = premake.vstudio.rules
premake.vstudio.rules.props = {}
local m = premake.vstudio.rules.props
m.elements = {}
local p = premake
m.elements = {}
@ -17,7 +18,7 @@
-- Entry point; generate the root <Project> element.
---
m.elements.ruleProps = function(r)
m.elements.project = function(r)
return {
p.xmlUtf8,
p.vstudio.projectElement,
@ -27,8 +28,8 @@
}
end
function m.generateRuleProps(r)
p.callArray(m.elements.ruleProps, r)
function m.generate(r)
p.callArray(m.elements.project, r)
p.pop()
p.out('</Project>')
end

View File

@ -4,7 +4,10 @@
-- Copyright (c) 2014 Jason Perkins and the Premake project
--
local m = premake.vstudio.rules
premake.vstudio.rules.targets = {}
local m = premake.vstudio.rules.targets
m.elements = {}
local p = premake
@ -13,7 +16,7 @@
-- Entry point; generate the root <Project> element.
---
m.elements.ruleTargets = function(r)
m.elements.project = function(r)
return {
p.xmlUtf8,
p.vstudio.projectElement,
@ -24,8 +27,8 @@
}
end
function m.generateRuleTargets(r)
p.callArray(m.elements.ruleTargets, r)
function m.generate(r)
p.callArray(m.elements.project, r)
p.pop()
p.out('</Project>')
end

View File

@ -4,7 +4,9 @@
-- Copyright (c) 2014 Jason Perkins and the Premake project
--
local m = premake.vstudio.rules
premake.vstudio.rules.xml = {}
local m = premake.vstudio.rules.xml
m.elements = {}
local p = premake
@ -13,7 +15,7 @@
-- Entry point; generate the root <ProjectSchemaDefinitions> element.
---
m.elements.ruleXml = function(r)
m.elements.project = function(r)
return {
p.xmlUtf8,
m.projectSchemaDefinitions,
@ -24,8 +26,8 @@
}
end
function m.generateRuleXml(r)
p.callArray(m.elements.ruleXml, r)
function m.generate(r)
p.callArray(m.elements.project, r)
p.pop('</ProjectSchemaDefinitions>')
end