From bc9f3b0f9c98266c08089219926139dd2784700e Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Fri, 1 Jun 2018 15:15:13 -0400 Subject: 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 Reviewed-by: Brian Osman Commit-Queue: Brian Osman --- gn/gn_meta_sln.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'gn/gn_meta_sln.py') 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 -- cgit v1.2.3