gbuildparser in gbuild-to-ide - added headers of the include module
this is the version of gbuild-to-ide that implement a capture 1 of the project "keeping contributors" it adds all the headers files (.hxx,.h,.hpp) content in the folder include in moduleDict['include']['headers'] there is an error in the VisualStudioIntegrationGeneration.emit() because there is a for that work only with the modules[<module_name>]['targets'] whatever i'll do a comment in the code(i added a if statement!)with the error description that generate this error to not forget! Change-Id: I7cd6a15482d99406573dbd9bd095987772377cff Reviewed-on: https://gerrit.libreoffice.org/33162 Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
This commit is contained in:
committed by
jan iversen
parent
79a4401ccf
commit
de409aeed2
@@ -20,6 +20,7 @@ import xml.etree.ElementTree as ET
|
|||||||
import xml.dom.minidom as minidom
|
import xml.dom.minidom as minidom
|
||||||
import traceback
|
import traceback
|
||||||
import collections
|
import collections
|
||||||
|
import subprocess
|
||||||
|
|
||||||
class GbuildLinkTarget:
|
class GbuildLinkTarget:
|
||||||
def __init__(self, name, location, include, include_sys, defs, cxxobjects, cxxflags, linked_libs,
|
def __init__(self, name, location, include, include_sys, defs, cxxobjects, cxxflags, linked_libs,
|
||||||
@@ -141,11 +142,22 @@ class GbuildParser:
|
|||||||
moduleDict[module] = {'targets': set()}
|
moduleDict[module] = {'targets': set()}
|
||||||
moduleDict[module]['targets'] |= set([newObj])
|
moduleDict[module]['targets'] |= set([newObj])
|
||||||
|
|
||||||
|
moduleDict['include']={'headers':self.find_all_headers_include_git(), 'targets': {}}
|
||||||
for module in sorted(moduleDict):
|
for module in sorted(moduleDict):
|
||||||
self.modules[module] = moduleDict[module]
|
self.modules[module] = moduleDict[module]
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
||||||
|
def find_all_headers_include_git(self):
|
||||||
|
cmdResult1=subprocess.Popen(('git', 'ls-files', 'include'), cwd=self.srcdir,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
|
||||||
|
cmdResult2=subprocess.check_output(('grep', '-i', '-E', '".*\.hxx$|.*\.h$|.*\.hpp$"'),cwd=self.srcdir,stdin=cmdResult1.stdout)
|
||||||
|
|
||||||
|
#decode from byte to string
|
||||||
|
allfiles=[]
|
||||||
|
for file in cmdResult2.splitlines():
|
||||||
|
allfiles.append(file.decode()[8:])
|
||||||
|
return allfiles
|
||||||
|
|
||||||
class IdeIntegrationGenerator:
|
class IdeIntegrationGenerator:
|
||||||
|
|
||||||
def __init__(self, gbuildparser, ide):
|
def __init__(self, gbuildparser, ide):
|
||||||
@@ -161,6 +173,8 @@ class EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
|
|||||||
|
|
||||||
def create_include_paths(self):
|
def create_include_paths(self):
|
||||||
for module in self.gbuildparser.modules:
|
for module in self.gbuildparser.modules:
|
||||||
|
if module == 'include':
|
||||||
|
continue
|
||||||
modulepath = os.path.join(self.gbuildparser.builddir, module)
|
modulepath = os.path.join(self.gbuildparser.builddir, module)
|
||||||
includedirfile = open(os.path.join(modulepath, '.eclipsesettingfile'), 'w')
|
includedirfile = open(os.path.join(modulepath, '.eclipsesettingfile'), 'w')
|
||||||
modulelibs = []
|
modulelibs = []
|
||||||
@@ -177,6 +191,8 @@ class EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
|
|||||||
|
|
||||||
def create_macros(self):
|
def create_macros(self):
|
||||||
for module in self.gbuildparser.modules:
|
for module in self.gbuildparser.modules:
|
||||||
|
if module == 'include':
|
||||||
|
continue
|
||||||
modulepath = os.path.join(self.gbuildparser.builddir, module)
|
modulepath = os.path.join(self.gbuildparser.builddir, module)
|
||||||
macrofile = open(os.path.join(modulepath, '.macros'), 'w')
|
macrofile = open(os.path.join(modulepath, '.macros'), 'w')
|
||||||
modulelibs = []
|
modulelibs = []
|
||||||
@@ -233,6 +249,8 @@ class EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
for module in self.gbuildparser.modules:
|
for module in self.gbuildparser.modules:
|
||||||
|
if module == 'include':
|
||||||
|
continue
|
||||||
tempxml = []
|
tempxml = []
|
||||||
modulepath = os.path.join(self.gbuildparser.builddir, module)
|
modulepath = os.path.join(self.gbuildparser.builddir, module)
|
||||||
|
|
||||||
@@ -832,13 +850,14 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
|
|||||||
for module in self.gbuildparser.modules:
|
for module in self.gbuildparser.modules:
|
||||||
projects = []
|
projects = []
|
||||||
module_directory = os.path.join(self.solution_directory, module)
|
module_directory = os.path.join(self.solution_directory, module)
|
||||||
for target in self.gbuildparser.modules[module]['targets']:
|
if module != 'include': #FIXME
|
||||||
project_path = os.path.join(module_directory, '%s.vcxproj' % target.target_name)
|
for target in self.gbuildparser.modules[module]['targets']:
|
||||||
project_guid = self.write_project(project_path, target)
|
project_path = os.path.join(module_directory, '%s.vcxproj' % target.target_name)
|
||||||
p = VisualStudioIntegrationGenerator.Project(project_guid, target, project_path)
|
project_guid = self.write_project(project_path, target)
|
||||||
projects.append(p)
|
p = VisualStudioIntegrationGenerator.Project(project_guid, target, project_path)
|
||||||
self.write_solution(os.path.join(module_directory, '%s.sln' % module), projects)
|
projects.append(p)
|
||||||
all_projects += projects
|
self.write_solution(os.path.join(module_directory, '%s.sln' % module), projects)
|
||||||
|
all_projects += projects
|
||||||
|
|
||||||
self.write_solution(os.path.join(self.solution_directory, 'LibreOffice.sln'), all_projects)
|
self.write_solution(os.path.join(self.solution_directory, 'LibreOffice.sln'), all_projects)
|
||||||
|
|
||||||
@@ -1683,6 +1702,9 @@ def get_options():
|
|||||||
help='the IDE to generate project files for')
|
help='the IDE to generate project files for')
|
||||||
parser.add_argument('--make', dest='makecmd', required=True,
|
parser.add_argument('--make', dest='makecmd', required=True,
|
||||||
help='the command to execute make')
|
help='the command to execute make')
|
||||||
|
#add to debug a new functions in the project keeping contributors
|
||||||
|
parser.add_argument('--debug',dest='debug',required=False,
|
||||||
|
help='debug the new functions')
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
@@ -1692,6 +1714,7 @@ if __name__ == '__main__':
|
|||||||
if args.makecmd == 'make':
|
if args.makecmd == 'make':
|
||||||
args.makecmd = '/usr/bin/make'
|
args.makecmd = '/usr/bin/make'
|
||||||
|
|
||||||
|
|
||||||
paths = {}
|
paths = {}
|
||||||
generators = {
|
generators = {
|
||||||
# Supported platforms
|
# Supported platforms
|
||||||
|
Reference in New Issue
Block a user