-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvisualsvn.lua
37 lines (31 loc) · 929 Bytes
/
visualsvn.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
---
-- Battle.net package management extension
-- Copyright (c) 2014-2016 Blizzard Entertainment
---
require('vstudio')
local vstudio = premake.vstudio
local sln2005 = vstudio.sln2005
local svndirs = { }
premake.override(sln2005, "premakeExtensibilityGlobals", function(base, wks)
base(wks)
local dir = wks.basedir
local svnroot = svndirs[ wks.basedir ]
-- cache lookups based on working dir, so we dont output 'SVN Root ...' for each
-- workspace we generate
if not svnroot then
while not svnroot and (dir ~= '.') and (dir ~= '/') do
if (os.isdir(path.join(dir, '.svn'))) then
svnroot = dir
end
dir = path.getdirectory(dir)
end
svndirs[ wks.basedir ] = svnroot
if svnroot then
printf("SVN Root found: %s", svnroot)
end
end
if svnroot then
local path = premake.workspace.getrelative(wks, svnroot);
premake.w('VisualSVNWorkingCopyRoot = %s', path)
end
end)