From 9f440258b6bdf9b168992f7058f448dac588760c Mon Sep 17 00:00:00 2001 From: Federico Bassini Date: Mon, 30 Jan 2017 22:29:52 +0100 Subject: gbuild-to-ide: testVS2013Ide add a function that create .filters file this patch writes the .filters file, it creates 2 filters: -headers: place, for each module, the header files contained in gbuilparser.modules[][headers] -sources: place, for each module, the cxx files contained in gbuildparser.modules[][]['CXXOBJECTS'] Change-Id: Iba98d788b72992624fb8aa09315a5647e275ffcc Reviewed-on: https://gerrit.libreoffice.org/33721 Reviewed-by: jan iversen Tested-by: jan iversen --- bin/gbuild-to-ide | 79 ++++++++++++++++++++++++------------------------------- 1 file changed, 34 insertions(+), 45 deletions(-) (limited to 'bin/gbuild-to-ide') diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide index 9a8ce8a38c2f..3bf063dcaf2b 100755 --- a/bin/gbuild-to-ide +++ b/bin/gbuild-to-ide @@ -150,17 +150,18 @@ class GbuildParser: def find_all_headers(self): - cmdResult1=subprocess.Popen(('git', 'ls-files'), 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,stderr=subprocess.PIPE) + cmdResult=subprocess.check_output(['git', 'ls-files','--','*.h','*.hxx', '*.hpp'], cwd=self.srcdir, stderr=subprocess.PIPE,) + allfiles={} - for file in cmdResult2.splitlines(): + for file in cmdResult.splitlines(): strfile=file.decode() modulename=strfile.split('/')[0] if not modulename in allfiles: allfiles[modulename]=[] modulename_len=len(modulename) allfiles[modulename].append(strfile[modulename_len + 1:]) + self._allheaders = allfiles def headers_of(self,modulename): @@ -182,7 +183,7 @@ class IdeIntegrationGenerator: -class testWinIde(IdeIntegrationGenerator): +class testVS2013Ide(IdeIntegrationGenerator): def __init__(self, gbuildparser, ide): IdeIntegrationGenerator.__init__(self, gbuildparser, ide) @@ -226,9 +227,12 @@ class testWinIde(IdeIntegrationGenerator): module_directory = os.path.join(self.solution_directory, module) if module != 'include': # FIXME for target in self.gbuildparser.modules[module]['targets']: + project_path = os.path.join(module_directory, '%s.vcxproj' % target['target_name']) + project_guid = self.write_project(project_path, target) p = VisualStudioIntegrationGenerator.Project(project_guid, target, project_path) + self.write_filters(project_path + '.filters',target,self.gbuildparser.modules[module]['headers']) projects.append(p) self.write_solution(os.path.join(module_directory, '%s.sln' % module), projects) all_projects += projects @@ -379,22 +383,8 @@ class testWinIde(IdeIntegrationGenerator): ET.SubElement(proj_node, '{%s}Import' % ns, Project='$(VCTargetsPath)\Microsoft.Cpp.targets') ET.SubElement(proj_node, '{%s}ImportGroup' % ns, Label='ExtensionTargets') self.write_pretty_xml(proj_node, project_path) - self.write_filters(project_path + '.filters', - os.path.join(self.gbuildparser.srcdir, os.path.basename(target['location'])), - [cxx_node.get('Include') for cxx_node in cxxobjects_node.findall('{%s}ClCompile' % ns)], - [include_node.get('Include') for include_node in - includes_node.findall('{%s}ClInclude' % ns)]) - return project_guid - - def get_filter(self, module_dir, proj_file): - return '\\'.join(os.path.relpath(proj_file, module_dir).split('/')[:-1]) - def get_subfilters(self, proj_filter): - parts = proj_filter.split('\\') - subfilters = set([proj_filter]) - for i in range(1, len(parts)): - subfilters.add('\\'.join(parts[:i])) - return subfilters + return project_guid def write_pretty_xml(self, node, file_path): xml_str = ET.tostring(node, encoding='unicode') @@ -402,36 +392,35 @@ class testWinIde(IdeIntegrationGenerator): with open(file_path, 'w') as f: f.write(pretty_str.decode()) - def add_nodes(self, files_node, module_dir, tag, project_files): - ns = 'http://schemas.microsoft.com/developer/msbuild/2003' - filters = set() - for project_file in project_files: - file_node = ET.SubElement(files_node, tag, Include=project_file) - if os.path.commonprefix([module_dir, project_file]) == module_dir: - project_filter = self.get_filter(module_dir, project_file) - filter_node = ET.SubElement(file_node, '{%s}Filter' % ns) - filter_node.text = project_filter - filters |= self.get_subfilters(project_filter) - return filters - - def write_filters(self, filters_path, module_dir, compile_files, include_files): + def write_filters(self,filters_path,target,headers): ns = 'http://schemas.microsoft.com/developer/msbuild/2003' ET.register_namespace('', ns) proj_node = ET.Element('{%s}Project' % ns, ToolsVersion='4.0') - filters = set() - compiles_node = ET.SubElement(proj_node, '{%s}ItemGroup' % ns) - filters |= self.add_nodes(compiles_node, module_dir, '{%s}ClCompile' % ns, compile_files) - include_node = ET.SubElement(proj_node, '{%s}ItemGroup' % ns) - filters |= self.add_nodes(include_node, module_dir, '{%s}ClInclude' % ns, include_files) - - filters_node = ET.SubElement(proj_node, '{%s}ItemGroup' % ns) - for proj_filter in filters: - filter_node = ET.SubElement(filters_node, '{%s}Filter' % ns, Include=proj_filter) - filter_id_node = ET.SubElement(filter_node, '{%s}UniqueIdentifier' % ns) - filter_id_node.text = '{%s}' % str(uuid.uuid4()) - self.write_pretty_xml(proj_node, filters_path) + filters_node=ET.SubElement(proj_node,'{%s}ItemGroup' % ns) + filters={'sources' : 'c;cxx;cpp','headers':'h;hxx;hpp'} + for filter_key,filter_value in filters.items(): + filter_node = ET.SubElement(filters_node,'{%s}Filter' % ns, Include='%s' % filter_key) + filter_id_node = ET.SubElement(filter_node,'{%s}UniqueIdentifier' % ns) + filter_id_node.text='{%s}' % str(uuid.uuid4()) + filter_ext_node = ET.SubElement(filter_node,'{%s}Extensions' % ns) + filter_ext_node.text = '{%s}' % filter_value + sources_node=ET.SubElement(proj_node,'{%s}ItemGroup' % ns) + for cxxfile in target['CXXOBJECTS']: + cxx_file_name = cxxfile.split('/')[-1] + '.cxx' + clinclude_node=ET.SubElement(sources_node,'{%s}ClInclude' % ns, Include='%s' % cxx_file_name) + header_filter=ET.SubElement(clinclude_node,'{%s}Filter' % ns) + header_filter.text="sources" + + headers_node=ET.SubElement(proj_node,'{%s}ItemGroup' % ns) + for header in headers: + header_file_name=header.split('/')[-1] + + clinclude_node=ET.SubElement(headers_node,'{%s}ClInclude' % ns, Include='%s' % header_file_name) + header_filter=ET.SubElement(clinclude_node,'{%s}Filter' % ns) + header_filter.text="headers" + self.write_pretty_xml(proj_node, filters_path) class XcodeIntegrationGenerator(IdeIntegrationGenerator): def __init__(self, gbuildparser, ide): @@ -2044,7 +2033,7 @@ if __name__ == '__main__': 'vs2013': VisualStudioIntegrationGenerator, 'xcode': XcodeIntegrationGenerator, 'debug': DebugIntegrationGenerator, - 'testIde': testWinIde, + 'testIde': testVS2013Ide, # Old platforms 'eclipsecdt': EclipseCDTIntegrationGenerator, -- cgit LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-05loplugin:simplifyconstruct in accessibility..bridgesNoel Grandin
Change-Id: I08f6a64b50f03d1b08027a2ac9e51442255d64bc Reviewed-on: https://gerrit.libreoffice.org/59976 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-09Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from a* to configmgr Change-Id: I6ea1a7f992b1f835f5bac7a725e1135abee3f85a Reviewed-on: https://gerrit.libreoffice.org/57170 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-11loplugin:salcall fix functionsNoel Grandin
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-04Replace lists by vectors in animation parts (sd/animations)Julien Nabet
Change-Id: Ie5306041e5cde5617e460ae4d98861e8d26e389d Reviewed-on: https://gerrit.libreoffice.org/44297 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-06-15use more SAL_N_ELEMENTS part 3Noel Grandin
Change-Id: I82e366fefd2e31928b99840fe76649cc3521e623 Reviewed-on: https://gerrit.libreoffice.org/38789 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-16loplugin:comparisonwithconstant in avmediaNoel Grandin
Change-Id: Iba0a1969648e95f6e0f6a947f067c5b8e4eb3406 Reviewed-on: https://gerrit.libreoffice.org/37667 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-21gbuild: Remove MSVC 2013 legacy codeDavid Ostrovsky
Uwinapi is discontinued. Change-Id: I063b4d0d8fab2d60de168e960a63b8181158ac01 Reviewed-on: https://gerrit.libreoffice.org/23198 Reviewed-by: David Ostrovsky <david@ostrovsky.org> Tested-by: David Ostrovsky <david@ostrovsky.org>
2017-03-03Fix typosAndrea Gelmini
Change-Id: Iaefa094c82006346897f5563ac3ddcdc60ab68a3 Reviewed-on: https://gerrit.libreoffice.org/34809 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-15Drop :: prefix from std in [a-b]*/Tor Lillqvist
Change-Id: I0422aaf39bbce889c95ed9a81a0784cb03a1badd Reviewed-on: https://gerrit.libreoffice.org/34320 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2017-02-06Add missing #includesStephan Bergmann
...and remove some unncessary using directives/declarations, in preparation of removing now-unnecessary #includes from cppumaker-generated files, post e57ca02849c3d87142ff5ff9099a212e72b8139c "Remove dynamic exception specifications". Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-02-01makeAny->Any in accessibility..avmediaNoel Grandin
Change-Id: I70f2dfa66d7b66738a840e4a7b5c7fb1b8d7b39f Reviewed-on: https://gerrit.libreoffice.org/33756 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-26Remove dynamic exception specificationsStephan Bergmann
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-11-23loplugin:unnecessaryoverride (dtors) in animationsStephan Bergmann
Change-Id: I51b94f43e27da93afb3c44ed5f68e70e457fe8ea