aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/gn_meta_sln.py
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-06-01 15:15:13 -0400
committerGravatar Brian Osman <brianosman@google.com>2018-06-01 19:22:08 +0000
commitbc9f3b0f9c98266c08089219926139dd2784700e (patch)
treef5c0829e10808b5cbea4c3ade2afcc3d42a14eb9 /gn/gn_meta_sln.py
parentccb87523a25a9536d7ed8c7f424dd731732fa3b0 (diff)
Decorate project names with their relative path in the meta SLN
This doesn't show up in the solution explorer (so there are two entries for "samples"), but they are both present, and all files are there. Decorating the names in the explorer is going to be much harder, as we have to change the actual filename of the generated vcxproj, as well as the reference to those files in the sln. For now, this works well enough. Change-Id: I5b864268a4c56001edbf2c43dbe5563445d5435f Reviewed-on: https://skia-review.googlesource.com/131580 Auto-Submit: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'gn/gn_meta_sln.py')
-rw-r--r--gn/gn_meta_sln.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/gn/gn_meta_sln.py b/gn/gn_meta_sln.py
index 2cb4ae59ae..9f30cb02d2 100644
--- a/gn/gn_meta_sln.py
+++ b/gn/gn_meta_sln.py
@@ -52,6 +52,7 @@ cppTypeGuid = "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942"
allProjects = {}
projectPattern = (r'Project\("\{' + cppTypeGuid +
r'\}"\) = "([^"]*)", "([^"]*)", "\{([^\}]*)\}"')
+projectNamePattern = (r'obj/(.*)\.vcxproj')
for config in configs:
if config[1]:
@@ -59,11 +60,14 @@ for config in configs:
for slnLine in slnLines:
matchObj = re.match(projectPattern, slnLine)
if matchObj:
- projName = matchObj.group(1)
- if not allProjects.has_key(projName):
- allProjects[projName] = []
- allProjects[projName].append((config[0], matchObj.group(2),
- matchObj.group(3)))
+ projPath = matchObj.group(2)
+ nameObj = re.match(projectNamePattern, projPath)
+ if nameObj:
+ projName = nameObj.group(1).replace('/', '.')
+ if not allProjects.has_key(projName):
+ allProjects[projName] = []
+ allProjects[projName].append((config[0], projPath,
+ matchObj.group(3)))
# We need something to work with. Typically, this will fail if no GN folders
# have IDE files