summaryrefslogtreecommitdiffstats
path: root/bin/gbuild-to-ide
diff options
context:
space:
mode:
authorjan Iversen <jani@documentfoundation.org>2017-01-28 11:51:48 +0100
committerjan Iversen <jani@documentfoundation.org>2017-01-28 13:33:00 +0100
commitbcaba2ca3622a66d475bf41cf2fea3d828ece342 (patch)
tree999e7b828c3fba9d73096865a598ead5c9632dd5 /bin/gbuild-to-ide
parentcoverity#1399595 Uninitialized scalar field (diff)
downloadcore-bcaba2ca3622a66d475bf41cf2fea3d828ece342.tar.gz
core-bcaba2ca3622a66d475bf41cf2fea3d828ece342.zip
gbuild-to-ide source code is relative to module
Last central change, before rewrapping xcode. Change-Id: If9b3d668fa59fe32a7a89a17ea56a6852b260a2b
Diffstat (limited to 'bin/gbuild-to-ide')
-rwxr-xr-xbin/gbuild-to-ide20
1 files changed, 12 insertions, 8 deletions
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 47c7caedd9ae..3d9eccfe13b9 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -54,6 +54,8 @@ class GbuildParser:
def __split_objs(module,objsline, ext):
retObj = []
for obj in objsline.strip().split(' '):
+ if module in obj:
+ obj = obj[len(module)+1:]
if len(obj) > 0 and obj != 'CXXOBJECTS' and obj != '+=':
retObj.append(obj + ext)
return sorted(retObj)
@@ -137,6 +139,7 @@ class GbuildParser:
module = moduleDict[i]
src = []
for target in module['targets']:
+ target['module'] = i
for ext in jsonSrc:
src.extend(target[ext])
module['sources'] = sorted(src)
@@ -356,7 +359,7 @@ class testWinIde(IdeIntegrationGenerator):
cxxobjects_node = ET.SubElement(proj_node, '{%s}ItemGroup' % ns)
for cxxobject in target['CXXOBJECTS']:
- cxxabspath = os.path.join(self.gbuildparser.srcdir, cxxobject)
+ cxxabspath = os.path.join(self.gbuildparser.srcdir + '/' + target['module'], cxxobject)
cxxfile = cxxabspath
if os.path.isfile(cxxabspath):
ET.SubElement(cxxobjects_node, '{%s}ClCompile' % ns, Include=cxxabspath)
@@ -365,7 +368,7 @@ class testWinIde(IdeIntegrationGenerator):
includes_node = ET.SubElement(proj_node, '{%s}ItemGroup' % ns)
for cxxobject in target['CXXOBJECTS']:
- include_abs_path = os.path.join(self.gbuildparser.srcdir, cxxobject)
+ include_abs_path = os.path.join(self.gbuildparser.srcdir + '/' + target['module'], cxxobject)
hxxfile = include_abs_path + '.hxx'
if os.path.isfile(hxxfile):
ET.SubElement(includes_node, '{%s}ClInclude' % ns, Include=hxxfile)
@@ -471,7 +474,7 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
mainGroup['children'].append(moduleId)
for target in self.gbuildparser.modules[module]['targets']:
- pbxproj['objects'].update(self.generate_project(target))
+ pbxproj['objects'].update(self.generate_project(target, module))
xcodeprojdir = './osx/libreoffice.xcodeproj'
try:
@@ -611,7 +614,7 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
'path': i,
'sourceTree': '<group>'}
- def generate_project(self, target):
+ def generate_project(self, target, module):
self.targetId = self.generate_id()
self.configurationListId = self.generate_id()
self.configurationDebugId = self.generate_id()
@@ -633,10 +636,10 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
for i in self.sourceList.keys():
ref = self.sourceList[i]
path = self.sourceRefList[ref]['path']
- name = '/'.join(path.split('/')[2:])
+ name = '/'.join(path.split('/')[1:])
objects[ref] = {'isa': 'PBXFileReference',
'lastKnownFileType': self.sourceRefList[ref]['lastKnownFileType'],
- 'path': path,
+ 'path': module + '/' + path,
'name': name,
'fileEncoding': 4,
'sourceTree': '<group>'}
@@ -817,7 +820,7 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
cxxobjects_node = ET.SubElement(proj_node, '{%s}ItemGroup' % ns)
for cxxobject in target['CXXOBJECTS']:
- cxxabspath = os.path.join(self.gbuildparser.srcdir, cxxobject)
+ cxxabspath = os.path.join(self.gbuildparser.srcdir + '/' + target['module'], cxxobject)
cxxfile = cxxabspath
if os.path.isfile(cxxfile):
ET.SubElement(cxxobjects_node, '{%s}ClCompile' % ns, Include='../../' + cxxobject)
@@ -826,7 +829,7 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
includes_node = ET.SubElement(proj_node, '{%s}ItemGroup' % ns)
for cxxobject in target['CXXOBJECTS']:
- include_abs_path = os.path.join(self.gbuildparser.srcdir, cxxobject)
+ include_abs_path = os.path.join(self.gbuildparser.srcdir + '/' + target['module'], cxxobject)
hxxfile = include_abs_path + '.hxx'
if os.path.isfile(hxxfile):
ET.SubElement(includes_node, '{%s}ClInclude' % ns, Include='../../' + cxxobject + '.hxx')
@@ -1258,6 +1261,7 @@ VersionControl=kdevgit
for target in self.gbuildparser.modules[m]['targets']:
for cxx in target['CXXOBJECTS']:
path = '/'.join(cxx.split('/')[:-1])
+ path = target['module'] + '/' + path
if path not in self.target_path:
self.target_path[path] = []
self.target_path[path].append(target)