Change action callbacks from "solution" to "workspace"

This commit is contained in:
Jason Perkins 2015-07-29 15:40:20 -04:00
parent 2db9ed2061
commit f5e27d1e6d
8 changed files with 41 additions and 41 deletions

View File

@ -1,7 +1,7 @@
-- --
-- _make.lua -- _make.lua
-- Define the makefile action(s). -- Define the makefile action(s).
-- Copyright (c) 2002-2013 Jason Perkins and the Premake project -- Copyright (c) 2002-2015 Jason Perkins and the Premake project
-- --
premake.make = {} premake.make = {}
@ -28,9 +28,9 @@
dotnet = { "mono", "msnet", "pnet" } dotnet = { "mono", "msnet", "pnet" }
}, },
onSolution = function(sln) onWorkspace = function(wrk)
premake.escaper(make.esc) premake.escaper(make.esc)
premake.generate(sln, make.getmakefilename(sln, false), make.generate_solution) premake.generate(wrk, make.getmakefilename(wrk, false), make.generate_solution)
end, end,
onProject = function(prj) onProject = function(prj)
@ -43,8 +43,8 @@
end end
end, end,
onCleanSolution = function(sln) onCleanWorkspace = function(wrk)
premake.clean.file(sln, make.getmakefilename(sln, false)) premake.clean.file(wrk, make.getmakefilename(wrk, false))
end, end,
onCleanProject = function(prj) onCleanProject = function(prj)

View File

@ -96,12 +96,12 @@
-- Solution and project generation logic -- Solution and project generation logic
onSolution = vstudio.vs2005.generateSolution, onWorkspace = vstudio.vs2005.generateSolution,
onProject = vstudio.vs2005.generateProject, onProject = vstudio.vs2005.generateProject,
onCleanSolution = vstudio.cleanSolution, onCleanWorkspace = vstudio.cleanSolution,
onCleanProject = vstudio.cleanProject, onCleanProject = vstudio.cleanProject,
onCleanTarget = vstudio.cleanTarget, onCleanTarget = vstudio.cleanTarget,
-- This stuff is specific to the Visual Studio exporters -- This stuff is specific to the Visual Studio exporters

View File

@ -35,12 +35,12 @@
-- Solution and project generation logic -- Solution and project generation logic
onSolution = vstudio.vs2005.generateSolution, onWorkspace = vstudio.vs2005.generateSolution,
onProject = vstudio.vs2005.generateProject, onProject = vstudio.vs2005.generateProject,
onCleanSolution = vstudio.cleanSolution, onCleanWorkspace = vstudio.cleanSolution,
onCleanProject = vstudio.cleanProject, onCleanProject = vstudio.cleanProject,
onCleanTarget = vstudio.cleanTarget, onCleanTarget = vstudio.cleanTarget,
-- This stuff is specific to the Visual Studio exporters -- This stuff is specific to the Visual Studio exporters

View File

@ -121,8 +121,8 @@
-- Solution and project generation logic -- Solution and project generation logic
onSolution = function(sln) onWorkspace = function(wrk)
vstudio.vs2005.generateSolution(sln) vstudio.vs2005.generateSolution(wrk)
end, end,
onProject = function(prj) onProject = function(prj)
vstudio.vs2010.generateProject(prj) vstudio.vs2010.generateProject(prj)
@ -131,8 +131,8 @@
vstudio.vs2010.generateRule(rule) vstudio.vs2010.generateRule(rule)
end, end,
onCleanSolution = function(sln) onCleanWorkspace = function(wrk)
vstudio.cleanSolution(sln) vstudio.cleanSolution(wrk)
end, end,
onCleanProject = function(prj) onCleanProject = function(prj)
vstudio.cleanProject(prj) vstudio.cleanProject(prj)

View File

@ -37,8 +37,8 @@
-- Solution and project generation logic -- Solution and project generation logic
onSolution = function(sln) onWorkspace = function(wrk)
vstudio.vs2005.generateSolution(sln) vstudio.vs2005.generateSolution(wrk)
end, end,
onProject = function(prj) onProject = function(prj)
vstudio.vs2010.generateProject(prj) vstudio.vs2010.generateProject(prj)
@ -47,8 +47,8 @@
vstudio.vs2010.generateRule(rule) vstudio.vs2010.generateRule(rule)
end, end,
onCleanSolution = function(sln) onCleanWorkspace = function(wrk)
vstudio.cleanSolution(sln) vstudio.cleanSolution(wrk)
end, end,
onCleanProject = function(prj) onCleanProject = function(prj)
vstudio.cleanProject(prj) vstudio.cleanProject(prj)

View File

@ -39,8 +39,8 @@
-- Solution and project generation logic -- Solution and project generation logic
onSolution = function(sln) onWorkspace = function(wrk)
vstudio.vs2005.generateSolution(sln) vstudio.vs2005.generateSolution(wrk)
end, end,
onProject = function(prj) onProject = function(prj)
vstudio.vs2010.generateProject(prj) vstudio.vs2010.generateProject(prj)
@ -49,8 +49,8 @@
vstudio.vs2010.generateRule(rule) vstudio.vs2010.generateRule(rule)
end, end,
onCleanSolution = function(sln) onCleanWorkspace = function(wrk)
vstudio.cleanSolution(sln) vstudio.cleanSolution(wrk)
end, end,
onCleanProject = function(prj) onCleanProject = function(prj)
vstudio.cleanProject(prj) vstudio.cleanProject(prj)

View File

@ -39,8 +39,8 @@
-- Solution and project generation logic -- Solution and project generation logic
onSolution = function(sln) onWorkspace = function(wrk)
vstudio.vs2005.generateSolution(sln) vstudio.vs2005.generateSolution(wrk)
end, end,
onProject = function(prj) onProject = function(prj)
vstudio.vs2010.generateProject(prj) vstudio.vs2010.generateProject(prj)
@ -49,8 +49,8 @@
vstudio.vs2010.generateRule(rule) vstudio.vs2010.generateRule(rule)
end, end,
onCleanSolution = function(sln) onCleanWorkspace = function(wrk)
vstudio.cleanSolution(sln) vstudio.cleanSolution(wrk)
end, end,
onCleanProject = function(prj) onCleanProject = function(prj)
vstudio.cleanProject(prj) vstudio.cleanProject(prj)

View File

@ -73,20 +73,20 @@
--- ---
function action.call(name) function action.call(name)
local act = action._list[name] local a = action._list[name]
if act.onStart then if a.onStart then
act.onStart() a.onStart()
end end
for sln in p.global.eachSolution() do for sln in p.global.eachSolution() do
local onSolution = act.onSolution or act.onsolution local onSolution = a.onWorkspace or a.onSolution or a.onsolution
if onSolution and not sln.external then if onSolution and not sln.external then
onSolution(sln) onSolution(sln)
end end
for prj in p.solution.eachproject(sln) do for prj in p.solution.eachproject(sln) do
local onProject = act.onProject or act.onproject local onProject = a.onProject or a.onproject
if onProject and not prj.external then if onProject and not prj.external then
onProject(prj) onProject(prj)
end end
@ -94,18 +94,18 @@
end end
for rule in p.global.eachRule() do for rule in p.global.eachRule() do
local onRule = act.onRule or act.onrule local onRule = a.onRule or a.onrule
if onRule and not rule.external then if onRule and not rule.external then
onRule(rule) onRule(rule)
end end
end end
if act.execute then if a.execute then
act.execute() a.execute()
end end
if act.onEnd then if a.onEnd then
act.onEnd() a.onEnd()
end end
end end