forked from premake/premake-eclipse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_preload.lua
50 lines (42 loc) · 1.31 KB
/
_preload.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
--
-- Name: eclipse/_preload.lua
-- Purpose: Define the Eclipse action.
-- Author: Manu Evans
-- Copyright: (c) 2013-2015 Manu Evans and the Premake project
--
local p = premake
--
-- Eclipse action
--
newaction
{
trigger = "eclipse",
shortname = "Eclipse",
description = "Generate Eclipse project files",
module = "eclipse",
valid_kinds = { "ConsoleApp", "Makefile", "SharedLib", "StaticLib", "WindowedApp" },
valid_languages = { "C", "C++"},
valid_tools = {
cc = { "msc", "gcc", "clang" }
},
onsolution = function(sln)
-- eclipse workspace?
-- premake.generate(sln, sln.name .. ".workspace", eclipse.workspace.generate)
end,
onproject = function(prj)
-- TODO: eclipse won't work where all projects are created in the same place as the workspace
premake.generate(prj, ".project", p.modules.eclipse.project.generate)
premake.generate(prj, ".cproject", p.modules.eclipse.cproject.generate)
end,
oncleansolution = function(sln)
-- delete solution files...
-- this should probably include the entire .workspace/ folder...
end,
onCleanTarget = function(prj)
-- delete the target stuff...
end,
oncleanproject = function(prj)
premake.clean.file(prj, ".project")
premake.clean.file(prj, ".cproject")
end
}