diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-01-19 20:25:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-23 06:02:28 +0000 |
commit | 115797f070888cbad93656dda8fa01ec6c98a3f5 (patch) | |
tree | c2ac30923b2c3adead603044f0f2782c7c7dd92c | |
parent | 0c004bca03b7756f3e5e09dc345072bb87a0f555 (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>
-rw-r--r-- | Makefile.in | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | bin/gbuild-to-ide | 68 |
2 files changed, 68 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in index 454755ec0c22..d01cbf452225 100644 --- a/Makefile.in +++ b/Makefile.in @@ -415,6 +415,7 @@ $(1)-ide-integration: gbuildtojson $(if $(filter MACOSX,$(OS_FOR_BUILD)),python3 endef $(foreach ide,\ + codelite \ debug \ kdevelop \ vs2013 \ 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(): |