summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2017-01-19 20:25:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-23 06:02:28 +0000
commit115797f070888cbad93656dda8fa01ec6c98a3f5 (patch)
treec2ac30923b2c3adead603044f0f2782c7c7dd92c /bin
parent0c004bca03b7756f3e5e09dc345072bb87a0f555 (diff)
beginning of support for CodeLite in gbuild-to-ide
Change-Id: I5640ad193f2766400554012383d6c910f2160378 Reviewed-on: https://gerrit.libreoffice.org/33396 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'bin')
-rw-r--r--[-rwxr-xr-x]bin/gbuild-to-ide68
1 files changed, 67 insertions, 1 deletions
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 22a08cdd93f7..d4a32b2b5490 100755..100644
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1,4 +1,4 @@
-#! /usr/bin/env python3
+#! /usr/local/bin/python3
# -*- Mode: python; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
@@ -1624,6 +1624,71 @@ DEFINES += %(defines)s
SUBDIRS = %(subdirs)s
"""
+class CodeliteIntegrationGenerator(IdeIntegrationGenerator):
+
+ def __init__(self, gbuildparser, ide):
+ IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
+ self.target_by_location = {}
+ for target in set(self.gbuildparser.libs) | set(self.gbuildparser.exes):
+ if target.location not in self.target_by_location:
+ self.target_by_location[target.location] = set()
+ self.target_by_location[target.location] |= set([target])
+
+
+ def emit(self):
+ # create main workspace file
+ codelite_workspace_file = 'lo.workspace1'
+ with open(codelite_workspace_file, 'w+') as f:
+ f.write(self.generate_workspace_content())
+
+ def generate_workspace_content(self):
+ projects1 = ''
+ projects2 = ''
+ projects3 = ''
+ for module in self.gbuildparser.modulenamelist:
+ projects1 += CodeliteIntegrationGenerator.codelite_projects1_template.format(
+ name = module
+ )
+ projects2 += CodeliteIntegrationGenerator.codelite_projects2_template.format(
+ name = module,
+ config = 'Debug'
+ )
+ projects3 += CodeliteIntegrationGenerator.codelite_projects2_template.format(
+ name = module,
+ config = 'Release'
+ )
+ xml = CodeliteIntegrationGenerator.codelite_workspace_template.format(
+ projects1,
+ projects2,
+ projects3
+ )
+ return xml
+
+
+ codelite_workspace_template = """<?xml version="1.0" encoding="UTF-8"?>
+<CodeLite_Workspace Name="lo" Database="" SWTLW="Yes">
+ <WorkspaceParserMacros/>
+ <WorkspaceParserPaths>
+ <Include Path="${{WorkspacePath}}/include"/>
+ </WorkspaceParserPaths>
+ {0}
+ <BuildMatrix>
+ <WorkspaceConfiguration Name="Debug" Selected="yes">
+ <Environment/>
+ {1}
+ </WorkspaceConfiguration>
+ <WorkspaceConfiguration Name="Release" Selected="yes">
+ <Environment/>
+ {2}
+ </WorkspaceConfiguration>
+ </BuildMatrix>
+</CodeLite_Workspace>
+"""
+ codelite_projects1_template = """<Project Name="{name}" Path="{name}/{name}.project" Active="No"/>
+"""
+
+ codelite_projects2_template = """<Project Name="{name}" ConfigName="{config}"/>
+"""
def get_options():
parser = argparse.ArgumentParser(
@@ -1659,6 +1724,7 @@ if __name__ == '__main__':
'vs2015': VisualStudioIntegrationGenerator,
'vim': VimIntegrationGenerator,
'qtcreator': QtCreatorIntegrationGenerator,
+ 'codelite' : CodeliteIntegrationGenerator,
}
if args.ide not in generators.keys():