This repository was archived by the owner on Jun 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmonodevelop.lua
More file actions
132 lines (108 loc) · 3.01 KB
/
monodevelop.lua
File metadata and controls
132 lines (108 loc) · 3.01 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
--
-- Name: monodevelop/monodevelop.lua
-- Purpose: Define the MonoDevelop action.
-- Author: Manu Evans
-- Created: 2013/10/28
-- Copyright: (c) 2013-2015 Manu Evans and the Premake project
--
local p = premake
p.modules.monodevelop = {}
local m = p.modules.monodevelop
m._VERSION = p._VERSION
m.elements = {}
local vs2010 = p.vstudio.vs2010
local vstudio = p.vstudio
local sln2005 = p.vstudio.sln2005
local project = p.project
local config = p.config
--
-- Write out contents of the SolutionProperties section; currently unused.
--
function m.MonoDevelopProperties(wks)
_p('\tGlobalSection(MonoDevelopProperties) = preSolution')
if wks.startproject then
for prj in p.workspace.eachproject(wks) do
if prj.name == wks.startproject then
-- TODO: fix me!
-- local prjpath = vstudio.projectfile_ng(prj)
-- prjpath = path.translate(path.getrelative(slnpath, prjpath))
-- _p('\t\tStartupItem = %s', prjpath )
end
end
end
-- NOTE: multiline descriptions, or descriptions with tab's (/n, /t, etc) need to be escaped with @
-- Looks like: description = @descriptopn with\nnewline and\ttab's.
-- _p('\t\tdescription = %s', 'workspace description')
-- _p('\t\tversion = %s', '0.1')
_p('\tEndGlobalSection')
end
--
-- Patch some functions
--
p.override(vstudio, "projectPlatform", function(oldfn, cfg)
if _ACTION == "monodevelop" then
if cfg.platform then
return cfg.buildcfg .. " " .. cfg.platform
else
return cfg.buildcfg
end
end
return oldfn(cfg)
end)
p.override(vstudio, "archFromConfig", function(oldfn, cfg, win32)
if _ACTION == "monodevelop" then
return "Any CPU"
end
return oldfn(cfg, win32)
end)
p.override(sln2005, "solutionSections", function(oldfn, wks)
if _ACTION == "monodevelop" then
return {
"ConfigurationPlatforms",
-- "SolutionProperties", -- this doesn't seem to be used by MonoDevelop
"MonoDevelopProperties",
"NestedProjects",
}
end
return oldfn(prj)
end)
p.override(sln2005.elements, "sections", function(oldfn, wks)
local elements = oldfn(wks)
elements = table.join(elements, {
m.MonoDevelopProperties,
})
return elements
end)
p.override(vstudio, "projectfile", function(oldfn, prj)
if _ACTION == "monodevelop" then
if project.iscpp(prj) then
return p.filename(prj, ".cproj")
end
end
return oldfn(prj)
end)
p.override(vstudio, "tool", function(oldfn, prj)
if _ACTION == "monodevelop" then
if project.iscpp(prj) then
return "2857B73E-F847-4B02-9238-064979017E93"
end
end
return oldfn(prj)
end)
---
-- Identify the type of project being exported and hand it off
-- the right generator.
---
function m.generateProject(prj)
p.eol("\r\n")
p.indent(" ")
p.escaper(vs2010.esc)
if project.isdotnet(prj) then
p.generate(prj, ".csproj", vstudio.cs2005.generate)
p.generate(prj, ".csproj.user", vstudio.cs2005.generateUser)
elseif project.iscpp(prj) then
p.generate(prj, ".cproj", m.generate)
end
end
include("monodevelop_cproj.lua")
return m