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
-- 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 = {}
@ -28,9 +28,9 @@
dotnet = { "mono", "msnet", "pnet" }
},
onSolution = function(sln)
onWorkspace = function(wrk)
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,
onProject = function(prj)
@ -43,8 +43,8 @@
end
end,
onCleanSolution = function(sln)
premake.clean.file(sln, make.getmakefilename(sln, false))
onCleanWorkspace = function(wrk)
premake.clean.file(wrk, make.getmakefilename(wrk, false))
end,
onCleanProject = function(prj)

View File

@ -96,10 +96,10 @@
-- Solution and project generation logic
onSolution = vstudio.vs2005.generateSolution,
onWorkspace = vstudio.vs2005.generateSolution,
onProject = vstudio.vs2005.generateProject,
onCleanSolution = vstudio.cleanSolution,
onCleanWorkspace = vstudio.cleanSolution,
onCleanProject = vstudio.cleanProject,
onCleanTarget = vstudio.cleanTarget,

View File

@ -35,10 +35,10 @@
-- Solution and project generation logic
onSolution = vstudio.vs2005.generateSolution,
onWorkspace = vstudio.vs2005.generateSolution,
onProject = vstudio.vs2005.generateProject,
onCleanSolution = vstudio.cleanSolution,
onCleanWorkspace = vstudio.cleanSolution,
onCleanProject = vstudio.cleanProject,
onCleanTarget = vstudio.cleanTarget,

View File

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

View File

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

View File

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

View File

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

View File

@ -73,20 +73,20 @@
---
function action.call(name)
local act = action._list[name]
local a = action._list[name]
if act.onStart then
act.onStart()
if a.onStart then
a.onStart()
end
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
onSolution(sln)
end
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
onProject(prj)
end
@ -94,18 +94,18 @@
end
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
onRule(rule)
end
end
if act.execute then
act.execute()
if a.execute then
a.execute()
end
if act.onEnd then
act.onEnd()
if a.onEnd then
a.onEnd()
end
end