[Libreoffice-commits] core.git: bin/gbuild-to-ide solenv/vs

2023-11-02 Thread Mike Kaganski (via logerrit)
 bin/gbuild-to-ide|3 +++
 solenv/vs/Microsoft.MIEngine.Options.xml |9 +
 2 files changed, 12 insertions(+)

New commits:
commit 54b5040e0842c85138bb9d800224016054f02778
Author: Mike Kaganski 
AuthorDate: Thu Nov 2 12:16:29 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Nov 2 13:43:51 2023 +0100

VS IDE integration: enable Python pretty printers when debugging a WSL build

See 
https://learn.microsoft.com/en-us/cpp/linux/deploy-run-and-debug-your-linux-project#debug-with-attach-to-process

Change-Id: I16d50ebe5f087518de1953ea1f9aad4180714cc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158789
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 928cde4ae9fc..ce89a979a1d0 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -968,6 +968,9 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 all_projects += projects
 
 self.write_solution(os.path.join(self.solution_directory, 
'LibreOffice.sln'), all_projects)
+# this enables Python GDB pretty printers when debugging a WSL Linux 
build from VS
+MIEngine_options_path = os.path.join(gbuildparser.srcdir, 
'solenv/vs/Microsoft.MIEngine.Options.xml')
+shutil.copy(MIEngine_options_path, self.solution_directory)
 
 @staticmethod
 def gen_guid(category, name):
diff --git a/solenv/vs/Microsoft.MIEngine.Options.xml 
b/solenv/vs/Microsoft.MIEngine.Options.xml
new file mode 100644
index ..be9e9ee918f2
--- /dev/null
+++ b/solenv/vs/Microsoft.MIEngine.Options.xml
@@ -0,0 +1,9 @@
+
+  
+
+  
+-enable-pretty-printing
+  
+
+  
+
\ No newline at end of file


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2023-11-01 Thread Mike Kaganski (via logerrit)
 bin/gbuild-to-ide |   33 -
 1 file changed, 20 insertions(+), 13 deletions(-)

New commits:
commit ee058521541da49e6d1d8a0e84cc42e9e801b518
Author: Mike Kaganski 
AuthorDate: Wed Nov 1 11:58:08 2023 +0300
Commit: Mike Kaganski 
CommitDate: Wed Nov 1 11:48:04 2023 +0100

VS IDE integration: Use LocalDebuggerCommand for startup executable

Before that, NMakeOutput was abused for that. Now it will point to
the correct link target.

Change-Id: I9c3fd57948cc24a99f54a1c23ca5e0351d25a0dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158748
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index fb1b84bcc52e..928cde4ae9fc 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -26,9 +26,9 @@ import collections
 import urllib.parse
 
 class GbuildLinkTarget:
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
-(self.name, self.location, self.include, self.include_sys, self.defs, 
self.cxxobjects, self.cxxflags, self.cobjects, self.objcxxobjects, self.cflags, 
self.linked_libs) = (
-name, location, include, include_sys, defs, cxxobjects, cxxflags, 
cobjects, objcxxobjects, cflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, link_target):
+(self.name, self.location, self.include, self.include_sys, self.defs, 
self.cxxobjects, self.cxxflags, self.cobjects, self.objcxxobjects, self.cflags, 
self.linked_libs, self.link_target) = (
+name, location, include, include_sys, defs, cxxobjects, cxxflags, 
cobjects, objcxxobjects, cflags, linked_libs, link_target)
 
 def short_name(self):
 return self.name
@@ -43,8 +43,8 @@ class GbuildLinkTarget:
 
 
 class GbuildLib(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, link_target):
+GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs, 
link_target)
 
 def short_name(self):
 """Return the short name of target based on the Library_* makefile 
name"""
@@ -57,8 +57,8 @@ class GbuildLib(GbuildLinkTarget):
 return self.name
 
 class GbuildTest(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, link_target):
+GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs, 
link_target)
 
 def short_name(self):
 """Return the short name of target based n the CppunitTest_* makefile 
names"""
@@ -68,8 +68,8 @@ class GbuildTest(GbuildLinkTarget):
 return 'CppunitTest_%s' % self.name
 
 class GbuildExe(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, link_target):
+GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs, 
link_target)
 
 def short_name(self):
 """Return the short name of target based on the Executable_* makefile 
name"""
@@ -148,7 +148,8 @@ class GbuildParser:
 GbuildParser.__split_objs(json['COBJECTS']),
 GbuildParser.__split_objs(json['OBJCXXOBJECTS']),
 GbuildParser.__split_flags(json['CFLAGS'], json['CFLAGSAPPEND']),
-json['LINKED_LIBS'].strip().split(' '))
+json['LINKED_LIBS'].strip().split(' '),
+json['LINKTARGET'].strip())
 
 @staticmethod
 def __test_from_json(json):
@@ -172,7 +173,8 @@ class GbuildParser:
 GbuildParser.__split_objs(json['COBJECTS']),
 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2023-10-31 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |   51 ---
 1 file changed, 40 insertions(+), 11 deletions(-)

New commits:
commit bd159d4f4f827821782926cc13f8b5c4c8a63a3d
Author: Michael Weghorn 
AuthorDate: Mon Oct 30 15:32:30 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Oct 31 07:05:51 2023 +0100

qtcreator: Add Obj-C++ files to project

Extend gbuild-to-ide to also take into account
Objective-C++ files that are set with the
`OBJCXXOBJECTS` key in the json files.

Extend the Qt Creator IDE integration target
(`make qtcreator-ide-integration`) to make use
of that information to find the corresponding
headers as well, and set sources and headers
in the `OBJECTIVE_SOURCES` [1] and
`OBJECTIVE_HEADERS` [2] qmake veriables.

This way, those files are part of the project
and the Clang Code Model works as expected,
which makes features like code completion and
showing issues work correctly for such files
(like e.g. vcl/osx/a11ywrapper.mm) as well.

[1] https://doc.qt.io/qt-6/qmake-variable-reference.html#objective-sources
[2] https://doc.qt.io/qt-6/qmake-variable-reference.html#objective-headers

Change-Id: I2c1cf5bdfdc64300ec3eb77e42de1ae2cd4223f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158665
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 82ff9e6fc631..fb1b84bcc52e 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -26,9 +26,9 @@ import collections
 import urllib.parse
 
 class GbuildLinkTarget:
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, cflags, linked_libs):
-(self.name, self.location, self.include, self.include_sys, self.defs, 
self.cxxobjects, self.cxxflags, self.cobjects, self.cflags, self.linked_libs) = 
(
-name, location, include, include_sys, defs, cxxobjects, cxxflags, 
cobjects, cflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
+(self.name, self.location, self.include, self.include_sys, self.defs, 
self.cxxobjects, self.cxxflags, self.cobjects, self.objcxxobjects, self.cflags, 
self.linked_libs) = (
+name, location, include, include_sys, defs, cxxobjects, cxxflags, 
cobjects, objcxxobjects, cflags, linked_libs)
 
 def short_name(self):
 return self.name
@@ -43,8 +43,8 @@ class GbuildLinkTarget:
 
 
 class GbuildLib(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, cflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, cflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
+GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs)
 
 def short_name(self):
 """Return the short name of target based on the Library_* makefile 
name"""
@@ -57,8 +57,8 @@ class GbuildLib(GbuildLinkTarget):
 return self.name
 
 class GbuildTest(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, cflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, cflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
+GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs)
 
 def short_name(self):
 """Return the short name of target based n the CppunitTest_* makefile 
names"""
@@ -68,8 +68,8 @@ class GbuildTest(GbuildLinkTarget):
 return 'CppunitTest_%s' % self.name
 
 class GbuildExe(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, cflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, cflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
+GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs)
 
 def short_name(self):
 """Return the short name of target based on the Executable_* makefile 
name"""
@@ -111,7 +111,7 @@ class GbuildParser:
 
 @staticmethod
 def __split_objs(objsline):
-return [obj 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2023-10-16 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |   21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

New commits:
commit f8be1b73847514bb8e2054dc6d8a62e00682ab78
Author: Michael Weghorn 
AuthorDate: Mon Oct 16 14:39:42 2023 +0200
Commit: Michael Weghorn 
CommitDate: Mon Oct 16 18:29:23 2023 +0200

qtcreator: Specify C++ std version using CONFIG qmake var

Extract the C++ standard version to use that is specified
by a `-std=` or `-std:` compiler flag,
and set that via "CONFIG += " in the .pro files
used by Qt Creator.

This makes the Clang Code Model use the correct mode
and no longer complain about `char8_t` after the
switch to C++20 in my Windows development setup
in Qt Creator:

> accessibletabbarpagelist.hxx:22:10: In included file: use of undeclared 
identifier 'char8_t'
> stringutils.hxx:252:31: error occurred here

The previous way of specifying this via
`QMAKE_CXXFLAGS` as introduced in

commit 92c03d9bf644b0f10de52ce0da09f97056e46247
Author: Michael Weghorn 
Date:   Fri Jun 7 21:44:03 2019 +0200

qtcreator: Take over '-std=...' from CXXFLAGS

appears to not (no longer?) work at least with Qt Creator 11.0.3
on Windows.

On the contrary however, setting only `CONFIG` and
not `QMAKE_CXXFLAGS` causes the exact same problem
in my Linux setup.

Therefore, set both qmake variables.

Note that there is a specific set of accepted values
for the the `CONFIG` variable in .pro files [1],
but at least "c++20" and "c++latest" are accepted
and have the expected meaning, so that should be
fine for now.

[1] https://doc.qt.io/qt-6/qmake-variable-reference.html#config

Change-Id: Idc75b74300c7bdd0f6193fcfc1758b536728b887
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158053
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index b56cff8585ea..f428f451e990 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1718,11 +1718,11 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 if path:
 headers_list.append(lopath(path))
 
-cxxflags_list = []
+cxxstdversionflag = ''
 for cxxflag in lib.cxxflags:
 # extract flag for C++ standard version
 if cxxflag.startswith('-std'):
-cxxflags_list.append(cxxflag)
+cxxstdversionflag = cxxflag
 
 # List all include paths
 for hdir in (lib.include + lib.include_sys):
@@ -1749,14 +1749,14 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 if lib_folder in self.data_libs:
 self.data_libs[lib_folder]['sources'] |= set(sources_list)
 self.data_libs[lib_folder]['headers'] |= set(headers_list)
-self.data_libs[lib_folder]['cxxflags'] |= set(cxxflags_list)
+self.data_libs[lib_folder]['cxxstdversionflag'] = 
cxxstdversionflag
 self.data_libs[lib_folder]['includepath'] |= 
set(includepath_list)
 self.data_libs[lib_folder]['defines'] |= set(defines_list)
 else:
 self.data_libs[lib_folder] = {
 'sources': set(sources_list),
 'headers': set(headers_list),
-'cxxflags': set(cxxflags_list),
+'cxxstdversionflag': cxxstdversionflag,
 'includepath': set(includepath_list),
 'defines': set(defines_list),
 'loc': lib.location,
@@ -1779,7 +1779,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 for lib_folder in subdirs_list:
 sources_list = sorted(self.data_libs[lib_folder]['sources'])
 headers_list = sorted(self.data_libs[lib_folder]['headers'])
-cxxflags_list = sorted(self.data_libs[lib_folder]['cxxflags'])
+cxxstdversionflag = self.data_libs[lib_folder]['cxxstdversionflag']
 includepath_list = 
sorted(self.data_libs[lib_folder]['includepath'])
 defines_list = sorted(self.data_libs[lib_folder]['defines'])
 lib_loc = self.data_libs[lib_folder]['loc']
@@ -1787,16 +1787,18 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 
 sources = " \\\n".join(sources_list)
 headers = " \\\n".join(headers_list)
-cxxflags = " \\\n".join(cxxflags_list)
 includepath = " \\\n".join(includepath_list)
 defines = " \\\n".join(defines_list)
+# strip '-std=' or '-std:' prefix
+assert(isinstance(cxxstdversionflag, str) and 
cxxstdversionflag.startswith('-std'))
+cxxstdversion = cxxstdversionflag[5:]
 
 # create .pro file
 subdirs_meta_pro.append(lib_name)
  

[Libreoffice-commits] core.git: bin/gbuild-to-ide .vscode/vs-code-template.code-workspace.in

2022-12-05 Thread Christian Lohmaier (via logerrit)
 .vscode/vs-code-template.code-workspace.in |3 +--
 bin/gbuild-to-ide  |2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit df092b591a7d107263f3fad817404f92b3cd7c03
Author: Christian Lohmaier 
AuthorDate: Wed Nov 30 11:30:23 2022 +0100
Commit: Christian Lohmaier 
CommitDate: Mon Dec 5 13:54:00 2022 +

create compile_commands.json in builddir

assuming that nothing breaks for existing users of the
compile_commands.json file, since they assume BUILDDIR=SRCDIR, so
nothing will change in those cases.

For building in a different directory than the source, the
compile_commands.json file is the only thing that regularly clobbers my
otherwise pristine SRCROOT

Change-Id: I344afa0bc7bb3eaa1eb888cd3558d3602090af5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143571
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/.vscode/vs-code-template.code-workspace.in 
b/.vscode/vs-code-template.code-workspace.in
index f6078155e8dc..87a6a27ac865 100644
--- a/.vscode/vs-code-template.code-workspace.in
+++ b/.vscode/vs-code-template.code-workspace.in
@@ -35,8 +35,7 @@
"files.associations": {
"*.patch.[0-9]": "diff"
},
-   // FIXME: arguably the generator should place it in the 
builddir, not srcdir
-   "C_Cpp.default.compileCommands": 
"${workspaceFolder:srcdir}/compile_commands.json",
+   "C_Cpp.default.compileCommands": 
"@BUILDDIR@/compile_commands.json",
// only used if the file doesn't match anything in the 
compile_commands.json - aka externals
// libxml includes just added as example/for reference
"C_Cpp.default.includePath": [
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 26f0c87f6855..b56cff8585ea 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -549,7 +549,7 @@ class VimIntegrationGenerator(IdeIntegrationGenerator):
 entry = {'directory': lib.location, 'file': filePath, 
'command': self.generateCommand(lib, filePath)}
 entries.append(entry)
 global_list.extend(entries)
-with open('compile_commands.json', 'w') as export_file:
+with open(os.path.join(self.gbuildparser.builddir, 
'compile_commands.json'), 'w') as export_file:
 json.dump(global_list, export_file)
 
 def generateCommand(self, lib, file):


[Libreoffice-commits] core.git: bin/gbuild-to-ide bin/update_pch_autotune.sh Makefile.in osx/soffice.xcodeproj solenv/flatpak-manifest.in

2021-12-06 Thread Thorsten Behrens (via logerrit)
 Makefile.in   |4 ++--
 bin/gbuild-to-ide |4 ++--
 bin/update_pch_autotune.sh|2 +-
 osx/soffice.xcodeproj/project.pbxproj |2 +-
 solenv/flatpak-manifest.in|2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 243c05ac27e3ffd94343630e668a53cf3ad18744
Author: Thorsten Behrens 
AuthorDate: Sat Dec 4 18:21:04 2021 +0100
Commit: Thorsten Behrens 
CommitDate: Mon Dec 6 20:54:26 2021 +0100

Retire build-nocheck

Build target was kept for backward compat in 'rework the default make
target', so lets retire it after 1.5 years.

Use 'make build' instead (which is since the default target anyway).

Change-Id: I93d5237dce2abf2536a4d847d79d33d5b6d6cec9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126362
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/Makefile.in b/Makefile.in
index f8c0bc59dcb3..9a53bd6881bf 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -12,7 +12,7 @@ gb_Top_MODULE_CHECK_TARGETS := slowcheck unitcheck 
subsequentcheck perfcheck uic
 .PHONY : check-if-root bootstrap gbuild build build-non-l10n-only 
build-l10n-only check clean clean-build clean-host test-install distclean 
distro-pack-install docs download etags fetch get-submodules id install 
install-gdb-printers install-strip tags debugrun help showmodules translations 
packageinfo internal.clean $(gb_Top_MODULE_CHECK_TARGETS)
 
 MAKECMDGOALS?=build
-build_goal:=$(if $(filter build build-nocheck uicheck,$(MAKECMDGOALS)),build)\
+build_goal:=$(if $(filter build uicheck,$(MAKECMDGOALS)),build)\
  $(if $(filter check,$(MAKECMDGOALS)),unitcheck slowcheck subsequentcheck $(if 
$(filter Linux, $(shell uname)), uicheck))\
  $(filter build-l10n-only build-non-l10n-only debugrun help showmodules 
translations $(gb_Top_MODULE_CHECK_TARGETS) check packageinfo 
gbuildtojson,$(MAKECMDGOALS))
 
@@ -291,7 +291,7 @@ ifeq ($(OS),iOS)
$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) ios
 endif
 
-build-non-l10n-only build-l10n-only build-nocheck check debugrun translations 
packageinfo $(gb_Top_MODULE_CHECK_TARGETS): build
+build-non-l10n-only build-l10n-only check debugrun translations packageinfo 
$(gb_Top_MODULE_CHECK_TARGETS): build
 
 help showmodules gbuildtojson:
$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f 
$(SRCDIR)/Makefile.gbuild $@
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index b7c290cb8285..26f0c87f6855 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1314,7 +1314,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 xml += QtCreatorIntegrationGenerator.build_configs_template % {
 'index': '7',
 'base_folder': self.base_folder,
-'arg': "build-nocheck",
+'arg': "",
 'name': "8-Global build -- nocheck",
 }
 xml += QtCreatorIntegrationGenerator.build_configs_template % {
@@ -1373,7 +1373,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 xml += QtCreatorIntegrationGenerator.build_configs_template % {
 'index': '6',
 'base_folder': self.base_folder,
-'arg': "build-nocheck",
+'arg': "",
 'name': "07-Global build -- nocheck",
 }
 xml += QtCreatorIntegrationGenerator.build_configs_template % {
diff --git a/bin/update_pch_autotune.sh b/bin/update_pch_autotune.sh
index ab9b0a688067..806e1ad17767 100755
--- a/bin/update_pch_autotune.sh
+++ b/bin/update_pch_autotune.sh
@@ -165,7 +165,7 @@ for module in $modules; do
 then
 # Build all!
 echo "Failed to build $module with dependencies, building all..."
-$MAKE build-nocheck > /dev/null
+$MAKE > /dev/null
 if [ $? -ne 0 ];
 then
 >&2 echo "Broken build. Please revert changes and try again."
diff --git a/osx/soffice.xcodeproj/project.pbxproj 
b/osx/soffice.xcodeproj/project.pbxproj
index 4ea3b7880db6..7cf857dce7f7 100644
--- a/osx/soffice.xcodeproj/project.pbxproj
+++ b/osx/soffice.xcodeproj/project.pbxproj
@@ -2407,7 +2407,7 @@
 /* Begin PBXLegacyTarget section */
BEC3D91E1710B11E0030AD56 /* soffice */ = {
isa = PBXLegacyTarget;
-   buildArgumentsString = "build-nocheck";
+   buildArgumentsString = "";
buildConfigurationList = BEC3D9211710B11E0030AD56 /* 
Build configuration list for PBXLegacyTarget "soffice" */;
buildPhases = (
);
diff --git a/solenv/flatpak-manifest.in b/solenv/flatpak-manifest.in
index 87bb0b6c23fd..b5626b80 100644
--- a/solenv/flatpak-manifest.in
+++ b/solenv/flatpak-manifest.in
@@ -694,7 +694,7 @@
 "buildsystem": "simple",
 "build-commands": [
 "./autogen.sh 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2021-11-02 Thread Mike Kaganski (via logerrit)
 bin/gbuild-to-ide |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 49e087ef44d3b7b26baf71469621c0a2135e00a9
Author: Mike Kaganski 
AuthorDate: Tue Nov 2 14:40:21 2021 +0300
Commit: Mike Kaganski 
CommitDate: Tue Nov 2 16:49:02 2021 +0100

vs-ide-integration: make projects' GUIDs stable

Use uuid.uuid5 with a custom URL to generate stable GUIDs. This avoids
glitches in IDE when re-opening the solution after its re-generation
makes some previously opened files to show duplicate entries in IDE's
tabbed UI.

Also drop the UniqueIdentifier elements from .vcxproj.filters files,
which are optional and only used in VS automation [1], so are useless
with randomly-generated GUIDs.

[1] 
https://docs.microsoft.com/en-us/cpp/build/reference/vcxproj-filters-files

Change-Id: I91dae730286b3187a6ceffcb9ae3afc2b479f4d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124594
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index b66a641b7d34..b7c290cb8285 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -23,6 +23,7 @@ import traceback
 import subprocess
 from sys import platform
 import collections
+import urllib.parse
 
 class GbuildLinkTarget:
 def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, cflags, linked_libs):
@@ -962,6 +963,10 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 
 self.write_solution(os.path.join(self.solution_directory, 
'LibreOffice.sln'), all_projects)
 
+@staticmethod
+def gen_guid(category, name):
+return str(uuid.uuid5(uuid.NAMESPACE_URL, 
'vnd.libreoffice.vs-ide-integration:' + category + '/' + 
urllib.parse.quote(name))).upper()
+
 nmake_project_guid = '8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942'
 nmake_folder_guid = '2150E333-8FDC-42A3-9474-1A3956D46DE8'
 
@@ -1071,7 +1076,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 folder = os.path.dirname(project_path)
 if not os.path.exists(folder):
 os.makedirs(folder)
-project_guid = str(uuid.uuid4()).upper()
+project_guid = self.gen_guid('project', target.short_name())
 cxxflags = ' '.join(target.cxxflags)
 ns = 'http://schemas.microsoft.com/developer/msbuild/2003'
 ET.register_namespace('', ns)
@@ -1232,8 +1237,6 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 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)
 
 


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2021-11-02 Thread Mike Kaganski (via logerrit)
 bin/gbuild-to-ide |   30 +-
 1 file changed, 29 insertions(+), 1 deletion(-)

New commits:
commit be507ca6acc91c10e4be812d626bbf5eab807f73
Author: Mike Kaganski 
AuthorDate: Tue Nov 2 13:08:26 2021 +0300
Commit: Mike Kaganski 
CommitDate: Tue Nov 2 15:47:07 2021 +0100

vs-ide-integration: create folders for Executables/Libraries/Tests

This makes the solution more manageable - one can collapse unneeded
categories.
And put LibreOffice.natvis to Utility folder, to move it to bottom.

Change-Id: I869faaf5756c65e6812b58627acd03bf816dea2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124588
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 430e4c96cbcc..b66a641b7d34 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -963,6 +963,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 self.write_solution(os.path.join(self.solution_directory, 
'LibreOffice.sln'), all_projects)
 
 nmake_project_guid = '8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942'
+nmake_folder_guid = '2150E333-8FDC-42A3-9474-1A3956D46DE8'
 
 def get_dependency_libs(self, linked_libs, library_projects):
 dependency_libs = {}
@@ -975,6 +976,8 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 def write_solution(self, solution_path, projects):
 print('Solution %s:' % 
os.path.splitext(os.path.basename(solution_path))[0], end='')
 library_projects = [project for project in projects if project.target 
in self.gbuildparser.libs]
+test_projects = [project for project in projects if project.target in 
self.gbuildparser.tests]
+executable_projects = [project for project in projects if 
project.target in self.gbuildparser.exes]
 with open(solution_path, 'w') as f:
 f.write('Microsoft Visual Studio Solution File, Format Version 
12.00\n')
 for project in projects:
@@ -992,19 +995,44 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 f.write('\t\t{%(guid)s} = {%(guid)s}\n' % {'guid': 
lib_guid})
 f.write('\tEndProjectSection\n')
 f.write('EndProject\n')
-f.write('Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = 
"Solution Items", "Solution Items", "{B9292527-A979-4D13-A598-C75A33222174}"\n')
+f.write('Project("{%s}") = "Utility", "Utility", 
"{6778240E-8B6B-47A0-AC31-7E7A257B97E6}"\n' %
+(VisualStudioIntegrationGenerator.nmake_folder_guid))
 f.write('\tProjectSection(SolutionItems) = preProject\n')
 # The natvis file gives pretty-printed variable values when 
debugging
 natvis_path = os.path.join(gbuildparser.srcdir, 
'solenv/vs/LibreOffice.natvis')
 f.write('\t\t%(natvis)s = %(natvis)s\n' % {'natvis': natvis_path})
 f.write('\tEndProjectSection\n')
 f.write('EndProject\n')
+# Folders to group tests/libraries/executables
+nmake_tests_guid = 'CF544F7B-9D02-4D83-8370-5887851209B7'
+nmake_libraries_guid = 'C624F43D-616C-4627-B58F-F5C2047B7BDC'
+nmake_executables_guid = '1CD80999-9FA9-4BA9-B4D9-6E33035CF648'
+f.write('Project("{%s}") = "Tests", "Tests", "{%s}"\n' %
+(VisualStudioIntegrationGenerator.nmake_folder_guid, 
nmake_tests_guid))
+f.write('EndProject\n')
+f.write('Project("{%s}") = "Libraries", "Libraries", "{%s}"\n' %
+(VisualStudioIntegrationGenerator.nmake_folder_guid, 
nmake_libraries_guid))
+f.write('EndProject\n')
+f.write('Project("{%s}") = "Executables", "Executables", "{%s}"\n' 
%
+(VisualStudioIntegrationGenerator.nmake_folder_guid, 
nmake_executables_guid))
+f.write('EndProject\n')
+# end Folders to group tests/libraries/executables
 f.write('Global\n')
 platform = 'Win32'
 f.write('\tGlobalSection(SolutionConfigurationPlatforms) = 
preSolution\n')
 for cfg in self.configurations:
 f.write('\t\t%(cfg)s|%(platform)s = %(cfg)s|%(platform)s\n' % 
{'cfg': cfg, 'platform': platform})
 f.write('\tEndGlobalSection\n')
+# Group projects to folders
+f.write('\tGlobalSection(NestedProjects) = preSolution\n')
+for project in test_projects:
+f.write('\t\t{%s} = {%s}\n' % (project.guid, nmake_tests_guid))
+for project in library_projects:
+f.write('\t\t{%s} = {%s}\n' % (project.guid, 
nmake_libraries_guid))
+for project in executable_projects:
+f.write('\t\t{%s} = {%s}\n' % (project.guid, 
nmake_executables_guid))
+f.write('\tEndGlobalSection\n')
+# end Group projects to folders
 

[Libreoffice-commits] core.git: bin/gbuild-to-ide config_host.mk.in configure.ac external/breakpad external/coinmp external/cppunit external/lcms2 external/postgresql external/python3

2021-10-08 Thread Mike Kaganski (via logerrit)
 bin/gbuild-to-ide |6 +-
 config_host.mk.in |1 +
 configure.ac  |   22 --
 external/breakpad/ExternalProject_breakpad.mk |2 +-
 external/coinmp/ExternalProject_coinmp.mk |3 +--
 external/cppunit/ExternalProject_cppunit.mk   |3 +--
 external/lcms2/ExternalProject_lcms2.mk   |3 +--
 external/postgresql/ExternalProject_postgresql.mk |3 +--
 external/python3/ExternalProject_python3.mk   |3 +--
 9 files changed, 20 insertions(+), 26 deletions(-)

New commits:
commit 8e779c062a22a5755cae2c86787e16f59bfe4907
Author: Mike Kaganski 
AuthorDate: Fri Oct 8 10:51:50 2021 +0200
Commit: Mike Kaganski 
CommitDate: Fri Oct 8 14:54:10 2021 +0200

Centralize VS-to-toolset mapping in configure

This allows to define the mapping once, and avoid modification in
multiple places each time a new VS version support is added

Change-Id: I93de4c9d78c3f67a0a2e157007e9d13b6f557937
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123163
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 8e9d8ba157a6..430e4c96cbcc 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -916,7 +916,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 
 def __init__(self, gbuildparser, ide):
 IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
-self.toolset = self.retrieve_toolset()
+self.toolset = os.environ['VCTOOLSET']
 self.solution_directory = self.gbuildparser.builddir
 self.configurations = {
 'Build': {
@@ -936,10 +936,6 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 }
 }
 
-def retrieve_toolset(self):
-ide_toolset_map = {'160': 'v142', '170': 'v143'}
-return ide_toolset_map[os.environ['VCVER']]
-
 def module_make_command(self, targets):
 return '%(sh)s -c "PATH=\\"/bin:$PATH\\";BUILDDIR=\\"%(builddir)s\\" 
%(makecmd)s -rsC %(location)s ' + targets + '"'
 
diff --git a/config_host.mk.in b/config_host.mk.in
index d84d5df0ac57..8d8b6e013db1 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -671,6 +671,7 @@ export UPDATE_CONFIG=@UPDATE_CONFIG@
 export UUIDGEN=@UUIDGEN@
 export VALGRIND_CFLAGS=$(gb_SPACE)@VALGRIND_CFLAGS@
 export VCL_PLUGIN_INFO=@VCL_PLUGIN_INFO@
+export VCTOOLSET=@VCTOOLSET@
 export VCVER=@VCVER@
 export DEVENV=@DEVENV@
 export VISIO_CFLAGS=$(gb_SPACE)@VISIO_CFLAGS@
diff --git a/configure.ac b/configure.ac
index c0713a64df5a..90fc05c31f80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3928,9 +3928,9 @@ find_msvc()
 {
 # Find Visual C++ 2019
 # Args: $1 (optional) : The VS version year
-# Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot, $vcbuildnumber
+# Return values: $vctest, $vcyear, $vctoolset, $vcnumwithdot, 
$vcbuildnumber
 
-unset vctest vcnum vcnumwithdot vcbuildnumber
+unset vctest vctoolset vcnumwithdot vcbuildnumber
 
 vs_versions_to_check "$1"
 if test "$build_os" = wsl; then
@@ -3960,11 +3960,11 @@ find_msvc()
 case "$vcnumwithdot" in
 16.0)
 vcyear=2019
-vcnum=160
+vctoolset=v142
 ;;
 17.0)
 vcyear=2022
-vcnum=170
+vctoolset=v143
 ;;
 esac
 vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
@@ -4127,13 +4127,14 @@ if test "$_os" = "WINNT"; then
 PathFormat "$COMPATH"
 COMPATH=`win_short_path_for_make "$formatted_path"`
 
-VCVER=$vcnum
+VCVER=$vcnumwithdot
+VCTOOLSET=$vctoolset
 
 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess...  
Assuming newer ones
 # are always "better", we list them in reverse chronological order.
 
-case "$vcnum" in
-160 | 170)
+case "$vcnumwithdot" in
+16.0 | 17.0)
 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0"
 ;;
 esac
@@ -4225,6 +4226,7 @@ if test "$_os" = "WINNT"; then
 AC_SUBST(CXX_X86_BINARY)
 fi
 AC_SUBST(VCVER)
+AC_SUBST(VCTOOLSET)
 AC_SUBST(DEVENV)
 AC_SUBST(MSVC_CXX)
 
@@ -6427,7 +6429,7 @@ find_msms()
 dnl the result will be the highest MSM version found in the highest 
directory.
 
 case "$VCVER" in
-160 | 170)
+16.0 | 17.0)
 my_msm_files="Microsoft_VC141_CRT_x86.msm Microsoft_VC142_CRT_x86.msm 
${my_msm_files}"
 ;;
 esac
@@ -6437,7 +6439,7 @@ find_msms()
 
 msmdir=
 case "$VCVER" in
-160 | 170)
+16.0 | 17.0)
 for f in ${my_msm_files}; do
 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
 my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
@@ -6475,7 +6477,7 @@ find_msvc_x64_dlls()
 
 

[Libreoffice-commits] core.git: bin/gbuild-to-ide Makefile.in

2021-10-08 Thread Mike Kaganski (via logerrit)
 Makefile.in   |3 +--
 bin/gbuild-to-ide |   11 +--
 2 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit 27d1cc61b4f58e8ec25463275bee36c96b66b938
Author: Mike Kaganski 
AuthorDate: Fri Oct 8 09:56:51 2021 +0200
Commit: Mike Kaganski 
CommitDate: Fri Oct 8 14:53:48 2021 +0200

Simplify VS IDE integration generation

Do not require the IDE version in vs*-ide-integration. Instead, use
VCVER environment variable, that is set in configure, to obtain
the toolset for the VCPROJ files. When introducing support for new
VS version, the 'VisualStudioIntegrationGenerator.retrieve_toolset'
method needs to be updated synchronously to list the toolset.

This simplifies the make command to

  make vs-ide-integration

TODO: also set the toolset in configure, to simplify the code here,
and also in places like external/python3/ExternalProject_python3.mk
(see commit c156a8c708f74dd31e1ef024edc578c3915619cb).

Change-Id: I95960029a933be2cab96898eee6be6ca6bc5794a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123162
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/Makefile.in b/Makefile.in
index a71a203d3558..116b1e6bd7c1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -483,8 +483,7 @@ endef
 
 $(foreach ide,\
codelite \
-   vs2019 \
-   vs2022 \
+   vs \
kdevelop \
vim \
qtcreator \
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index f349a3058aab..8e9d8ba157a6 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -916,7 +916,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 
 def __init__(self, gbuildparser, ide):
 IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
-self.toolset = self.retrieve_toolset(ide)
+self.toolset = self.retrieve_toolset()
 self.solution_directory = self.gbuildparser.builddir
 self.configurations = {
 'Build': {
@@ -936,9 +936,9 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 }
 }
 
-def retrieve_toolset(self, ide):
-ide_toolset_map = {'vs2019': 'v142', 'vs2022': 'v143'}
-return ide_toolset_map[ide]
+def retrieve_toolset(self):
+ide_toolset_map = {'160': 'v142', '170': 'v143'}
+return ide_toolset_map[os.environ['VCVER']]
 
 def module_make_command(self, targets):
 return '%(sh)s -c "PATH=\\"/bin:$PATH\\";BUILDDIR=\\"%(builddir)s\\" 
%(makecmd)s -rsC %(location)s ' + targets + '"'
@@ -1870,8 +1870,7 @@ if __name__ == '__main__':
 'eclipsecdt': EclipseCDTIntegrationGenerator,
 'kdevelop': KdevelopIntegrationGenerator,
 'xcode': XcodeIntegrationGenerator,
-'vs2019': VisualStudioIntegrationGenerator,
-'vs2022': VisualStudioIntegrationGenerator,
+'vs': VisualStudioIntegrationGenerator,
 'vim': VimIntegrationGenerator,
 'debug': DebugIntegrationGenerator,
 'qtcreator': QtCreatorIntegrationGenerator,


[Libreoffice-commits] core.git: bin/gbuild-to-ide Makefile.in

2021-10-08 Thread Mike Kaganski (via logerrit)
 Makefile.in   |2 +-
 bin/gbuild-to-ide |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit a0289052fd4f0f901ffd3698cee8669244701e5e
Author: Mike Kaganski 
AuthorDate: Fri Oct 8 08:46:32 2021 +0200
Commit: Mike Kaganski 
CommitDate: Fri Oct 8 10:03:06 2021 +0200

Drop vs2017-ide-integration; add vs2022-ide-integration

VS2017 is not supported since 24973523ba59087185d434396fd614e73d72107f.

Change-Id: I1a2af1eb8c9216eaed87d5454def2176728f719b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123161
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/Makefile.in b/Makefile.in
index 4fdfe067ebf5..a71a203d3558 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -483,8 +483,8 @@ endef
 
 $(foreach ide,\
codelite \
-   vs2017 \
vs2019 \
+   vs2022 \
kdevelop \
vim \
qtcreator \
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index bdd83c26dfba..f349a3058aab 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -937,7 +937,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 }
 
 def retrieve_toolset(self, ide):
-ide_toolset_map = {'vs2017': 'v141', 'vs2019': 'v142'}
+ide_toolset_map = {'vs2019': 'v142', 'vs2022': 'v143'}
 return ide_toolset_map[ide]
 
 def module_make_command(self, targets):
@@ -1870,8 +1870,8 @@ if __name__ == '__main__':
 'eclipsecdt': EclipseCDTIntegrationGenerator,
 'kdevelop': KdevelopIntegrationGenerator,
 'xcode': XcodeIntegrationGenerator,
-'vs2017': VisualStudioIntegrationGenerator,
 'vs2019': VisualStudioIntegrationGenerator,
+'vs2022': VisualStudioIntegrationGenerator,
 'vim': VimIntegrationGenerator,
 'debug': DebugIntegrationGenerator,
 'qtcreator': QtCreatorIntegrationGenerator,


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2021-02-25 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 9b9eb423eeeb41bb87cd13c2a83dc3e878fbac6e
Author: Michael Weghorn 
AuthorDate: Thu Feb 25 15:00:05 2021 +0100
Commit: Michael Weghorn 
CommitDate: Fri Feb 26 08:56:33 2021 +0100

qtcreator: Create *.pro and *.pro.shared files in builddir, not srcdir

With the previous modifications to Qt Creator IDE integration,
this makes 'make qtcreator-ide-integration' work when run from
a separate build dir, and allows to use multiple build dirs for
the same source dir in parallel, each with its own set of
Qt Creator files referring to the specific build in their
build and run settings.

Change-Id: I5d85d0d280be5e5edca15760bcccfc793e1e4b2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111553
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 6d10f661e097..bdd83c26dfba 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1745,6 +1745,8 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 # so we can't reuse directly the same method than for kde integration.
 self.build_data_libs()
 
+# subdirs for the meta .pro file
+subdirs_meta_pro = []
 subdirs_list = self.data_libs.keys()
 # Now we can create Qt files
 for lib_folder in subdirs_list:
@@ -1763,7 +1765,8 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 defines = " \\\n".join(defines_list)
 
 # create .pro file
-qt_pro_file = '%s/%s.pro' % (lib_loc, lib_name)
+subdirs_meta_pro.append(lib_name)
+qt_pro_file = os.path.join(self.base_folder, lib_name, lib_name + 
'.pro')
 try:
 content = QtCreatorIntegrationGenerator.pro_template % 
{'sources': sources, 'headers': headers,
 
'cxxflags': cxxflags, 'includepath': includepath, 'defines': defines}
@@ -1779,7 +1782,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 print("\n\n", file=sys.stderr)
 
 # create .pro.shared file
-qt_pro_shared_file = '%s/%s.pro.shared' % (lib_loc, lib_name)
+qt_pro_shared_file = os.path.join(self.base_folder, lib_name, 
lib_name + '.pro.shared')
 try:
 with open(qt_pro_shared_file, mode) as fproshared:
 
fproshared.write(self.generate_pro_shared_content(lib_folder))
@@ -1793,9 +1796,9 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 print("\n\n", file=sys.stderr)
 
 # create meta .pro file (lists all sub projects)
-qt_meta_pro_file = 'lo.pro'
+qt_meta_pro_file = os.path.join(self.base_folder, 'lo.pro')
 try:
-subdirs = " \\\n".join(sorted(subdirs_list))
+subdirs = " \\\n".join(sorted(subdirs_meta_pro))
 content = QtCreatorIntegrationGenerator.pro_meta_template % 
{'subdirs': subdirs}
 with open(qt_meta_pro_file, 'w+') as fmpro:
 fmpro.write(content)
@@ -1808,7 +1811,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 print("\n\n", file=sys.stderr)
 
 # create meta .pro.shared file
-qt_meta_pro_shared_file = 'lo.pro.shared'
+qt_meta_pro_shared_file = os.path.join(self.base_folder, 
'lo.pro.shared')
 try:
 with open(qt_meta_pro_shared_file, mode) as fmproshared:
 fmproshared.write(self.generate_meta_pro_shared_content())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2021-02-25 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 78f6cafe6636f52e95d4f815fff44cde34d30528
Author: Michael Weghorn 
AuthorDate: Thu Feb 25 14:17:30 2021 +0100
Commit: Michael Weghorn 
CommitDate: Fri Feb 26 08:56:10 2021 +0100

qtcreator: Use absolute paths in *.pro files

... as a preparation to make this work
for the srcdir != builddir case as well.

Change-Id: I87507b9866f97cdbdf848c6b187b3b8f17262b6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111552
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 3ee79977e78f..6d10f661e097 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1660,15 +1660,15 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 lib_folder = os.path.relpath(lib.location, self.base_folder)
 
 def lopath(path):
-if platform =="cygwin":
+if platform == "cygwin":
 # absolute paths from GbuildToJson are Windows paths,
 # so convert everything to such ones
 abs_path = path
 if not ntpath.isabs(abs_path):
 abs_path = ntpath.join(self.gbuildparser.srcdir, path)
-return ntpath.relpath(abs_path, 
lib.location).replace('\\', '/')
+return abs_path.replace('\\', '/')
 
-return os.path.relpath(path, lib.location)
+return os.path.abspath(path)
 
 defines_list = []
 sources_list = []
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2021-02-25 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5e73d9d0fc74a6056574f795f47b86f730a0eab2
Author: Michael Weghorn 
AuthorDate: Thu Feb 25 10:49:50 2021 +0100
Commit: Michael Weghorn 
CommitDate: Fri Feb 26 08:55:12 2021 +0100

qtcreator: Translate comment: "et" -> "and"

Change-Id: I2fe51ab0cdfca5c94bd520ed7f9096bc7c8f6fec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111549
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index ac3115aa3d25..7af0b26239ff 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1384,7 +1384,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 }
 return xml
 
-# By default, QtCreator creates 2 BuildStepList : "Build" et "Clean"
+# By default, QtCreator creates 2 BuildStepList : "Build" and "Clean"
 # but the "clean" can be empty.
 build_configs_template = """

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2021-02-25 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5d5ada6e0ed33d22f8b744621d2d151c31ae0033
Author: Michael Weghorn 
AuthorDate: Thu Feb 25 10:46:10 2021 +0100
Commit: Michael Weghorn 
CommitDate: Fri Feb 26 08:54:56 2021 +0100

qtcreator: Move assignment to 'mode' out of try block

The variable is used outside of the try block
further down. While that works with how Python handles
variable scopes (and there is no exception before the
assignment happens), moving the variable outside makes
the context/scope clearer.

Change-Id: Iecfd0477ffb4515cf58736ee138fc8ca7273967f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111548
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 10d9b2bcc47a..ac3115aa3d25 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1754,6 +1754,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 
 def emit(self):
 
+mode = 'w+'
 self.base_folder = self.gbuildparser.builddir
 
 # we remove existing '.pro' and '.pro.shared' files
@@ -1785,7 +1786,6 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 try:
 content = QtCreatorIntegrationGenerator.pro_template % 
{'sources': sources, 'headers': headers,
 
'cxxflags': cxxflags, 'includepath': includepath, 'defines': defines}
-mode = 'w+'
 with open(qt_pro_file, mode) as fpro:
 fpro.write(content)
 self._log("created %s\n" % qt_pro_file)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide .gitignore

2021-02-24 Thread Michael Weghorn (via logerrit)
 .gitignore|1 +
 bin/gbuild-to-ide |   40 
 2 files changed, 21 insertions(+), 20 deletions(-)

New commits:
commit e827cb144ee9886134a946c7a3b316f9eeb83168
Author: Michael Weghorn 
AuthorDate: Wed Feb 24 09:51:16 2021 +0100
Commit: Michael Weghorn 
CommitDate: Wed Feb 24 17:44:50 2021 +0100

qtcreator: Create *.pro.shared files instead of *.pro.user

Generating *.pro.user files is not ideal; they're
supposed to hold user-specific settings for a project,
and thus also to persist manual changes made by the user
after initial import of the project.

Generate *.pro.shared files instead which are
meant to be used to share project settings. [1]
This just changes the file name of the generated
file for now, but leaves the content the same.

The result for the initial loading of the project from
a '*.pro' file is basically still the same from a user
perspective:
A new kit 'Replacement for "Desktop"' is generated on
the fly which contains the build and run settings
specified in the corresponding '*.pro.shared' file.

By using the '*.pro.shared' files, user-specific settings
made after initial import will no longer
be overwritten by running 'make qtcreator-ide-integration'
again, since the '*.pro.user' files are left as they are.

The '*.pro.shared' files generated here still contain
information specific to the local setup (like file paths).

For some more background on LO's Qt Creator IDE integration,
s. dev mailing list thread "Added some information about
Qt Creator IDE integration to the wiki" [2].

[1] https://doc.qt.io/qtcreator/creator-sharing-project-settings.html
[2] 
https://lists.freedesktop.org/archives/libreoffice/2021-February/thread.html#86800

Change-Id: Ia187bcbffe5297a1cdf6bfeaaabf7867003195e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111474
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/.gitignore b/.gitignore
index dea264a366fa..d89e5b12035f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -142,6 +142,7 @@ LibreOffice.VC.VC.opendb
 
 # QtCreator specific
 *.pro
+*.pro.shared
 *.pro.user
 *.pro.user.*
 
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index ed1632232c92..10d9b2bcc47a 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1511,33 +1511,33 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
1
 """
 
-def generate_pro_user_content(self, lib_folder):
+def generate_pro_shared_content(self, lib_folder):
 
 build_configs = self.generate_build_configs(lib_folder)
 deploy_configs = self.generate_deploy_configs(lib_folder)
 run_configs = self.generate_run_configs(lib_folder)
 
-xml = QtCreatorIntegrationGenerator.pro_user_template % {
+xml = QtCreatorIntegrationGenerator.pro_shared_template % {
 'build_configs': build_configs,
 'deploy_configs': deploy_configs,
 'run_configs': run_configs,
 }
 return xml
 
-def generate_meta_pro_user_content(self):
+def generate_meta_pro_shared_content(self):
 
 build_configs = self.generate_meta_build_configs()
 deploy_configs = self.generate_deploy_configs("")
 run_configs = self.generate_run_configs("")
 
-xml = QtCreatorIntegrationGenerator.pro_user_template % {
+xml = QtCreatorIntegrationGenerator.pro_shared_template % {
 'build_configs': build_configs,
 'deploy_configs': deploy_configs,
 'run_configs': run_configs,
 }
 return xml
 
-pro_user_template = """
+pro_shared_template = """
 
 
 
@@ -1645,10 +1645,10 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 self._log("unable to remove %s\n" % afile)
 
 do_remove_file(self.base_folder, "lo.pro")
-do_remove_file(self.base_folder, "lo.pro.user")
+do_remove_file(self.base_folder, "lo.pro.shared")
 for location in self.target_by_location:
 for f in os.listdir(location):
-if f.endswith('.pro') or f.endswith('.pro.user'):
+if f.endswith('.pro') or f.endswith('.pro.shared'):
 do_remove_file(location, f)
 
 def get_source_extension(self, src_file):
@@ -1756,7 +1756,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 
 self.base_folder = self.gbuildparser.builddir
 
-# we remove existing '.pro' and '.pro.user' files
+# we remove existing '.pro' and '.pro.shared' files
 self.remove_qt_files()
 
 # for .pro files, we must explicitly list all files (.c, .h)
@@ -1797,15 +1797,15 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 print(temp, file=sys.stderr)
 print("\n\n", file=sys.stderr)
 
-# create 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2021-02-07 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit d2d6e5c235f35bf3f2137e8dab4b9b32b72430a8
Author: Michael Weghorn 
AuthorDate: Sun Feb 7 15:21:07 2021 +0100
Commit: Michael Weghorn 
CommitDate: Sun Feb 7 19:53:11 2021 +0100

qtcreator: Show actual names for build configurations

At least with current Qt Creator 4.14, no proper
names were shown for the build configurations in
the project's "Build" settings, but just integers.

Using the config key 'ProjectExplorer.ProjectConfiguration.DisplayName'
instead of 'ProjectExplorer.ProjectConfiguration.DefaultDisplayName'
in the *.user.pro file makes this work as intended, and "01-Global Build"
(and others) shows up as the name  for the top-level 'lo.pro' project
and "1-Build vcl" for 'vcl.pro', etc.

Along with the two previous qtcreator-related commits,
this should generally (re)implement an easy way to
run unit tests etc. directly from the Qt Creator IDE
without having to set that up manually, which cloph
mentioned as missing in his FOSDEM talk today
("Using IDEs for LibreOffice development", [1]).

To use this, select the corresponding build configuration
by clicking on the "screen" icon on the bottom left,
then build the project (Ctrl+B or left-click on the
"hammer" icon on the bottom left).

I didn't check whether the single targets are still up
to date.

[1] https://fosdem.org/2021/schedule/event/lo_ideforlodevelopment/

Change-Id: I9965829db319a8b26f5ad82d3ffa723a28da7910
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110536
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 7c6176233701..ed1632232c92 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1411,8 +1411,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 1
 false
 
-%(name)s
-
+%(name)s
 Qt4ProjectManager.Qt4BuildConfiguration
 %(index)s
 true
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2021-02-07 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit fdd9b20572435842bde076e3c35ef94d26f13b30
Author: Michael Weghorn 
AuthorDate: Sun Feb 7 14:48:12 2021 +0100
Commit: Michael Weghorn 
CommitDate: Sun Feb 7 18:16:31 2021 +0100

qtcreator: Drop some extra whitespace in .pro.user template

Fix indentation and drop some extra empty lines that are
automatically removed once the project is loaded in
Qt Creator and then closed anyway.

This will make it a little easier to compare what the initially
generated file looks like compared to the one as it is written
after (implicitly or explicitly) carrying out the configuration
in Qt Creator after loading the project.

Change-Id: I52173162efe635e6fb3e7f889c42ed67271c05b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110535
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 6abaf436e668..7c6176233701 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1387,11 +1387,9 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 # By default, QtCreator creates 2 BuildStepList : "Build" et "Clean"
 # but the "clean" can be empty.
 build_configs_template = """
-
+   
 %(base_folder)s
-
 
-
  
   true
   Make
@@ -1405,13 +1403,11 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
   %(arg)s
   
  
-
  1
  Build
  
  ProjectExplorer.BuildSteps.Build
 
-
 1
 false
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2021-02-07 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 77d5383c6e83fdcb268138f71601fa39c95a62aa
Author: Michael Weghorn 
AuthorDate: Sun Feb 7 14:28:51 2021 +0100
Commit: Michael Weghorn 
CommitDate: Sun Feb 7 18:15:52 2021 +0100

qtcreator: Don't create useless run configurations for subdirs

Use the 'lib' instead of the 'app' template for the
qmake files in the subdirectories, which avoids
automatically creating a useless run configuration
for each subdirectory pointing to a non-existent
execuatable, like '/accessibility/accessibility'
etc.

With this in place, I just get a single "Custom Executable"
run configuration running 'instdir/program/soffice.bin'
when opening the newly generated 'lo.pro' in Qt Creator 4.14.

Change-Id: I69a7f1b56b02849b217bf66f110d9ee1f61125ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110534
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index bba9a9896b8a..6abaf436e668 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1847,7 +1847,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 
 self.log_close()
 
-pro_template = """TEMPLATE = app
+pro_template = """TEMPLATE = lib
 CONFIG += console
 CONFIG -= app_bundle
 CONFIG -= qt
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2020-09-17 Thread Miklos Vajna (via logerrit)
 bin/gbuild-to-ide |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0bd92e6314b799afec447c1e30260d9a8dfad894
Author: Miklos Vajna 
AuthorDate: Thu Sep 17 10:55:26 2020 +0200
Commit: Miklos Vajna 
CommitDate: Thu Sep 17 13:10:29 2020 +0200

make vim-ide-integration: fix ResourceWarning

Exception ignored in: <_io.FileIO name='compile_commands.json' mode='wb' 
closefd=True>
ResourceWarning: unclosed file <_io.TextIOWrapper 
name='compile_commands.json' mode='w' encoding='UTF-8'>

Change-Id: I2ab4275a9b7897f5cd9e88b20a1eea4c68fe0d1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102907
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 7a6964abd454..bba9a9896b8a 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -548,8 +548,8 @@ class VimIntegrationGenerator(IdeIntegrationGenerator):
 entry = {'directory': lib.location, 'file': filePath, 
'command': self.generateCommand(lib, filePath)}
 entries.append(entry)
 global_list.extend(entries)
-export_file = open('compile_commands.json', 'w')
-json.dump(global_list, export_file)
+with open('compile_commands.json', 'w') as export_file:
+json.dump(global_list, export_file)
 
 def generateCommand(self, lib, file):
 command = 'clang++ -Wall'
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2020-07-08 Thread Mike Kaganski (via logerrit)
 bin/gbuild-to-ide |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 328b1d6774c3d116b62ab7149159389c5e2ca12f
Author: Mike Kaganski 
AuthorDate: Wed Jul 8 11:03:05 2020 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jul 8 12:47:53 2020 +0200

vs-ide-integration: unescape values coming from DEFS

... so `TK_DLL_NAME=\"tklo.dll\"` becomes `TK_DLL_NAME="tklo.dll"`

Change-Id: I0e14ded85be387a342e1979aa3f120727178351d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98319
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index f74712cafeb9..f23592469fd9 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1028,6 +1028,9 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 else:
 return shortnames
 
+# Unescape the values: \"tklo.dll\" => "tklo.dll"
+escapepattern = re.compile(r'\\(.)')
+
 @staticmethod
 def defs_list(defs):
 defines_list = []
@@ -1035,7 +1038,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 for key, value in defs.items():
 define = key
 if value is not None:
-define += '=' + value
+define += '=' + 
VisualStudioIntegrationGenerator.escapepattern.sub(r'\1', value)
 defines_list.append(define)
 return defines_list
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2020-01-27 Thread Mike Kaganski (via logerrit)
 bin/gbuild-to-ide |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 7d44fef8a785321578d359e831c71d75b36b893f
Author: Mike Kaganski 
AuthorDate: Mon Jan 27 12:14:56 2020 +0300
Commit: Mike Kaganski 
CommitDate: Mon Jan 27 17:16:50 2020 +0100

VisualStudioIntegrationGenerator: put solution/projects to build dir

.. instead of source dir. This allows to have ide integration files
in proper directory when using out-of-the-tree build directory.

Change-Id: I0d3be02b3ee27e499d9d223b0a521e465a1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87502
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 097f163d46ed..f74712cafeb9 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -917,7 +917,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 def __init__(self, gbuildparser, ide):
 IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
 self.toolset = self.retrieve_toolset(ide)
-self.solution_directory = './'
+self.solution_directory = self.gbuildparser.builddir
 self.configurations = {
 'Build': {
 'build': self.module_make_command('%(target)s'),
@@ -998,7 +998,9 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 f.write('EndProject\n')
 f.write('Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = 
"Solution Items", "Solution Items", "{B9292527-A979-4D13-A598-C75A33222174}"\n')
 f.write('\tProjectSection(SolutionItems) = preProject\n')
-f.write('\t\tsolenv/vs/LibreOffice.natvis = 
solenv/vs/LibreOffice.natvis\n')
+# The natvis file gives pretty-printed variable values when 
debugging
+natvis_path = os.path.join(gbuildparser.srcdir, 
'solenv/vs/LibreOffice.natvis')
+f.write('\t\t%(natvis)s = %(natvis)s\n' % {'natvis': natvis_path})
 f.write('\tEndProjectSection\n')
 f.write('EndProject\n')
 f.write('Global\n')
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2020-01-22 Thread Mike Kaganski (via logerrit)
 bin/gbuild-to-ide |   57 +++---
 1 file changed, 42 insertions(+), 15 deletions(-)

New commits:
commit a821d89646ef25428cf5992f86d8f31581313bdb
Author: Mike Kaganski 
AuthorDate: Wed Jan 22 16:59:22 2020 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jan 22 15:54:00 2020 +0100

vs-ide-integration: Also add .c files

Change-Id: Icb4e879025278291270d908bb53178250c8e7007
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87192
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index b2a5f7bb714e..097f163d46ed 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -25,25 +25,25 @@ from sys import platform
 import collections
 
 class GbuildLinkTarget:
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs):
-(self.name, self.location, self.include, self.include_sys, self.defs, 
self.cxxobjects, self.cxxflags, self.linked_libs) = (
-name, location, include, include_sys, defs, cxxobjects, cxxflags, 
linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, cflags, linked_libs):
+(self.name, self.location, self.include, self.include_sys, self.defs, 
self.cxxobjects, self.cxxflags, self.cobjects, self.cflags, self.linked_libs) = 
(
+name, location, include, include_sys, defs, cxxobjects, cxxflags, 
cobjects, cflags, linked_libs)
 
 def short_name(self):
 return self.name
 
 def is_empty(self):
-return not self.include and not self.defs and not self.cxxobjects and 
not self.linked_libs
+return not self.include and not self.defs and not self.cxxobjects and 
not self.cobjects and not self.linked_libs
 
 def __str__(self):
-return '%s at %s with include path: %s, isystem includes: %s, defines: 
%s, objects: %s, cxxflags: %s and linked libs: %s' % (
+return '%s at %s with include path: %s, isystem includes: %s, defines: 
%s, objects: %s, cxxflags: %s, cobjects: %s, cflags: %s and linked libs: %s' % (
 self.short_name(), self.location, self.include, self.include_sys, 
self.defs, self.cxxobjects,
-self.cxxflags, self.linked_libs)
+self.cxxflags, self.cobjects, self.cflags, self.linked_libs)
 
 
 class GbuildLib(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, cflags, linked_libs):
+GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, cflags, linked_libs)
 
 def short_name(self):
 """Return the short name of target based on the Library_* makefile 
name"""
@@ -56,8 +56,8 @@ class GbuildLib(GbuildLinkTarget):
 return self.name
 
 class GbuildTest(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, cflags, linked_libs):
+GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, cflags, linked_libs)
 
 def short_name(self):
 """Return the short name of target based n the CppunitTest_* makefile 
names"""
@@ -67,8 +67,8 @@ class GbuildTest(GbuildLinkTarget):
 return 'CppunitTest_%s' % self.name
 
 class GbuildExe(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, cflags, linked_libs):
+GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, cflags, linked_libs)
 
 def short_name(self):
 """Return the short name of target based on the Executable_* makefile 
name"""
@@ -110,7 +110,7 @@ class GbuildParser:
 
 @staticmethod
 def __split_objs(objsline):
-return [obj for obj in objsline.strip().split(' ') if len(obj) > 0 and 
obj != 'CXXOBJECTS' and obj != '+=']
+return [obj for obj in objsline.strip().split(' ') if len(obj) > 0 and 
obj != 'CXXOBJECTS' and obj != 'COBJECTS' and obj != '+=']
 
 @staticmethod
 def __split_defs(defsline):
@@ -144,6 +144,8 @@ class GbuildParser:
 GbuildParser.__split_defs(json['DEFS']),
 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2019-10-11 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2ef2c031ce9ec730b13fca8bca808f382aab5fe4
Author: Michael Weghorn 
AuthorDate: Fri Oct 11 11:54:07 2019 +0200
Commit: Michael Weghorn 
CommitDate: Sat Oct 12 01:29:32 2019 +0200

qtcreator: Sort SUBDIRS in lo.pro alphabetically

... in particular to have a deterministic order and see
more easily what relevant effects changes to the
gbuild-to-ide script have while testing those.

Change-Id: I4583a8ca5a779d1d1e8aa6db7bb0295abd6154ee
Reviewed-on: https://gerrit.libreoffice.org/80653
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index f281f17fbfd6..b2a5f7bb714e 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1787,7 +1787,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 # create meta .pro file (lists all sub projects)
 qt_meta_pro_file = 'lo.pro'
 try:
-subdirs = " \\\n".join(subdirs_list)
+subdirs = " \\\n".join(sorted(subdirs_list))
 content = QtCreatorIntegrationGenerator.pro_meta_template % 
{'subdirs': subdirs}
 with open(qt_meta_pro_file, 'w+') as fmpro:
 fmpro.write(content)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2019-10-11 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0470bfdff2b1bca7a075d130b029d4a1a54e90fc
Author: Michael Weghorn 
AuthorDate: Fri Oct 11 11:47:57 2019 +0200
Commit: Michael Weghorn 
CommitDate: Fri Oct 11 22:22:18 2019 +0200

qtcreator-ide-integration: Take unit tests into account

This makes code-completion, clang checks, navigation etc.
work in files related to those as well.

Change-Id: Ie0b7d75f2ed953228d74ae070056327bff7ff2a2
Reviewed-on: https://gerrit.libreoffice.org/80652
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index f08c0fcbc2ce..f281f17fbfd6 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1186,7 +1186,7 @@ class 
QtCreatorIntegrationGenerator(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):
+for target in set(self.gbuildparser.libs) | 
set(self.gbuildparser.exes) | set(self.gbuildparser.tests):
 if target.location not in self.target_by_location:
 self.target_by_location[target.location] = set()
 self.target_by_location[target.location] |= set([target])
@@ -1642,7 +1642,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 
 self.data_libs = {}
 
-all_libs = set(self.gbuildparser.libs) | set(self.gbuildparser.exes)
+all_libs = set(self.gbuildparser.libs) | set(self.gbuildparser.exes) | 
set(self.gbuildparser.tests)
 for lib in all_libs:
 self._log("\nlibrary : %s, loc=%s" % (lib.short_name(), 
lib.location))
 lib_name = os.path.basename(lib.location)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2019-07-05 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 22c6ffc274a4dd29fdd6c0d02415139502bddae6
Author: Michael Weghorn 
AuthorDate: Fri Jul 5 08:46:10 2019 +0100
Commit: Michael Weghorn 
CommitDate: Fri Jul 5 12:54:48 2019 +0200

qtcreator: Make paths work with cygwin

Absolute paths in files created by GbuildToJson
in Cygwin environment are Windows paths
(like "C:/'), while relative paths in the Python
program executed in Cygwin are treated as Unix paths
('/cygdrive/c/') which caused wrong relative paths to
be generated by the call to 'os.relpath'. It would walk up to
the root of the Windows path and then walk down the tree in the
Unix file system path again.

This converts the paths to absolute Windows paths first to avoid
this issue.

Change-Id: I2e3e6926e312d64aa18067933a5903ac7ad5d31a
Reviewed-on: https://gerrit.libreoffice.org/75114
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index f1121efddabb..bcb3ec41ba4a 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -9,6 +9,7 @@
 #
 
 import argparse
+import ntpath
 import os
 import os.path
 import shutil
@@ -1648,6 +1649,14 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 lib_folder = os.path.relpath(lib.location, self.base_folder)
 
 def lopath(path):
+if platform =="cygwin":
+# absolute paths from GbuildToJson are Windows paths,
+# so convert everything to such ones
+abs_path = path
+if not ntpath.isabs(abs_path):
+abs_path = ntpath.join(self.gbuildparser.srcdir, path)
+return ntpath.relpath(abs_path, 
lib.location).replace('\\', '/')
+
 return os.path.relpath(path, lib.location)
 
 defines_list = []
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: bin/gbuild-to-ide Makefile.in

2019-06-17 Thread Mike Kaganski (via logerrit)
 Makefile.in   |1 +
 bin/gbuild-to-ide |3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit c8acd77fd08c0c02fa3e1b388f993e77aba3537e
Author: Mike Kaganski 
AuthorDate: Mon Jun 17 06:26:32 2019 +0200
Commit: Mike Kaganski 
CommitDate: Mon Jun 17 09:06:28 2019 +0200

Add vs2019-ide-integration

Change-Id: I14b7ebb3521f9a23fcf4c3ff907408327f189f29
Reviewed-on: https://gerrit.libreoffice.org/74138
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/Makefile.in b/Makefile.in
index 5423596012e0..ba4b60a58b84 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -472,6 +472,7 @@ endef
 $(foreach ide,\
codelite \
vs2017 \
+   vs2019 \
kdevelop \
vim \
qtcreator \
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index e012c08c0828..f1121efddabb 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -925,7 +925,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 }
 
 def retrieve_toolset(self, ide):
-ide_toolset_map = {'vs2017': 'v141'}
+ide_toolset_map = {'vs2017': 'v141', 'vs2019': 'v142'}
 return ide_toolset_map[ide]
 
 def module_make_command(self, targets):
@@ -1850,6 +1850,7 @@ if __name__ == '__main__':
 'kdevelop': KdevelopIntegrationGenerator,
 'xcode': XcodeIntegrationGenerator,
 'vs2017': VisualStudioIntegrationGenerator,
+'vs2019': VisualStudioIntegrationGenerator,
 'vim': VimIntegrationGenerator,
 'debug': DebugIntegrationGenerator,
 'qtcreator': QtCreatorIntegrationGenerator,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2019-06-07 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |   15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 92c03d9bf644b0f10de52ce0da09f97056e46247
Author: Michael Weghorn 
AuthorDate: Fri Jun 7 21:44:03 2019 +0200
Commit: Michael Weghorn 
CommitDate: Sat Jun 8 03:58:00 2019 +0200

qtcreator: Take over '-std=...' from CXXFLAGS

If the '-std=' compiler flag is set in CXXFLAGS,
take that over into the .pro files used by
Qt Creator.

This makes ClangCodeModel use the correct std version,
and e.g. know about 'std::string_view' if '-std=gnu++2a'
(or anything else indicating C++17 or higher is supported)
is used and thus avoids unnecessary errors/warnings from
being displayed.

Use a list, so other flags can easily be added later.
(It currently doesn't seem reasonable to me to just pass all
cxxflags though, since .pro files are currently only generated
per top-level module, while C++ flags can differ between
different targets in the same module).

Change-Id: Id3f3e2b9ba77e5220a17fd4796937c816979959a
Reviewed-on: https://gerrit.libreoffice.org/73677
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 1365c548c218..e012c08c0828 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1671,6 +1671,12 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 if ext:
 headers_list.append(lopath(file_ + ext))
 
+cxxflags_list = []
+for cxxflag in lib.cxxflags:
+# extract flag for C++ standard version
+if cxxflag.startswith('-std'):
+cxxflags_list.append(cxxflag)
+
 # List all include paths
 for hdir in (lib.include + lib.include_sys):
 hf_lopath = lopath(hdir)
@@ -1695,12 +1701,14 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 if lib_folder in self.data_libs:
 self.data_libs[lib_folder]['sources'] |= set(sources_list)
 self.data_libs[lib_folder]['headers'] |= set(headers_list)
+self.data_libs[lib_folder]['cxxflags'] |= set(cxxflags_list)
 self.data_libs[lib_folder]['includepath'] |= 
set(includepath_list)
 self.data_libs[lib_folder]['defines'] |= set(defines_list)
 else:
 self.data_libs[lib_folder] = {
 'sources': set(sources_list),
 'headers': set(headers_list),
+'cxxflags': set(cxxflags_list),
 'includepath': set(includepath_list),
 'defines': set(defines_list),
 'loc': lib.location,
@@ -1723,6 +1731,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 for lib_folder in subdirs_list:
 sources_list = sorted(self.data_libs[lib_folder]['sources'])
 headers_list = sorted(self.data_libs[lib_folder]['headers'])
+cxxflags_list = sorted(self.data_libs[lib_folder]['cxxflags'])
 includepath_list = 
sorted(self.data_libs[lib_folder]['includepath'])
 defines_list = sorted(self.data_libs[lib_folder]['defines'])
 lib_loc = self.data_libs[lib_folder]['loc']
@@ -1730,13 +1739,15 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 
 sources = " \\\n".join(sources_list)
 headers = " \\\n".join(headers_list)
+cxxflags = " \\\n".join(cxxflags_list)
 includepath = " \\\n".join(includepath_list)
 defines = " \\\n".join(defines_list)
 
 # create .pro file
 qt_pro_file = '%s/%s.pro' % (lib_loc, lib_name)
 try:
-content = QtCreatorIntegrationGenerator.pro_template % 
{'sources': sources, 'headers': headers, 'includepath': includepath, 'defines': 
defines}
+content = QtCreatorIntegrationGenerator.pro_template % 
{'sources': sources, 'headers': headers,
+
'cxxflags': cxxflags, 'includepath': includepath, 'defines': defines}
 mode = 'w+'
 with open(qt_pro_file, mode) as fpro:
 fpro.write(content)
@@ -1799,6 +1810,8 @@ CONFIG += console
 CONFIG -= app_bundle
 CONFIG -= qt
 
+QMAKE_CXXFLAGS += %(cxxflags)s
+
 INCLUDEPATH += %(includepath)s
 
 SOURCES += %(sources)s
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2019-02-14 Thread Libreoffice Gerrit user
 bin/gbuild-to-ide |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit f7ec0b0ac40045450bd86b73ca59b32a15bc8346
Author: Mike Kaganski 
AuthorDate: Thu Feb 14 11:40:24 2019 +0300
Commit: Mike Kaganski 
CommitDate: Thu Feb 14 11:50:12 2019 +0100

VisualStudioIntegrationGenerator: put CXXFLAGS to AdditionalOptions

Adding AdditionalOptions to nmake project settings allows IntelliSense
to know about used compiler switches; specifically, passing std switch
(currently -std:c++17) defines _MSVC_LANG macro [1] to proper value to
avoid false IntelliSense errors (e.g., for string_view).

[1] https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros

Change-Id: I90309e6bf2a87257a0c81b1406e678af962eb587
Reviewed-on: https://gerrit.libreoffice.org/67805
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 9ed964339c7f..1365c548c218 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1031,6 +1031,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 if not os.path.exists(folder):
 os.makedirs(folder)
 project_guid = str(uuid.uuid4()).upper()
+cxxflags = ' '.join(target.cxxflags)
 ns = 'http://schemas.microsoft.com/developer/msbuild/2003'
 ET.register_namespace('', ns)
 proj_node = ET.Element('{%s}Project' % ns, DefaultTargets='Build', 
ToolsVersion='4.0')
@@ -1100,6 +1101,8 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 nmake_defs_node.text = ';'.join(self.defs_list(target.defs) + 
['$(NMakePreprocessorDefinitions)'])
 include_path_node = ET.SubElement(conf_node, '{%s}IncludePath' % 
ns)
 include_path_node.text = include_path_node_text
+additional_options_node = ET.SubElement(conf_node, 
'{%s}AdditionalOptions' % ns)
+additional_options_node.text = cxxflags
 
 ET.SubElement(proj_node, '{%s}ItemDefinitionGroup' % ns)
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2019-01-25 Thread Libreoffice Gerrit user
 bin/gbuild-to-ide |  184 +-
 1 file changed, 183 insertions(+), 1 deletion(-)

New commits:
commit 9b90389acc2abbee87b598bd9e709d2a4f9715db
Author: Noel Grandin 
AuthorDate: Fri Jan 25 15:41:26 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 25 19:05:03 2019 +0100

add basic support for generating CodeLite IDE files

Change-Id: I70613baada4f82e5e56f9a21547733c3a6907b53
Reviewed-on: https://gerrit.libreoffice.org/66908
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 7d91829bedb8..9ed964339c7f 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -21,7 +21,7 @@ import xml.dom.minidom as minidom
 import traceback
 import subprocess
 from sys import platform
-
+import collections
 
 class GbuildLinkTarget:
 def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs):
@@ -78,6 +78,14 @@ class GbuildExe(GbuildLinkTarget):
 
 
 class GbuildParser:
+"""Main data model object.
+
+Attributes:
+target_by_path : dict[path:string, set(target)]
+   where target is one of the GbuildLinkTarget 
subclasses
+target_by_location : dict[path:string, set(target)]
+   where target is one of the GbuildLinkTarget 
subclasses
+"""
 def __init__(self, makecmd):
 self.makecmd = makecmd
 self.binpath = os.path.dirname(os.environ['GPERF']) # woha, this is 
quite a hack
@@ -325,6 +333,179 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 self.create_macros()
 self.create_settings_file() 
 
+class CodeliteIntegrationGenerator(IdeIntegrationGenerator):
+
+def __init__(self, gbuildparser, ide):
+IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
+
+def emit(self):
+self.create_workspace_file()
+for module in self.gbuildparser.modulenamelist:
+self.create_project_file(module)
+#self.create_project_file('vcl')
+
+def create_workspace_file(self):
+root_node = ET.Element('CodeLite_Workspace', Name='libo2', 
Database='./libo2.tags', Version='10.0.0')
+for module in self.gbuildparser.modulenamelist:
+ET.SubElement(root_node, 'Project', Name=module, 
Path='%s/%s.project' % (module, module), Active='No')
+build_matrix_node = ET.SubElement(root_node, 'BuildMatrix')
+workspace_config_node = ET.SubElement(build_matrix_node, 
'WorkspaceConfiguration', Name='Debug', Selected='yes')
+ET.SubElement(workspace_config_node, 'Environment')
+for module in self.gbuildparser.modulenamelist:
+ET.SubElement(workspace_config_node, 'Project', Name=module, 
ConfigName='Debug')
+workspace_config_node = ET.SubElement(build_matrix_node, 
'WorkspaceConfiguration', Name='Release', Selected='yes')
+ET.SubElement(workspace_config_node, 'Environment')
+for module in self.gbuildparser.modulenamelist:
+ET.SubElement(workspace_config_node, 'Project', Name=module, 
ConfigName='Release')
+
+self.write_pretty_xml(root_node, 
os.path.join(self.gbuildparser.builddir, 'libo2.workspace'))
+
+def create_project_file(self, module_name):
+root_node = ET.Element('CodeLite_Project', Name=module_name, 
InternalType='')
+ET.SubElement(root_node, 'Plugins')
+
+# add CXX files
+virtual_dirs = collections.defaultdict(set)
+for target_path in self.gbuildparser.target_by_path.keys():
+if target_path.startswith(module_name+'/'):
+for target in self.gbuildparser.target_by_path[target_path]:
+for file in target.cxxobjects:
+relative_file = '/'.join(file.split('/')[1:])
+path = '/'.join(file.split('/')[1:-1])
+virtual_dirs[path].add(relative_file + '.cxx')
+# add HXX files
+all_libs = set(self.gbuildparser.libs) | set(self.gbuildparser.exes)
+for lib in all_libs:
+if lib.name == module_name:
+for hdir in lib.include:
+# only want the module-internal ones
+if hdir.startswith(module_name+'/'):
+for hf in os.listdir(hdir):
+if hf.endswith(('.h', '.hxx', '.hpp', '.hrc')):
+path = '/'.join(hf.split('/')[1:-1])
+virtual_dirs[path].add(hf)
+# add HXX files from the root/include/** folders
+module_include = os.path.join(self.gbuildparser.builddir, 'include', 
module_name)
+if os.path.exists(module_include):
+for hf in os.listdir(module_include):
+if hf.endswith(('.h', '.hxx', '.hpp', '.hrc')):
+path = '../include/' + ('/'.join(hf.split('/')[1:-1]))
+  

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2018-12-13 Thread Libreoffice Gerrit user
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 72d50182f7ec73ffc05b51d4cf59b7fe9509f155
Author: Michael Weghorn 
AuthorDate: Thu Dec 13 22:19:08 2018 +0100
Commit: Michael Weghorn 
CommitDate: Thu Dec 13 23:28:49 2018 +0100

qtcreator: Take system includes into account

Take system includes ('-isystem') into account
when generating the '*.pro' files for Qt Creator
using the 'qtcreator-ide-integration' make target.

Without this, Qt Creator is unable to find the
corresponding included files.

This also makes Qt Creator's ClangCodeModel
able to properly process files and display
actual problems, rather than always showing
a multitude of errors due to missing includes
while parsing the source/header files.

Change-Id: Ie513341e1074ceab9304ae9df73fac9a79329db8
Reviewed-on: https://gerrit.libreoffice.org/65129
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 5ea0406be71f..7d91829bedb8 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1488,7 +1488,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 headers_list.append(lopath(file_ + ext))
 
 # List all include paths
-for hdir in lib.include:
+for hdir in (lib.include + lib.include_sys):
 hf_lopath = lopath(hdir)
 includepath_list.append(hf_lopath)
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2018-12-02 Thread Libreoffice Gerrit user
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1ee8d4f63adf3113a4733a479c8faf9eb65f7b8d
Author: Andrea Gelmini 
AuthorDate: Sun Dec 2 18:58:04 2018 +0100
Commit: Jens Carl 
CommitDate: Mon Dec 3 07:21:51 2018 +0100

Fix typo

Change-Id: I69e4d471c806159d6748016a79f041c01b40b888
Reviewed-on: https://gerrit.libreoffice.org/64430
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 14409b5490b9..5ea0406be71f 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1507,7 +1507,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 define += '=' + value
 defines_list.append(define)
 
-# All datas are prepared, store them for the lib.
+# All data are prepared, store them for the lib.
 if lib_folder in self.data_libs:
 self.data_libs[lib_folder]['sources'] |= set(sources_list)
 self.data_libs[lib_folder]['headers'] |= set(headers_list)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide Makefile.in

2018-08-30 Thread Libreoffice Gerrit user
 Makefile.in   |2 +-
 bin/gbuild-to-ide |6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 80d071f834b13c73b14335ed6298daf895aecdb3
Author: Mike Kaganski 
AuthorDate: Thu Aug 30 12:47:46 2018 +0300
Commit: Mike Kaganski 
CommitDate: Thu Aug 30 17:16:05 2018 +0200

Upgrade to vs2017-ide-integration, since we don't support VS2015 in master

This allows to avoid the "(Visual Studio 2015)" labels next to project
names in Solution Explorer; and also avoid multiple warnilgs like

project-name.vcxproj : warning  : The build tools for Visual Studio
2015 (v140) cannot be found. Install Visual Studio 2015 (v140) to
build using the Visual Studio 2015 (v140) build tools.

in IDE's Output pane in case VS2015 is absent locally.

Change-Id: I53b68ac810cbf2a31667c35dd549310e7209e010
Reviewed-on: https://gerrit.libreoffice.org/59797
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/Makefile.in b/Makefile.in
index 8cc9357666b9..324e0af03026 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -478,7 +478,7 @@ endef
 
 $(foreach ide,\
codelite \
-   vs2015 \
+   vs2017 \
kdevelop \
vim \
qtcreator \
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 9ac6949ffec8..14409b5490b9 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -744,7 +744,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 }
 
 def retrieve_toolset(self, ide):
-ide_toolset_map = {'vs2015': 'v140'}
+ide_toolset_map = {'vs2017': 'v141'}
 return ide_toolset_map[ide]
 
 def module_make_command(self, targets):
@@ -879,7 +879,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 # Type of project used by the MSBuild to determine build process, 
see Microsoft.Makefile.targets
 conf_type_node = ET.SubElement(conf_node, '{%s}ConfigurationType' 
% ns)
 conf_type_node.text = 'Makefile'
-# VS2012: I need to have this otherwise the names of projects will 
contain text Visual Studio 2010 in the Solution Explorer
+# This defines the version of Visual Studio which can show next to 
project names in the Solution Explorer
 platform_toolset_node = ET.SubElement(conf_node, 
'{%s}PlatformToolset' % ns)
 platform_toolset_node.text = self.toolset
 
@@ -1651,7 +1651,7 @@ if __name__ == '__main__':
 'eclipsecdt': EclipseCDTIntegrationGenerator,
 'kdevelop': KdevelopIntegrationGenerator,
 'xcode': XcodeIntegrationGenerator,
-'vs2015': VisualStudioIntegrationGenerator,
+'vs2017': VisualStudioIntegrationGenerator,
 'vim': VimIntegrationGenerator,
 'debug': DebugIntegrationGenerator,
 'qtcreator': QtCreatorIntegrationGenerator,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2018-08-29 Thread Libreoffice Gerrit user
 bin/gbuild-to-ide |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit b0e74b65a86eb965c3e93da2fb77972cc5445f3c
Author: Miklos Vajna 
AuthorDate: Wed Aug 29 09:13:03 2018 +0200
Commit: Miklos Vajna 
CommitDate: Wed Aug 29 11:25:04 2018 +0200

vim-ide-integration: remove no longer needed workaround

Fixes the problem that e.g. this code:

OUString str;
str += "";

is marked as a compile error, when clang would still work with c++11,
but the tree is configured for gnu++17.

Change-Id: Id60c0cf4b8c693b534f16ba813cf01a4bad7e560
Reviewed-on: https://gerrit.libreoffice.org/59746
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index b016bfe02a0c..9ac6949ffec8 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -378,9 +378,6 @@ class VimIntegrationGenerator(IdeIntegrationGenerator):
 command += cxxflag
 command += ' -c '
 command += file
-# Help clang when the tree is configured for gcc.
-for gnu in ('-std=gnu++11', '-std=gnu++1y', '-std=gnu++17'):
-command = command.replace(gnu, '-std=c++11')
 return command
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2018-07-08 Thread Markus Mohrhard
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9d7166b448198875bdff43d7054d0f5914e675de
Author: Markus Mohrhard 
Date:   Mon Jul 9 00:54:02 2018 +0200

fix compile_commands.json when generated with modern gcc

Change-Id: I4a17cfb567f5ebec8bb416b9aa4d58763ff36c36

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 90a732d7c614..b016bfe02a0c 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -379,7 +379,7 @@ class VimIntegrationGenerator(IdeIntegrationGenerator):
 command += ' -c '
 command += file
 # Help clang when the tree is configured for gcc.
-for gnu in ('-std=gnu++11', '-std=gnu++1y'):
+for gnu in ('-std=gnu++11', '-std=gnu++1y', '-std=gnu++17'):
 command = command.replace(gnu, '-std=c++11')
 return command
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2018-05-02 Thread Mike Kaganski
 bin/gbuild-to-ide |   15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit ea1f50894ac3e681213b874af08217ae25d0433a
Author: Mike Kaganski 
Date:   Wed May 2 13:29:21 2018 +0100

VS IDE integration: use full Windows include paths in VS projects

It turns out that VS IDE's "Peek definition" (and other functions that
navigate to sources) fail if the short ("DOS") path to the file is given
in project's includes: see issue at

https://developercommunity.visualstudio.com/content/problem/139659/vc-peek-definition-fails-to-navigate-to-windows-ki.html

This patch converts the include paths to full Windows paths, to avoid the
problem. Also, since IDE starts working correctly with this change, this
patch removes inclusion of "inherited" paths "$(IncludePath)", which are
the paths added by Visual Studio itself. Since we do specify all include
paths explicitly, that is not required, and avoids confusion.

Change-Id: Ide2d948f8c7b050b02f550342144fede4fcafb82
Reviewed-on: https://gerrit.libreoffice.org/53731
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 8507de280d83..90a732d7c614 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -19,6 +19,8 @@ import json
 import xml.etree.ElementTree as ET
 import xml.dom.minidom as minidom
 import traceback
+import subprocess
+from sys import platform
 
 
 class GbuildLinkTarget:
@@ -828,6 +830,13 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 print('')
 
 @staticmethod
+def to_long_names(shortnames):
+if platform == "cygwin":
+return (subprocess.check_output(["cygpath", "-wal"] + 
shortnames).decode("utf-8", "strict").rstrip()).split("\n")
+else:
+return shortnames
+
+@staticmethod
 def defs_list(defs):
 defines_list = []
 # List defines
@@ -888,6 +897,10 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
   Label='LocalAppDataPlatform')
 
 ET.SubElement(proj_node, '{%s}PropertyGroup' % ns, Label='UserMacros')
+# VS IDE (at least "Peek definition") is allergic to paths like 
"C:/PROGRA~2/WI3CF2~1/10/Include/10.0.14393.0/um"; see
+# 
https://developercommunity.visualstudio.com/content/problem/139659/vc-peek-definition-fails-to-navigate-to-windows-ki.html
+# We need to convert to long paths here. Do this once, since it's 
time-consuming operation.
+include_path_node_text = ';'.join(self.to_long_names(target.include))
 for cfg_name, cfg_targets in self.configurations.items():
 conf_node = ET.SubElement(proj_node, '{%s}PropertyGroup' % ns,
   
Condition="'$(Configuration)|$(Platform)'=='%s|%s'" % (cfg_name, platform))
@@ -908,7 +921,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 nmake_defs_node = ET.SubElement(conf_node, 
'{%s}NMakePreprocessorDefinitions' % ns)
 nmake_defs_node.text = ';'.join(self.defs_list(target.defs) + 
['$(NMakePreprocessorDefinitions)'])
 include_path_node = ET.SubElement(conf_node, '{%s}IncludePath' % 
ns)
-include_path_node.text = ';'.join(target.include + 
['$(IncludePath)'])
+include_path_node.text = include_path_node_text
 
 ET.SubElement(proj_node, '{%s}ItemDefinitionGroup' % ns)
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2018-03-21 Thread Mike Kaganski
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 234d0368c823eb1a74e973e051ac522e6b86e833
Author: Mike Kaganski 
Date:   Wed Mar 21 09:03:59 2018 +0100

Don't generate filters with empty Includes

Avoids VS warnings:

> smoketest\Library_smoketest.vcxproj.filters : warning  : Unable to
> read the filters file "Library_smoketest.vcxproj.filters". Please
> unload the project "Library_smoketest.vcxproj" to be able to edit it.
> The required attribute "Include" is empty or missing from the element
> .

Change-Id: I0f02e837823a5e7a0355fd0f895f00c63a5df6fc
Reviewed-on: https://gerrit.libreoffice.org/51684
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 48d1a760c781..8507de280d83 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -945,7 +945,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 
 def get_subfilters(self, proj_filter):
 parts = proj_filter.split('\\')
-subfilters = set([proj_filter])
+subfilters = set([proj_filter]) if proj_filter else set()
 for i in range(1, len(parts)):
 subfilters.add('\\'.join(parts[:i]))
 return subfilters
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2018-01-16 Thread Mike Kaganski
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 688b16df55afa1920f007b5bbe52c24f431c4ac2
Author: Mike Kaganski 
Date:   Wed Jan 17 05:40:54 2018 +0100

VS generator: set output to soffice.bin to allow starting from debugger

It is more likely that soffice.bit should be debugged, not soffice.exe
stub. This allows to start debug session from VisualStudio, and debug
startup code.

Change-Id: Iab4615c67aeb25b811ecc71f6ae48aa9b40c45dc
Reviewed-on: https://gerrit.libreoffice.org/48025
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 35fefd110e0b..48d1a760c781 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -904,7 +904,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 nmake_rebuild_node = ET.SubElement(conf_node, 
'{%s}NMakeReBuildCommandLine' % ns)
 nmake_rebuild_node.text = cfg_targets['rebuild'] % nmake_params
 nmake_output_node = ET.SubElement(conf_node, '{%s}NMakeOutput' % 
ns)
-nmake_output_node.text = os.path.join(self.gbuildparser.instdir, 
'program', 'soffice.exe')
+nmake_output_node.text = os.path.join(self.gbuildparser.instdir, 
'program', 'soffice.bin')
 nmake_defs_node = ET.SubElement(conf_node, 
'{%s}NMakePreprocessorDefinitions' % ns)
 nmake_defs_node.text = ';'.join(self.defs_list(target.defs) + 
['$(NMakePreprocessorDefinitions)'])
 include_path_node = ET.SubElement(conf_node, '{%s}IncludePath' % 
ns)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-11-23 Thread Miklos Vajna
 bin/gbuild-to-ide |4 
 1 file changed, 4 deletions(-)

New commits:
commit f85859d2146b29ed4dce17695efd4012a0fa1e1c
Author: Miklos Vajna 
Date:   Thu Nov 23 09:07:47 2017 +0100

vim-ide-integration: -I workaround is no longer needed

Since commit ecbaf980625a9e7b06abe91c7c70e78f6ad469a7 (-I$(dir $(3)) in
gb_CObject__command_pattern is no longer needed, 2017-11-01).

Change-Id: I9d6b7436f7b6e865d37e358adb9cf075e4e51bff

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index abf7c7c572bb..35fefd110e0b 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -365,10 +365,6 @@ class VimIntegrationGenerator(IdeIntegrationGenerator):
 command += '='
 command += value
 
-# The directory of the file is missing from lib's include list, as that
-# one is not the same for all source files in the lib.
-command += ' -I' + os.path.dirname(file)
-
 for include in lib.include:
 command += ' -I'
 command += include
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide bin/gbuild-to-ideNS

2017-10-27 Thread Mike Kaganski
 bin/gbuild-to-ide   |   13 -
 bin/gbuild-to-ideNS |   13 -
 2 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit 9be47276cdd6a59647f6aa42d2cd35f05c51a16b
Author: Mike Kaganski 
Date:   Fri Oct 27 09:29:36 2017 +0300

VisualStudioIntegrationGenerator: honor defines' values

Before this, -D_WIN32_WINNT=0x0601 used to land to VS project simply
as _WIN32_WINNT (without value).

Change-Id: I68ebdc24c3181c5d9e046280756e4cefee3de46c
Reviewed-on: https://gerrit.libreoffice.org/43928
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index d50801c3e6ca..4f6a94058fab 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -925,6 +925,17 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 f.write('\tEndGlobalSection\n')
 f.write('EndGlobal\n')
 
+@staticmethod
+def defs_list(defs):
+defines_list = []
+# List defines
+for key, value in defs.items():
+define = key
+if value is not None:
+define += '=' + value
+defines_list.append(define)
+return defines_list
+
 def write_project(self, project_path, target):
 # See info at 
http://blogs.msdn.com/b/visualstudio/archive/2010/05/14/a-guide-to-vcxproj-and-props-file-structure.aspx
 folder = os.path.dirname(project_path)
@@ -993,7 +1004,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 nmake_output_node = ET.SubElement(conf_node, '{%s}NMakeOutput' % 
ns)
 nmake_output_node.text = os.path.join('../..', 'program', 
'soffice.exe')
 nmake_defs_node = ET.SubElement(conf_node, 
'{%s}NMakePreprocessorDefinitions' % ns)
-nmake_defs_node.text = ';'.join(list(target['DEFS']) + 
['$(NMakePreprocessorDefinitions)'])
+nmake_defs_node.text = ';'.join(self.defs_list(target['DEFS']) + 
['$(NMakePreprocessorDefinitions)'])
 include_path_node = ET.SubElement(conf_node, '{%s}IncludePath' % 
ns)
 includes = [os.path.join('../..', elem) if elem[1] != ':'  else 
elem for elem in target['include']]
 include_path_node.text = ';'.join(includes + ['$(IncludePath)'])
diff --git a/bin/gbuild-to-ideNS b/bin/gbuild-to-ideNS
index 5fca58cf227d..abf7c7c572bb 100755
--- a/bin/gbuild-to-ideNS
+++ b/bin/gbuild-to-ideNS
@@ -831,6 +831,17 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 f.write('EndGlobal\n')
 print('')
 
+@staticmethod
+def defs_list(defs):
+defines_list = []
+# List defines
+for key, value in defs.items():
+define = key
+if value is not None:
+define += '=' + value
+defines_list.append(define)
+return defines_list
+
 def write_project(self, project_path, target):
 # See info at 
http://blogs.msdn.com/b/visualstudio/archive/2010/05/14/a-guide-to-vcxproj-and-props-file-structure.aspx
 folder = os.path.dirname(project_path)
@@ -899,7 +910,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 nmake_output_node = ET.SubElement(conf_node, '{%s}NMakeOutput' % 
ns)
 nmake_output_node.text = os.path.join(self.gbuildparser.instdir, 
'program', 'soffice.exe')
 nmake_defs_node = ET.SubElement(conf_node, 
'{%s}NMakePreprocessorDefinitions' % ns)
-nmake_defs_node.text = ';'.join(list(target.defs) + 
['$(NMakePreprocessorDefinitions)'])
+nmake_defs_node.text = ';'.join(self.defs_list(target.defs) + 
['$(NMakePreprocessorDefinitions)'])
 include_path_node = ET.SubElement(conf_node, '{%s}IncludePath' % 
ns)
 include_path_node.text = ';'.join(target.include + 
['$(IncludePath)'])
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide bin/gbuild-to-ideNS solenv/vs

2017-07-05 Thread Mike Kaganski
 bin/gbuild-to-ide|   10 ++
 bin/gbuild-to-ideNS  |5 +
 solenv/vs/LibreOffice.natvis |  161 +++
 3 files changed, 176 insertions(+)

New commits:
commit 96dec6af8fbc7f46f2032a227c47370256b7d5a9
Author: Mike Kaganski 
Date:   Tue Jul 4 20:08:49 2017 +0300

gbuild-to-ide: add VisualStudio visualizers file to solution

See https://msdn.microsoft.com/en-us/library/jj620914

Change-Id: Ibd18f1c36c46ea47c897542f35e3ea2a8bc0a8ac
Reviewed-on: https://gerrit.libreoffice.org/39510
Reviewed-by: Markus Mohrhard 
Tested-by: Jenkins 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index ffa85d3a42e4..0ff7579e1c84 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -291,6 +291,11 @@ class testVS2013Ide(IdeIntegrationGenerator):
 f.write('\t\t{%(guid)s} = {%(guid)s}\n' % {'guid': 
lib_guid})
 f.write('\tEndProjectSection\n')
 f.write('EndProject\n')
+f.write('Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = 
"Solution Items", "Solution Items", "{B9292527-A979-4D13-A598-C75A33222174}"\n')
+f.write('\tProjectSection(SolutionItems) = preProject\n')
+f.write('\t\tsolenv/vs/LibreOffice.natvis = 
solenv/vs/LibreOffice.natvis\n')
+f.write('\tEndProjectSection\n')
+f.write('EndProject\n')
 f.write('Global\n')
 platform = 'Win32'
 f.write('\tGlobalSection(SolutionConfigurationPlatforms) = 
preSolution\n')
@@ -893,6 +898,11 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 f.write('\t\t{%(guid)s} = {%(guid)s}\n' % {'guid': 
lib_guid})
 f.write('\tEndProjectSection\n')
 f.write('EndProject\n')
+f.write('Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = 
"Solution Items", "Solution Items", "{B9292527-A979-4D13-A598-C75A33222174}"\n')
+f.write('\tProjectSection(SolutionItems) = preProject\n')
+f.write('\t\tsolenv/vs/LibreOffice.natvis = 
solenv/vs/LibreOffice.natvis\n')
+f.write('\tEndProjectSection\n')
+f.write('EndProject\n')
 f.write('Global\n')
 platform = 'Win32'
 f.write('\tGlobalSection(SolutionConfigurationPlatforms) = 
preSolution\n')
diff --git a/bin/gbuild-to-ideNS b/bin/gbuild-to-ideNS
index 38785312055b..44970c466b77 100755
--- a/bin/gbuild-to-ideNS
+++ b/bin/gbuild-to-ideNS
@@ -803,6 +803,11 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 f.write('\t\t{%(guid)s} = {%(guid)s}\n' % {'guid': 
lib_guid})
 f.write('\tEndProjectSection\n')
 f.write('EndProject\n')
+f.write('Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = 
"Solution Items", "Solution Items", "{B9292527-A979-4D13-A598-C75A33222174}"\n')
+f.write('\tProjectSection(SolutionItems) = preProject\n')
+f.write('\t\tsolenv/vs/LibreOffice.natvis = 
solenv/vs/LibreOffice.natvis\n')
+f.write('\tEndProjectSection\n')
+f.write('EndProject\n')
 f.write('Global\n')
 platform = 'Win32'
 f.write('\tGlobalSection(SolutionConfigurationPlatforms) = 
preSolution\n')
diff --git a/solenv/vs/LibreOffice.natvis b/solenv/vs/LibreOffice.natvis
new file mode 100644
index ..3326c1fcfd9c
--- /dev/null
+++ b/solenv/vs/LibreOffice.natvis
@@ -0,0 +1,161 @@
+
+
+http://schemas.microsoft.com/vstudio/debugger/natvis/2010;>
+  
+{*pData}
+*pData,su
+  
+  
+{*pData}
+*pData,s
+  
+  
+empty
+{buffer,su}
+buffer,su
+  
+  
+empty
+{buffer,s}
+buffer,s
+  
+  
+
+{pType->eTypeClass,en}: 
{*((wchar_t*)pData),c}
+{pType->eTypeClass,en}: 
{*((bool*)pData),d}
+{pType->eTypeClass,en}: 
{*((unsigned char*)pData),d}
+{pType->eTypeClass,en}: 
{(*((short*)pData)  0x),d}
+{pType->eTypeClass,en}: 
{(*((unsigned short*)pData)  0x),d}
+{pType->eTypeClass,en}: 
{*((int*)pData),d}
+{pType->eTypeClass,en}: 
{*((unsigned int*)pData),d}
+{pType->eTypeClass,en}: 
{*((__int64*)pData),d}
+{pType->eTypeClass,en}: 
{*((unsigned __int64*)pData),d}
+{pType->eTypeClass,en}: 
{*((float*)pData)}
+{pType->eTypeClass,en}: 
{*((double*)pData)}
+{pType->eTypeClass,en}: 
{*((rtl::OUString*)pData)}
+{pType->eTypeClass,en}: 
{*((com::sun::star::uno::Type*)pData)}
+{pType->eTypeClass,en}: 
{*((sal_Int32*)pData),d}
+{pType->eTypeClass,en}: 
{*((uno_Sequence **)pData)}
+{pType->eTypeClass,en}: 
{*((com::sun::star::uno::BaseReference *)pData)}
+{pType->eTypeClass,en}
+
+  *((com::sun::star::uno::BaseReference *)pData)
+  pData
+
+  
+  
+{mfValue[0]}, {mfValue[1]}, {mfValue[2]}
+  
+  
+

[Libreoffice-commits] core.git: bin/gbuild-to-ide bin/gbuild-to-ideNS Makefile.in

2017-06-28 Thread Michael Stahl
 Makefile.in |1 -
 bin/gbuild-to-ide   |5 ++---
 bin/gbuild-to-ideNS |3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 374c0e325cbbdd500b1a2b4c26ce3555682311b8
Author: Michael Stahl 
Date:   Wed Jun 28 13:28:48 2017 +0200

remove "vs2013" from gbuild-to-ide

Too old to build master.

Change-Id: I01636c9ae26ddb3954dcfdd1977551c0f115a81b

diff --git a/Makefile.in b/Makefile.in
index 5e0de0555878..5bbbe1682e14 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -466,7 +466,6 @@ $(eval $(call gb_Top_GbuildToIdeIntegration,$(ide
 
 $(foreach ide,\
codelite \
-   vs2013 \
vs2015 \
kdevelop \
vim \
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 1cc449a28f76..ffa85d3a42e4 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -216,7 +216,7 @@ class testVS2013Ide(IdeIntegrationGenerator):
 pass
 
 def retrieve_toolset(self):
-return {'vs2013': 'v120', 'vs2015': 'v140', 
'testIde':'v120'}.get(self.ide, None)
+return {'vs2015': 'v140', 'testIde':'v120'}.get(self.ide, None)
 
 def module_make_command(self, targets):
 return '%(sh)s -c "PATH=\\"/bin:$PATH\\";BUILDDIR=\\"%(builddir)s\\" 
%(makecmd)s -rsC %(location)s ' + targets + '"'
@@ -838,7 +838,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 }
 
 def retrieve_toolset(self):
-return {'vs2013': 'v120', 'vs2015': 'v140'}.get(self.ide, None)
+return {'vs2015': 'v140'}.get(self.ide, None)
 
 def module_make_command(self, targets):
 return '%(sh)s -c "PATH=\\"/bin:$PATH\\";BUILDDIR=\\"%(builddir)s\\" 
%(makecmd)s -rsC %(location)s ' + targets + '"'
@@ -2183,7 +2183,6 @@ if __name__ == '__main__':
 paths = {}
 generators = {
 # Supported platforms
-'vs2013': VisualStudioIntegrationGenerator,
 'xcode': XcodeIntegrationGenerator,
 'debug': DebugIntegrationGenerator,
 'testIde': testVS2013Ide,
diff --git a/bin/gbuild-to-ideNS b/bin/gbuild-to-ideNS
index 128d5d5180ef..38785312055b 100755
--- a/bin/gbuild-to-ideNS
+++ b/bin/gbuild-to-ideNS
@@ -744,7 +744,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 }
 
 def retrieve_toolset(self, ide):
-ide_toolset_map = {'vs2013': 'v120', 'vs2015': 'v140'}
+ide_toolset_map = {'vs2015': 'v140'}
 return ide_toolset_map[ide]
 
 def module_make_command(self, targets):
@@ -1624,7 +1624,6 @@ if __name__ == '__main__':
 'eclipsecdt': EclipseCDTIntegrationGenerator,
 'kdevelop': KdevelopIntegrationGenerator,
 'xcode': XcodeIntegrationGenerator,
-'vs2013': VisualStudioIntegrationGenerator,
 'vs2015': VisualStudioIntegrationGenerator,
 'vim': VimIntegrationGenerator,
 'debug': DebugIntegrationGenerator,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-03-12 Thread Gian Domenico Ceccarini
 bin/gbuild-to-ide |   45 +++--
 1 file changed, 23 insertions(+), 22 deletions(-)

New commits:
commit b9c1eb5d929061570c95f7438471e6c07097f40e
Author: Gian Domenico Ceccarini 
Date:   Sat Mar 11 15:51:13 2017 +0100

solution ProjectIDE-vs2013: Generate.5: only 1 .vcxproj and .filter pr 
module

change for cicle to generate only one .vcxproj and .filter pr module

Change-Id: I93f2279e368e11ef5b9d442c6dcdfa4bf39bd6c2
Reviewed-on: https://gerrit.libreoffice.org/35075
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index a123216..1cc449a 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -236,14 +236,11 @@ class testVS2013Ide(IdeIntegrationGenerator):
 projects = []
 module_directory = os.path.join(self.solution_directory, module)
 if module != 'include':  # FIXME
+project_path = os.path.join(module_directory, '%s.vcxproj' % 
module)
+project_guid = self.twrite_project(project_path, module)
+self.write_filters(project_path + '.filters', module, 
self.gbuildparser.modules[module]['headers'])
 for target in self.gbuildparser.modules[module]['targets']:
-
-project_path = os.path.join(module_directory, '%s.vcxproj' 
% target['target_name'])
-
-project_guid = self.twrite_project(project_path, target)
-#self.twrite_project(project_path,target)
-p = VisualStudioIntegrationGenerator.Project(project_guid, 
target, project_path)
-self.write_filters(project_path + 
'.filters',target,self.gbuildparser.modules[module]['headers'])
+p = self.Project(project_guid, target, project_path)
 projects.append(p)
 self.write_solution(os.path.join(module_directory, '%s.sln' % 
module), projects)
 all_projects += projects
@@ -418,7 +415,7 @@ class testVS2013Ide(IdeIntegrationGenerator):
 return project_guid
 
 
-def twrite_project(self, project_path, target):
+def twrite_project(self, project_path, module):
 folder = os.path.dirname(project_path)
 if not os.path.exists(folder):
 os.makedirs(folder)
@@ -442,7 +439,7 @@ class testVS2013Ide(IdeIntegrationGenerator):
 proj_guid_node = ET.SubElement(globals_node, '{%s}ProjectGuid' % ns)
 proj_guid_node.text = '{%s}' % project_guid
 proj_root_namespace=ET.SubElement(globals_node, '{%s}RootNamespace' % 
ns)
-proj_root_namespace.text = target['target_name']
+proj_root_namespace.text = module
 
 
 ET.SubElement(proj_node, '{%s}Import' % ns, 
Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props')
@@ -475,10 +472,12 @@ class testVS2013Ide(IdeIntegrationGenerator):
 opt_node.text='Disabled'
 sdl_check=ET.SubElement(cl_compile,'{%s}SDLCheck' % ns)
 sdl_check.text='true'
-
add_incl_dir=ET.SubElement(cl_compile,'{%s}AdditionalIncludeDirectories' % ns)
-add_incl_dir.text=self.get_include_dirs(target)
-add_incl_def_flag=ET.SubElement(cl_compile,'{%s}AdditionalOptions' 
% ns)
-add_incl_def_flag.text=self.get_flags_defs(target)
+for target in self.gbuildparser.modules[module]['targets']:
+
add_incl_dir=ET.SubElement(cl_compile,'{%s}AdditionalIncludeDirectories' % ns)
+add_incl_dir.text=self.get_include_dirs(target)
+
add_incl_def_flag=ET.SubElement(cl_compile,'{%s}AdditionalOptions' % ns)
+add_incl_def_flag.text=self.get_flags_defs(target)
+
 
dgb_info_form=ET.SubElement(cl_compile,'{%s}DebugInformationFormat' % ns)
 dgb_info_form.text='ProgramDatabase'
 warn_as_error=ET.SubElement(cl_compile,'{%s}TreatWarningAsError' % 
ns)
@@ -504,9 +503,10 @@ class testVS2013Ide(IdeIntegrationGenerator):
 
 #cxx files
 cxx_node=ET.SubElement(proj_node,'{%s}ItemGroup' % ns)
-for cxx_elem in target['CXXOBJECTS']:
-modulename=target['module']
-cxx_cl_node=ET.SubElement(cxx_node,'{%s}ClCompile' % 
ns,Include=os.path.join('../..', modulename, cxx_elem))
+for target in self.gbuildparser.modules[module]['targets']:
+for cxx_elem in target['CXXOBJECTS']:
+modulename=target['module']
+cxx_cl_node=ET.SubElement(cxx_node,'{%s}ClCompile' % 
ns,Include=os.path.join('../..', modulename, cxx_elem))
 #miss headers
 ET.SubElement(proj_node, '{%s}Import' % ns, 
Project='$(VCTargetsPath)\Microsoft.Cpp.targets')
 ET.SubElement(proj_node, '{%s}ImportGroup' % ns, 
Label='ExtensionTargets')
@@ -541,7 +541,7 @@ class testVS2013Ide(IdeIntegrationGenerator):
 with 

[Libreoffice-commits] core.git: bin/gbuild-to-ide windows/README windows/soffice.sln windows/soffice.vcxproj

2017-03-02 Thread Federico Bassini
 bin/gbuild-to-ide   |   28 ++--
 windows/README  |3 -
 windows/soffice.sln |   18 --
 windows/soffice.vcxproj |   84 
 4 files changed, 12 insertions(+), 121 deletions(-)

New commits:
commit d0cc5fcd5bacd8e5e0fa7fe62a78907c2febb867
Author: Federico Bassini 
Date:   Wed Mar 1 09:39:55 2017 +0100

gbuild-to-ide: fix testide problem

this patch fix some problem in the class testVS2013Ide:
fix some tag xml bad generated, i test the project pocheck
and it compiles.

Change-Id: I5a4e3e71286a486e03ecbe936fb848e589ff71c9
Reviewed-on: https://gerrit.libreoffice.org/34739
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 70b398d..a123216 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -197,20 +197,15 @@ class testVS2013Ide(IdeIntegrationGenerator):
 self.toolset = self.retrieve_toolset()
 self.solution_directory = './windows'
 self.configurations = {
-'Build': {
+'Release': {
 'build': self.module_make_command('%(target)s'),
 'clean': self.module_make_command('%(target)s.clean'),
 'rebuild': self.module_make_command('%(target)s.clean 
%(target)s')
 },
-'Unit Tests': {
+'Debug': {
 'build': self.module_make_command('unitcheck'),
 'clean': self.module_make_command('clean'),
 'rebuild': self.module_make_command('clean unitcheck'),
-},
-'Integration tests': {
-'build': self.module_make_command('unitcheck slowcheck 
screenshot subsequentcheck'),
-'clean': self.module_make_command('clean'),
-'rebuild': self.module_make_command('clean unitcheck slowcheck 
screenshot subsequentcheck')
 }
 }
 srcdir=self.gbuildparser.get_json_srcdir()
@@ -221,7 +216,7 @@ class testVS2013Ide(IdeIntegrationGenerator):
 pass
 
 def retrieve_toolset(self):
-return {'vs2013': 'v120', 'vs2015': 'v140'}.get(self.ide, None)
+return {'vs2013': 'v120', 'vs2015': 'v140', 
'testIde':'v120'}.get(self.ide, None)
 
 def module_make_command(self, targets):
 return '%(sh)s -c "PATH=\\"/bin:$PATH\\";BUILDDIR=\\"%(builddir)s\\" 
%(makecmd)s -rsC %(location)s ' + targets + '"'
@@ -442,12 +437,12 @@ class testVS2013Ide(IdeIntegrationGenerator):
 conf_node.text = configuration
 platform_node = ET.SubElement(proj_conf_node, '{%s}Platform' % ns)
 platform_node.text = platform
-#globals
-globals_node = ET.SubElement(proj_node, '{%s}PropertyGroup' % ns, 
Label='Globals')
-proj_guid_node = ET.SubElement(globals_node, '{%s}ProjectGuid' % 
ns)
-proj_guid_node.text = '{%s}' % project_guid
-proj_root_namespace=ET.SubElement(globals_node, 
'{%s}RootNamespace' % ns)
-proj_root_namespace.text = target['target_name']
+#globals
+globals_node = ET.SubElement(proj_node, '{%s}PropertyGroup' % ns, 
Label='Globals')
+proj_guid_node = ET.SubElement(globals_node, '{%s}ProjectGuid' % ns)
+proj_guid_node.text = '{%s}' % project_guid
+proj_root_namespace=ET.SubElement(globals_node, '{%s}RootNamespace' % 
ns)
+proj_root_namespace.text = target['target_name']
 
 
 ET.SubElement(proj_node, '{%s}Import' % ns, 
Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props')
@@ -475,7 +470,7 @@ class testVS2013Ide(IdeIntegrationGenerator):
 #compiler options
 cl_compile=ET.SubElement(item_def_group,'{%s}ClCompile' % ns)
 warn_lvl=ET.SubElement(cl_compile,'{%s}WarningLevel' % ns)
-warn_lvl.text='Level 4'
+warn_lvl.text='Level4'
 opt_node=ET.SubElement(cl_compile,'{%s}Optimization' % ns)
 opt_node.text='Disabled'
 sdl_check=ET.SubElement(cl_compile,'{%s}SDLCheck' % ns)
@@ -510,7 +505,8 @@ class testVS2013Ide(IdeIntegrationGenerator):
 #cxx files
 cxx_node=ET.SubElement(proj_node,'{%s}ItemGroup' % ns)
 for cxx_elem in target['CXXOBJECTS']:
-cxx_cl_node=ET.SubElement(cxx_node,'{%s}ClCompile' % 
ns,Include='../../' + cxx_elem)
+modulename=target['module']
+cxx_cl_node=ET.SubElement(cxx_node,'{%s}ClCompile' % 
ns,Include=os.path.join('../..', modulename, cxx_elem))
 #miss headers
 ET.SubElement(proj_node, '{%s}Import' % ns, 
Project='$(VCTargetsPath)\Microsoft.Cpp.targets')
 ET.SubElement(proj_node, '{%s}ImportGroup' % ns, 
Label='ExtensionTargets')
diff --git a/windows/README b/windows/README
deleted file mode 100644
index 3287a74..000
--- a/windows/README
+++ /dev/null
@@ -1,3 +0,0 @@
-This is 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-03-02 Thread Federico Bassini
 bin/gbuild-to-ide |   35 +--
 1 file changed, 33 insertions(+), 2 deletions(-)

New commits:
commit 70f520b19f3423ed2ae41c85bb5f220eb4336e03
Author: Federico Bassini 
Date:   Wed Mar 1 13:27:27 2017 +0100

gbuild-to-ide: testVS2013Ide .props

this patch add a PropertySheet.props in the windows directory
in this file can put the enviroment variables
for vs2013.

i add in the gbuildparser a variable _jsonsrcdir that
contains the SRCDIR path that it can found in the json file.

with this file we can use enviroment variables of LO.
e.g.: $(SRCDIR), $(BUILDDIR) etc...
in the VS2013 ide.

Change-Id: Ie3158fd31fe247833115d445553f613dcd1a3b1d
Reviewed-on: https://gerrit.libreoffice.org/34749
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 7dd6142..70b398d 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -32,6 +32,7 @@ class GbuildParser:
 
os.environ['INSTDIR'], os.environ['WORKDIR'])
 self.modules = collections.OrderedDict()
 
+
 _includepattern = re.compile('-I(\S+)')
 _isystempattern = re.compile('-isystem\s*(\S+)')
 _warningpattern = re.compile('-W\S+')
@@ -39,7 +40,9 @@ class GbuildParser:
  'Executable': re.compile('Executable_(.*)\.mk'),
  'CppunitTest': re.compile('CppunitTest_(.*)\.mk')}
 _allheaders=[]
-
+_jsonsrcdir=''
+def get_json_srcdir(self):
+return self._jsonsrcdir
 def __split_includes(json_srcdir,includes):
 foundisystem = GbuildParser._isystempattern.findall(includes)
 foundincludes=[]
@@ -106,6 +109,7 @@ class GbuildParser:
 
 moduleDict = {}
 self.find_all_headers()
+
 for jsontype in ['Library', 'Executable', 'CppunitTest']:
 for jsonfilename in os.listdir(os.path.join(self.workdir, 
'GbuildToJson', jsontype)):
 with open(os.path.join(self.workdir, 'GbuildToJson', jsontype, 
jsonfilename), 'r') as f:
@@ -135,7 +139,7 @@ class GbuildParser:
 moduleDict[module] = {'targets': [],'headers':{}}
 moduleDict[module]['targets'].append(jsondata)
 moduleDict[module]['headers'] =self.headers_of(module)
-
+self._jsonsrcdir=json_srcdir
 moduleDict['include']={ 'targets': [], 
'headers':self.headers_of('include')}
 
 for i in sorted(moduleDict):
@@ -209,6 +213,12 @@ class testVS2013Ide(IdeIntegrationGenerator):
 'rebuild': self.module_make_command('clean unitcheck slowcheck 
screenshot subsequentcheck')
 }
 }
+srcdir=self.gbuildparser.get_json_srcdir()
+self.env_variables={
+'SRCDIR': 
srcdir,'BUILDDIR':os.path.dirname(srcdir),'INSTDIR':os.path.join(srcdir,'instdir'),'WORKDIR':os.path.join(srcdir,'workdir')
+}
+def tmp_json_env_var(self):
+pass
 
 def retrieve_toolset(self):
 return {'vs2013': 'v120', 'vs2015': 'v140'}.get(self.ide, None)
@@ -225,6 +235,8 @@ class testVS2013Ide(IdeIntegrationGenerator):
 
 def emit(self):
 all_projects = []
+props_path=os.path.join(self.solution_directory,'PropertySheet.props')
+self.write_props(props_path)
 for module in self.gbuildparser.modules:
 projects = []
 module_directory = os.path.join(self.solution_directory, module)
@@ -252,6 +264,23 @@ class testVS2013Ide(IdeIntegrationGenerator):
 if library_project.target['name'] == linked_lib:
 dependency_libs[library_project.guid] = library_project
 return dependency_libs
+def write_props(self,props_path):
+ns = 'http://schemas.microsoft.com/developer/msbuild/2003'
+ET.register_namespace('', ns)
+proj_node = ET.Element('{%s}Project' % ns, DefaultTargets='Build', 
ToolsVersion='4.0')
+imp_grp_node=ET.SubElement(proj_node,'{%s}ImportGroup' % ns, 
Label='PropertySheets')
+prop_grp_node = ET.SubElement(proj_node, '{%s}PropertyGroup' % ns, 
Label='UserMacros')
+for key,value in self.env_variables.items():
+vsrcdir=ET.SubElement(prop_grp_node,key)
+vsrcdir.text=value
+prop_grp_node2 = ET.SubElement(proj_node, '{%s}PropertyGroup' % ns)
+itm_def_node = ET.SubElement(proj_node, '{%s}ItemDefinitionGroup' % ns)
+itm_grp = ET.SubElement(proj_node, '{%s}ItemGroup' % ns)
+for key, value in self.env_variables.items():
+build_macro_node = ET.SubElement(itm_grp, '{%s}BuildMacro' % ns, 
Include=key)
+value_node = ET.SubElement(build_macro_node, '{%s}Value' % ns)
+value_node.text='$(%s)' % key
+self.write_pretty_xml(proj_node,props_path)
 
 def 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-02-04 Thread Federico Bassini
 bin/gbuild-to-ide |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 99860ffc53aa1f423fe60a2f484fdfed7b045d5e
Author: Federico Bassini 
Date:   Thu Feb 2 20:20:56 2017 +0100

gbuild-to-ide fix the double .cxx in the .filters

double ".ccx" for each source files in the .filters in the
testVS2013Ide.
this patch fix that.

Change-Id: Ic06800c260800f72254038e30119db40fe048037
Reviewed-on: https://gerrit.libreoffice.org/33892
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index f38be79..7dd6142 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -94,7 +94,7 @@ class GbuildParser:
 # Relation between json object and file extension
 jsonSrc = {
 'CXXOBJECTS': '.cxx', 'OBJCOBJECTS': '.m', 
'OBJCXXOBJECTS': '.mm', 'COBJECTS': '.c',
-'FLEXOBJECTS': '.l',   'YACCOBJECTS': '.y',
+'LEXOBJECTS': '.l',   'YACCOBJECTS': '.y',
 
 'GENCXXOBJECTS': '.cxx', # remark is in 
workdir/GenCxxObject
 'ASMOBJECTS': '.s',  #not in json, due to Blacklist ?
@@ -529,7 +529,7 @@ class testVS2013Ide(IdeIntegrationGenerator):
 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'
+cxx_file_name = cxxfile.split('/')[-1]
 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"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-02-04 Thread Federico Bassini
 bin/gbuild-to-ide |  118 +-
 1 file changed, 117 insertions(+), 1 deletion(-)

New commits:
commit 9fe97c0d6c23f8475759993b0ef8ce46bb2df661
Author: Federico Bassini 
Date:   Fri Feb 3 18:13:25 2017 +0100

gbuild-to-ide: new function that generates a vxcproj on testIDE

this function generates a vcxproj, for the reverse engineering
i generate a vcxproj from VS2013 that:
-the compiler works good

i do the code that generates it
the code miss that the link to lib that i left commented

Change-Id: If98eb5645c9e1060a55701abf5b96db85eca6ce5
Reviewed-on: https://gerrit.libreoffice.org/33893
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 7c6d660..f38be79 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -233,7 +233,8 @@ class testVS2013Ide(IdeIntegrationGenerator):
 
 project_path = os.path.join(module_directory, '%s.vcxproj' 
% target['target_name'])
 
-project_guid = self.write_project(project_path, target)
+project_guid = self.twrite_project(project_path, target)
+#self.twrite_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)
@@ -392,6 +393,121 @@ class testVS2013Ide(IdeIntegrationGenerator):
 
 return project_guid
 
+def twrite_project(self, project_path, target):
+folder = os.path.dirname(project_path)
+if not os.path.exists(folder):
+os.makedirs(folder)
+project_guid = str(uuid.uuid4()).upper()
+ns = 'http://schemas.microsoft.com/developer/msbuild/2003'
+ET.register_namespace('', ns)
+proj_node = ET.Element('{%s}Project' % ns, DefaultTargets='Build', 
ToolsVersion='4.0')
+
+proj_confs_node = ET.SubElement(proj_node, '{%s}ItemGroup' % ns, 
Label='ProjectConfigurations')
+platform='Win32'
+for configuration in self.configurations:
+proj_conf_node = ET.SubElement(proj_confs_node,
+   '{%s}ProjectConfiguration' % ns,
+   Include='%s|%s' % (configuration, 
platform))
+conf_node = ET.SubElement(proj_conf_node, '{%s}Configuration' % ns)
+conf_node.text = configuration
+platform_node = ET.SubElement(proj_conf_node, '{%s}Platform' % ns)
+platform_node.text = platform
+#globals
+globals_node = ET.SubElement(proj_node, '{%s}PropertyGroup' % ns, 
Label='Globals')
+proj_guid_node = ET.SubElement(globals_node, '{%s}ProjectGuid' % 
ns)
+proj_guid_node.text = '{%s}' % project_guid
+proj_root_namespace=ET.SubElement(globals_node, 
'{%s}RootNamespace' % ns)
+proj_root_namespace.text = target['target_name']
+
+
+ET.SubElement(proj_node, '{%s}Import' % ns, 
Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props')
+for configuration in self.configurations:
+property_group_node=ET.SubElement(proj_node,'{%s}PropertyGroup' % 
ns, Label="Configuration", Condition="'$(Configuration)|$(Platform)'=='%s|%s'" 
% (configuration,platform))
+
conf_type=ET.SubElement(property_group_node,'{%s}ConfigurationType' % ns)
+conf_type.text='Application'
+
use_dbg_lib=ET.SubElement(property_group_node,'{%s}UseDebugLibraries' % ns)
+use_dbg_lib.text='true'
+platform_toolset_node = ET.SubElement(property_group_node, 
'{%s}PlatformToolset' % ns)
+platform_toolset_node.text = self.toolset
+char_set_node=ET.SubElement(property_group_node,'{%s}CharacterSet' 
%ns)
+char_set_node.text='MultiByte'
+#on debug there ist a whole programoptimization
+
+ET.SubElement(proj_node, '{%s}Import' % ns, 
Project='$(VCTargetsPath)\Microsoft.Cpp.props')
+ET.SubElement(proj_node,'{%s}ImportGroup' % 
ns,Label='ExtensionSettings')
+for configuration in self.configurations:
+prop_sheets=ET.SubElement(proj_node,'{%s}ImportGroup' % ns, 
Label='PropertySheets',Condition="'$(Configuration)|$(Platform)'=='%s|%s'" % 
(configuration,platform))
+ET.SubElement(prop_sheets,'{%s}Import' % 
ns,Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props",Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')",Label="LocalAppDataPlatform")
+ET.SubElement(proj_node, '{%s}PropertyGroup' % ns, Label='UserMacros')
+for configuration in self.configurations:
+

[Libreoffice-commits] core.git: bin/gbuild-to-ide compile_commands.json osx/jantest osx/janTestLib

2017-02-02 Thread jan Iversen
 bin/gbuild-to-ide|1 +
 compile_commands.json|1 +
 osx/janTestLib/janTestLib.h  |   13 -
 osx/janTestLib/janTestLib.m  |   13 -
 osx/jantest/LibMain.cpp  |   15 ---
 osx/jantest/UnittestMain.cpp |   15 ---
 6 files changed, 2 insertions(+), 56 deletions(-)

New commits:
commit 8944a4dc98ff4e1028936aa7c287f57183aa9b56
Author: jan Iversen 
Date:   Thu Feb 2 20:27:50 2017 +0100

gbuild-to-ide added -DLIBO_INTERNAL_ONLY to CXXFLAGS

In order to compile correct this flag is needed and
it is not exported in the json files

Change-Id: Ib8f0b882f2d59ed467a9198c148263e2882c60b3

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 0ab45d1..7c6d660 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -123,6 +123,7 @@ class GbuildParser:
 jsondata['target_name'] = module + '_' + jsontype + '_' + 
match
 jsondata['DEFS'] = 
GbuildParser.__split_defs(jsondata['DEFS'])
 jsondata['LINKED_LIBS'] = 
jsondata['LINKED_LIBS'].strip().split(' ')
+jsondata['CXXFLAGS'] += ' -DLIBO_INTERNAL_ONLY'
 for i in ['CXXFLAGS', 'CFLAGS', 'OBJCFLAGS', 
'OBJCXXFLAGS']:
 jsondata[i] = GbuildParser.__split_flags(jsondata[i], 
jsondata[i+'APPEND'])
 for i in jsonSrc:
diff --git a/compile_commands.json b/compile_commands.json
new file mode 100644
index 000..9027ee5
--- /dev/null
+++ b/compile_commands.json
@@ -0,0 +1 @@
+[{"command": "clang++ -Wall -DMACOSX_SDK_VERSION=101200 
-DBOOST_ERROR_CODE_HEADER_ONLY -DSAL_LOG_INFO -DSYSTEM_LIBXML 
-DBOOST_SYSTEM_NO_DEPRECATED -DUNX -DUNIX -D_PTHREADS -DLIBO_INTERNAL_ONLY 
-DMAC_OS_X_VERSION_MIN_REQUIRED=1080 -DOSL_DEBUG_LEVEL=1 -DX86_64 
-DSAL_LOG_WARN -DNO_PTHREAD_PRIORITY -DMAC_OS_X_VERSION_MAX_ALLOWED=101200 
-DMACOSX -D_REENTRANT -DCPPU_ENV=gcc3 
-I/Volumes/LIBREOFFICE/play/xcode_core/l10ntools/source 
-Iexternal/boost/include 
-I/Volumes/LIBREOFFICE/play/xcode/workdir/UnpackedTarball/boost -Il10ntools/inc 
-Iinclude 
-I/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/include 
-I/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/include/darwin
 -I/Volumes/LIBREOFFICE/play/xcode/config_host 
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2
 -fmessage-length=0 -fno-common -pipe -fno-threadsafe-statics 
-fvisibility-inlines-hidden -fstack-protector-strong -fPIC -fno-stri
 ct-aliasing -fsigned-char -std=gnu++14 -c 
/Volumes/LIBREOFFICE/play/xcode_core/l10ntools/source/pocheck.cxx", 
"directory": "/Volumes/LIBREOFFICE/play/xcode_core/l10ntools", "file": 
"/Volumes/LIBREOFFICE/play/xcode_core/l10ntools/source/pocheck.cxx"}]
\ No newline at end of file
diff --git a/osx/janTestLib/janTestLib.h b/osx/janTestLib/janTestLib.h
deleted file mode 100644
index ecd1309..000
--- a/osx/janTestLib/janTestLib.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  janTestLib.h
-//  janTestLib
-//
-//  Created by Jan Iversen on 29/01/2017.
-//  Copyright © 2017 Jan Iversen. All rights reserved.
-//
-
-#import 
-
-@interface janTestLib : NSObject
-
-@end
diff --git a/osx/janTestLib/janTestLib.m b/osx/janTestLib/janTestLib.m
deleted file mode 100644
index 365103e..000
--- a/osx/janTestLib/janTestLib.m
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  janTestLib.m
-//  janTestLib
-//
-//  Created by Jan Iversen on 29/01/2017.
-//  Copyright © 2017 Jan Iversen. All rights reserved.
-//
-
-#import "janTestLib.h"
-
-@implementation janTestLib
-
-@end
diff --git a/osx/jantest/LibMain.cpp b/osx/jantest/LibMain.cpp
deleted file mode 100644
index 20a59c3..000
--- a/osx/jantest/LibMain.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-//  main.cpp
-//  jantest
-//
-//  Created by Jan Iversen on 29/01/2017.
-//  Copyright © 2017 Jan Iversen. All rights reserved.
-//
-
-#include 
-
-int main(int argc, const char * argv[]) {
-// insert code here...
-std::cout << "Hello, World!\n";
-return 0;
-}
diff --git a/osx/jantest/UnittestMain.cpp b/osx/jantest/UnittestMain.cpp
deleted file mode 100644
index 20a59c3..000
--- a/osx/jantest/UnittestMain.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-//  main.cpp
-//  jantest
-//
-//  Created by Jan Iversen on 29/01/2017.
-//  Copyright © 2017 Jan Iversen. All rights reserved.
-//
-
-#include 
-
-int main(int argc, const char * argv[]) {
-// insert code here...
-std::cout << "Hello, World!\n";
-return 0;
-}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-02-01 Thread Federico Bassini
 bin/gbuild-to-ide |   26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 25a502050f4a898e4ce147afa71f135c771c50a3
Author: Federico Bassini 
Date:   Thu Feb 2 00:11:03 2017 +0100

gbuild-to-ide: second patch for vs2013 and testIde

the path in gbuildparse changed, so this patch re-adapt this
2 IDE integration

Change-Id: I5f7a679b8b12eac6f44030a33713ff19327b9d1a
Reviewed-on: https://gerrit.libreoffice.org/33815
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 258a971..0ab45d1 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -94,7 +94,7 @@ class GbuildParser:
 # Relation between json object and file extension
 jsonSrc = {
 'CXXOBJECTS': '.cxx', 'OBJCOBJECTS': '.m', 
'OBJCXXOBJECTS': '.mm', 'COBJECTS': '.c',
-'LEXOBJECTS': '.l',   'YACCOBJECTS': '.y',
+'FLEXOBJECTS': '.l',   'YACCOBJECTS': '.y',
 
 'GENCXXOBJECTS': '.cxx', # remark is in 
workdir/GenCxxObject
 'ASMOBJECTS': '.s',  #not in json, due to Blacklist ?
@@ -368,9 +368,9 @@ class testVS2013Ide(IdeIntegrationGenerator):
 for cxxobject in target['CXXOBJECTS']:
 cxxrelpath= 
os.path.join('../..',target['location'].split('/')[-1], cxxobject)
 cxxabspath = 
os.path.join(self.gbuildparser.srcdir,target['location'].split('/')[-1], 
cxxobject)
-cxxfile = cxxabspath + '.cxx'
+cxxfile = cxxabspath
 if os.path.isfile(cxxfile):
-ET.SubElement(cxxobjects_node, '{%s}ClCompile' % ns, 
Include=cxxrelpath + '.cxx')
+ET.SubElement(cxxobjects_node, '{%s}ClCompile' % ns, 
Include=cxxrelpath)
 else:
 print('Source %s in project %s does not exist' % (cxxfile, 
target['target_name']))
 
@@ -378,13 +378,13 @@ class testVS2013Ide(IdeIntegrationGenerator):
 for cxxobject in target['CXXOBJECTS']:
 include_rel_path = 
os.path.join('../..',target['location'].split('/')[-1], cxxobject)
 include_abs_path = 
os.path.join(self.gbuildparser.srcdir,target['location'].split('/')[-1], 
cxxobject)
-hxxfile = include_abs_path + '.hxx'
+hxxfile = include_abs_path
 if os.path.isfile(hxxfile):
-ET.SubElement(includes_node, '{%s}ClInclude' % ns, 
Include=include_rel_path + '.hxx')
+ET.SubElement(includes_node, '{%s}ClInclude' % ns, 
Include=include_rel_path)
 # Few files have corresponding .h files
-hfile = include_abs_path + '.h'
+hfile = include_abs_path
 if os.path.isfile(hfile):
-ET.SubElement(includes_node, '{%s}ClInclude' % ns, 
Include=include_rel_path + '.h')
+ET.SubElement(includes_node, '{%s}ClInclude' % ns, 
Include=include_rel_path)
 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)
@@ -844,9 +844,9 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 for cxxobject in target['CXXOBJECTS']:
 cxxrelpath = os.path.join('../..', 
target['location'].split('/')[-1], cxxobject)
 cxxabspath = os.path.join(self.gbuildparser.srcdir, 
target['location'].split('/')[-1], cxxobject)
-cxxfile = cxxabspath + '.cxx'
+cxxfile = cxxabspath
 if os.path.isfile(cxxfile):
-ET.SubElement(cxxobjects_node, '{%s}ClCompile' % ns, 
Include=cxxrelpath + '.cxx')
+ET.SubElement(cxxobjects_node, '{%s}ClCompile' % ns, 
Include=cxxrelpath)
 else:
 print('Source %s in project %s does not exist' % (cxxfile, 
target['target_name']))
 
@@ -854,13 +854,13 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 for cxxobject in target['CXXOBJECTS']:
 include_rel_path = 
os.path.join('../..',target['location'].split('/')[-1], cxxobject)
 include_abs_path = 
os.path.join(self.gbuildparser.srcdir,target['location'].split('/')[-1], 
cxxobject)
-hxxfile = include_abs_path + '.hxx'
+hxxfile = include_abs_path
 if os.path.isfile(hxxfile):
-ET.SubElement(includes_node, '{%s}ClInclude' % ns, 
Include=include_rel_path + '.hxx')
+ET.SubElement(includes_node, '{%s}ClInclude' % ns, 
Include=include_rel_path)
 # Few files have corresponding .h files
-hfile = include_abs_path + '.h'
+hfile = include_abs_path
 if os.path.isfile(hfile):
-ET.SubElement(includes_node, '{%s}ClInclude' % ns, 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-02-01 Thread jan Iversen
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9493bb3a26579fd89d1c2684590691c4129500e4
Author: jan Iversen 
Date:   Wed Feb 1 18:37:34 2017 +0100

gbuild-to-ide typo

Change-Id: I3b57086349d039087dc9395f7af63f8e8fbf1bab

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 962463e..258a971 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -127,7 +127,7 @@ class GbuildParser:
 jsondata[i] = GbuildParser.__split_flags(jsondata[i], 
jsondata[i+'APPEND'])
 for i in jsonSrc:
 if not i in jsondata:
-jsondata[i] = ''
+jsondata[i] = ''
 jsondata[i] = GbuildParser.__split_objs(module, 
jsondata[i], jsonSrc[i])
 
 if not module in moduleDict:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-02-01 Thread jan Iversen
 bin/gbuild-to-ide |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 45de3417e31337db4310fc77a048ea9d1e6772bb
Author: jan Iversen 
Date:   Wed Feb 1 18:19:22 2017 +0100

gbuild-to-ide patch to allow faulty gbuildtojson

Sometimes gbuildtojson does not get rebuild, and thus
delivers unexpected json files (old keys)

Change-Id: Ib4bab170ed5a2ab5c112d19af144f2551e608278

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index f9ca375..962463e 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -126,6 +126,8 @@ class GbuildParser:
 for i in ['CXXFLAGS', 'CFLAGS', 'OBJCFLAGS', 
'OBJCXXFLAGS']:
 jsondata[i] = GbuildParser.__split_flags(jsondata[i], 
jsondata[i+'APPEND'])
 for i in jsonSrc:
+if not i in jsondata:
+jsondata[i] = ''
 jsondata[i] = GbuildParser.__split_objs(module, 
jsondata[i], jsonSrc[i])
 
 if not module in moduleDict:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-31 Thread Federico Bassini
 bin/gbuild-to-ide |   40 +++-
 1 file changed, 23 insertions(+), 17 deletions(-)

New commits:
commit 6f08c430353b36d219c284a87f014985b00af06c
Author: Federico Bassini 
Date:   Tue Jan 31 08:53:10 2017 +0100

gbuild-to-ide: VSGenerator and testVs2013 with relative links

VisualStudio2013IntegrationGenerator  recently doesn't work
with the new relative paths in GbuilParser.
this patch does this, now it works fine with all relative paths.
what is missing it's in the .vcxproj:




these still work with absolute path but i start now on working this

Change-Id: I19610097edc11be67b4f7fd9f32b6683d334cc2d
Reviewed-on: https://gerrit.libreoffice.org/33735
Reviewed-by: jan iversen 
Tested-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 3bf063d..f9ca375 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -353,33 +353,36 @@ class testVS2013Ide(IdeIntegrationGenerator):
 nmake_rebuild_node = ET.SubElement(conf_node, 
'{%s}NMakeReBuildCommandLine' % ns)
 nmake_rebuild_node.text = cfg_targets['rebuild'] % nmake_params
 nmake_output_node = ET.SubElement(conf_node, '{%s}NMakeOutput' % 
ns)
-nmake_output_node.text = os.path.join(self.gbuildparser.instdir, 
'program', 'soffice.exe')
+nmake_output_node.text = os.path.join('../..', 'program', 
'soffice.exe')
 nmake_defs_node = ET.SubElement(conf_node, 
'{%s}NMakePreprocessorDefinitions' % ns)
 nmake_defs_node.text = ';'.join(list(target['DEFS']) + 
['$(NMakePreprocessorDefinitions)'])
 include_path_node = ET.SubElement(conf_node, '{%s}IncludePath' % 
ns)
-include_path_node.text = ';'.join(target['include'] + 
['$(IncludePath)'])
+includes=[os.path.join('../..',elem) if elem[1] != ':'  else elem 
for elem in target['include'] ]
+include_path_node.text = ';'.join(includes + ['$(IncludePath)'])
 
 ET.SubElement(proj_node, '{%s}ItemDefinitionGroup' % ns)
 
 cxxobjects_node = ET.SubElement(proj_node, '{%s}ItemGroup' % ns)
 for cxxobject in target['CXXOBJECTS']:
-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)
+cxxrelpath= 
os.path.join('../..',target['location'].split('/')[-1], cxxobject)
+cxxabspath = 
os.path.join(self.gbuildparser.srcdir,target['location'].split('/')[-1], 
cxxobject)
+cxxfile = cxxabspath + '.cxx'
+if os.path.isfile(cxxfile):
+ET.SubElement(cxxobjects_node, '{%s}ClCompile' % ns, 
Include=cxxrelpath + '.cxx')
 else:
 print('Source %s in project %s does not exist' % (cxxfile, 
target['target_name']))
 
 includes_node = ET.SubElement(proj_node, '{%s}ItemGroup' % ns)
 for cxxobject in target['CXXOBJECTS']:
-include_abs_path = os.path.join(self.gbuildparser.srcdir + '/' + 
target['module'], cxxobject)
+include_rel_path = 
os.path.join('../..',target['location'].split('/')[-1], cxxobject)
+include_abs_path = 
os.path.join(self.gbuildparser.srcdir,target['location'].split('/')[-1], 
cxxobject)
 hxxfile = include_abs_path + '.hxx'
 if os.path.isfile(hxxfile):
-ET.SubElement(includes_node, '{%s}ClInclude' % ns, 
Include=hxxfile)
+ET.SubElement(includes_node, '{%s}ClInclude' % ns, 
Include=include_rel_path + '.hxx')
 # Few files have corresponding .h files
 hfile = include_abs_path + '.h'
 if os.path.isfile(hfile):
-ET.SubElement(includes_node, '{%s}ClInclude' % ns, 
Include=hfile)
+ET.SubElement(includes_node, '{%s}ClInclude' % ns, 
Include=include_rel_path + '.h')
 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)
@@ -826,33 +829,36 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 nmake_rebuild_node = ET.SubElement(conf_node, 
'{%s}NMakeReBuildCommandLine' % ns)
 nmake_rebuild_node.text = cfg_targets['rebuild'] % nmake_params
 nmake_output_node = ET.SubElement(conf_node, '{%s}NMakeOutput' % 
ns)
-nmake_output_node.text = os.path.join(self.gbuildparser.instdir, 
'program', 'soffice.exe')
+nmake_output_node.text = os.path.join('../..', 'program', 
'soffice.exe')
 nmake_defs_node = ET.SubElement(conf_node, 
'{%s}NMakePreprocessorDefinitions' % ns)
 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-31 Thread Federico Bassini
 bin/gbuild-to-ide |   79 +++---
 1 file changed, 34 insertions(+), 45 deletions(-)

New commits:
commit 9f440258b6bdf9b168992f7058f448dac588760c
Author: Federico Bassini 
Date:   Mon Jan 30 22:29:52 2017 +0100

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 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 9a8ce8a..3bf063d 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 = 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-30 Thread Miklos Vajna
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bf7168bd09a8ae4e0f39f28d74a1d0eaf1411a9d
Author: Miklos Vajna 
Date:   Mon Jan 30 12:34:39 2017 +0100

gbuild-to-ide: fix VimIntegrationGenerator

Regression from commit 92c2c5f62d6e8962259e03424a40b6ac7ef32e7d
(gbuild-to-ide: moduleDict targets -> all paths replaced with relative,
2017-01-24), 
says about the "directory" key of one entry:

"All paths specified in the command or file fields must be either
absolute or relative to this directory."

So making the includes relative to the toplevel directory won't fly,
make them absolute.

Change-Id: I3f33c7a21880c1b245580b22996079ba08e3d806
Reviewed-on: https://gerrit.libreoffice.org/33694
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index e19005a..9a8ce8a 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1118,7 +1118,7 @@ class VimIntegrationGenerator(IdeIntegrationGenerator):
 
 for include in lib['include']:
 command += ' -I'
-command += include
+command += os.path.abspath(include)
 for isystem in lib['include_sys']:
 command += ' -isystem '
 command += isystem
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-30 Thread jan Iversen
 bin/gbuild-to-ide |   54 ++
 1 file changed, 38 insertions(+), 16 deletions(-)

New commits:
commit f41301c1630361a0b753ea47e81ea67ace415f4c
Author: jan Iversen 
Date:   Mon Jan 30 12:09:02 2017 +0100

gbuild-to-ide, solved vim problem.

Updated xcode, WIP.

Solved problem with vim.
Remark the vim-ide-integration is not maintained, and cannot be expected
to work as the IDE gets more integrated.

Change-Id: I9d6fe6d2caef7162298814f1ab0d16c7aeb7d895

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 42ba3b1..e19005a 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -543,14 +543,15 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 targetId = self.generate_id('PBXNativeTarget')
 configurationListId = self.generate_id('XCConfigurationList')
 configurationDebugId = self.generate_id('XCBuildConfiguration')
-fileId = self.generate_id('XCBuildConfiguration')
-objects = {targetId: self.generate_PBXLegacyTarget(target, 
configurationListId),
-   configurationListId: 
self.generate_XCBuildConfiguration(target, configurationDebugId),
+fileId = self.generate_id('PBXFileReference')
+objects = {configurationListId: 
self.generate_XCBuildConfiguration(target, configurationDebugId),
+#MAKE   targetId: self.generate_PBXLegacyTarget(target, 
configurationListId),
+   targetId: self.generate_PBXNativeTarget(target, 
configurationListId),
configurationDebugId: 
self.generate_XCBuildConfiguration(target, configurationDebugId, debug=True),
fileId : self.generate_PBXFileReference(module, 
target['LINKTARGET'], explicit=target['build_type'])
}
-self.rootObj['attributes']['TargetAttributes'].update({
-targetId: {'CreatedOnToolsVersion': '8.2', 'ProvisioningStyle': 
'Automatic'}})
+self.rootObj['attributes']['TargetAttributes'].update(
+{targetId: {'CreatedOnToolsVersion': '8.2', 'ProvisioningStyle': 
'Automatic'}})
 self.rootObj['buildConfigurationList'] = configurationListId
 self.rootObj['targets'].append(targetId)
 targetObj['children'].append(fileId)
@@ -573,15 +574,35 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 product = 'com.apple.product-type.something'
 
 return {'isa': 'PBXLegacyTarget',
-  'buildConfigurationList': configurationListId,
-  'buildArgumentsString': modulename['target_name'],
-  'buildPhases': [],
-  'dependencies': [],
-  'buildToolPath': 'make',
-  'buildWorkingDirectory': self.gbuildparser.builddir,
-  'name': modulename['target_name'],
-  'productName': modulename['name'],
-  'passBuildSettingsEnvironment': 1}
+'buildConfigurationList': configurationListId,
+'buildArgumentsString': modulename['target_name'],
+'buildPhases': [],
+'dependencies': [],
+'buildToolPath': 'make',
+'buildWorkingDirectory': self.gbuildparser.builddir,
+'name': modulename['target_name'],
+'productName': modulename['name'],
+'passBuildSettingsEnvironment': 1}
+
+def generate_PBXNativeTarget(self, modulename, configurationListId):
+if modulename['build_type'] == 'Library':
+product = 'com.apple.product-type.library.dynamic'
+elif modulename['build_type'] == 'Executable':
+product = 'com.apple.product-type.tool'
+elif modulename['build_type'] == 'CppunitTest':
+product = 'com.apple.product-type.cppunit'
+else:
+product = 'com.apple.product-type.something'
+
+return {'isa': 'PBXNativeTarget',
+'buildRules': [],
+'dependencies': [],
+'name': modulename['target_name'],
+'productName': modulename['name'],
+'productType': product,
+'buildConfigurationList': configurationListId,
+'buildPhases': [],
+'productReference': ''}
 
 def generate_XCBuildConfiguration(self, modulename, configurationDebugId, 
debug=False):
 if debug:
@@ -639,13 +660,13 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 obj =  {'isa': 'PBXFileReference',
 'path': module + '/' + filepath,
 'name': filepath,
-'fileEncoding': 4,
 'sourceTree': ''}
 if not explicit is None:
 if explicit == 'Library':
 obj['explicitFileType'] = 'compiled.mach-o.dylib'
 else:
 obj['explicitFileType'] = 'compiled.executable'
+

[Libreoffice-commits] core.git: bin/gbuild-to-ide osx/jantest osx/janTestLib

2017-01-29 Thread jan Iversen
 bin/gbuild-to-ide|  209 ++-
 osx/janTestLib/janTestLib.h  |   13 ++
 osx/janTestLib/janTestLib.m  |   13 ++
 osx/jantest/LibMain.cpp  |   15 +++
 osx/jantest/UnittestMain.cpp |   15 +++
 5 files changed, 167 insertions(+), 98 deletions(-)

New commits:
commit 05ce36d2e2bada48ee97d6a7c45e3bcf71dff29a
Author: jan Iversen 
Date:   Sun Jan 29 17:10:36 2017 +0100

gbuild-to-ide xcode, added targets in menu

First step in removing make as builder.

Change-Id: I445627df5610a7d0b8bfbabddb66f1273e021b1a

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 4596222..42ba3b1 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -437,11 +437,18 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 def __init__(self, gbuildparser, ide):
 IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
 
-counter = 16777216
+typeCounter = {'PBXProject'   : 00,
+   'PBXGroup' : 10,
+   'PBXFileReference' : 20,
+   'PBXNativeTarget'  : 30,
+   'XCConfigurationList'  : 40,
+   'PBXSourcesBuildPhase' : 50,
+   'XCBuildConfiguration' : 60,
+   'PBXBuildFile' : 70}
 
 def emit(self):
-rootId = 'X001'
-mainGroupId = 'X002'
+mainGroupId, mainGroup = self.generate_PBXGroup(None)
+rootId = self.generate_id('PBXProject')
 self.rootObj = {'attributes': {'LastUpgradeCheck': '0820',
'ORGANIZATIONNAME': 'LibreOffice',
'TargetAttributes': {}},
@@ -455,7 +462,6 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 'projectRoot': '',
 'buildConfigurationList': '',
 'targets': []}
-mainGroup = {'isa': 'PBXGroup', 'children': [], 'sourceTree': 
''}
 pbxproj = {'archiveVersion': 1,
'classes': {},
'objectVersion': 46,
@@ -465,27 +471,28 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 for module in self.gbuildparser.modules:
 if module == 'include':
 continue
-sourceId, sourceObj = self.define_pbxgroup('Sources')
-includeId, includeObj = self.define_pbxgroup('Headers')
-moduleId, moduleObj = self.define_pbxgroup(module)
+moduleId, moduleObj = self.generate_PBXGroup(module)
+sourceId, sourceObj = self.generate_PBXGroup('Sources')
+includeId, includeObj = self.generate_PBXGroup('Headers')
+targetId, targetObj = self.generate_PBXGroup('Targets')
 
-moduleObj['children'] = [sourceId, includeId]
+moduleObj['children'] = [sourceId, includeId, targetId]
 pbxproj['objects'].update({sourceId:  sourceObj,
includeId: includeObj,
-   moduleId: moduleObj})
+   moduleId: moduleObj,
+   targetId: targetObj})
 mainGroup['children'].append(moduleId)
 
 for i in self.gbuildparser.modules[module]['headers']:
-ref = self.generate_id()
+ref = self.generate_id('PBXFileReference')
 pbxproj['objects'][ref] = 
self.generate_PBXFileReference(module, i)
 includeObj['children'].append(ref)
 for i in self.gbuildparser.modules[module]['sources']:
-ref = self.generate_id()
+ref = self.generate_id('PBXFileReference')
 pbxproj['objects'][ref] = 
self.generate_PBXFileReference(module, i)
 sourceObj['children'].append(ref)
-
 for target in self.gbuildparser.modules[module]['targets']:
-pbxproj['objects'].update(self.generate_project(target, 
module, sourceObj['children']))
+pbxproj['objects'].update(self.generate_target(target, module, 
targetObj, sourceObj['children']))
 
 xcodeprojdir = './osx/libreoffice.xcodeproj'
 try:
@@ -496,13 +503,6 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 f.write('// !$*UTF8*$!\n')
 self.write_object(pbxproj, f, 0)
 
-def define_pbxgroup(self, name):
-return self.generate_id(), {'isa': 'PBXGroup', 'children': [], 'name': 
name, 'sourceTree': ''}
-
-def generate_id(self):
-XcodeIntegrationGenerator.counter += 1
-return str('X%07x' % XcodeIntegrationGenerator.counter)
-
 def indent(self, file, level):
 if level != 0:
 for i in range(0, level):
@@ -535,7 +535,34 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-29 Thread jan Iversen
 bin/gbuild-to-ide |   63 --
 1 file changed, 28 insertions(+), 35 deletions(-)

New commits:
commit 78c48c998bd6525ce236cd8e145f104b2450f062
Author: jan Iversen 
Date:   Sun Jan 29 11:27:21 2017 +0100

gbuild-to-ide xcode added include files and sorted source list

Added source files so they are sorted (earlier was sorted pr target)
include files added.

Change-Id: Id9581e2c4d6b123eb13ecc7ce2586fe52cb3ab4f

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 3d9eccf..4596222 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -437,6 +437,8 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 def __init__(self, gbuildparser, ide):
 IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
 
+counter = 16777216
+
 def emit(self):
 rootId = 'X001'
 mainGroupId = 'X002'
@@ -463,18 +465,27 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 for module in self.gbuildparser.modules:
 if module == 'include':
 continue
-sourceId, self.sourceObj = self.define_pbxgroup('Sources')
-includeId, self.includeObj = self.define_pbxgroup('Headers')
-moduleId, self.moduleObj = self.define_pbxgroup(module)
-
-self.moduleObj['children'] = [sourceId, includeId]
-pbxproj['objects'].update({sourceId: self.sourceObj,
-   includeId: self.includeObj,
-   moduleId: self.moduleObj})
+sourceId, sourceObj = self.define_pbxgroup('Sources')
+includeId, includeObj = self.define_pbxgroup('Headers')
+moduleId, moduleObj = self.define_pbxgroup(module)
+
+moduleObj['children'] = [sourceId, includeId]
+pbxproj['objects'].update({sourceId:  sourceObj,
+   includeId: includeObj,
+   moduleId: moduleObj})
 mainGroup['children'].append(moduleId)
 
+for i in self.gbuildparser.modules[module]['headers']:
+ref = self.generate_id()
+pbxproj['objects'][ref] = 
self.generate_PBXFileReference(module, i)
+includeObj['children'].append(ref)
+for i in self.gbuildparser.modules[module]['sources']:
+ref = self.generate_id()
+pbxproj['objects'][ref] = 
self.generate_PBXFileReference(module, i)
+sourceObj['children'].append(ref)
+
 for target in self.gbuildparser.modules[module]['targets']:
-pbxproj['objects'].update(self.generate_project(target, 
module))
+pbxproj['objects'].update(self.generate_project(target, 
module, sourceObj['children']))
 
 xcodeprojdir = './osx/libreoffice.xcodeproj'
 try:
@@ -488,8 +499,6 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 def define_pbxgroup(self, name):
 return self.generate_id(), {'isa': 'PBXGroup', 'children': [], 'name': 
name, 'sourceTree': ''}
 
-counter = 16777216
-
 def generate_id(self):
 XcodeIntegrationGenerator.counter += 1
 return str('X%07x' % XcodeIntegrationGenerator.counter)
@@ -603,27 +612,21 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
   'defaultConfigurationName': 'Debug'}
 return result
 
-def build_source_list(self, module):
-self.sourceRefList = {}
-self.sourceList = {}
 
-for i in module['CXXOBJECTS']:
-ref = self.generate_id()
-self.sourceList[self.generate_id()] = ref
-self.sourceRefList[ref] = {'lastKnownFileType': 
'sourcecode.cpp.cpp',
-   'path': i,
-   'sourceTree': ''}
+def generate_PBXFileReference(self, module, filepath):
+return {'isa': 'PBXFileReference',
+'path': module + '/' + filepath,
+'name': filepath,
+'fileEncoding': 4,
+'sourceTree': ''}
+
 
-def generate_project(self, target, module):
+def generate_project(self, target, module, sourceObj):
 self.targetId = self.generate_id()
 self.configurationListId = self.generate_id()
 self.configurationDebugId = self.generate_id()
-
 self.productReferenceId = self.generate_id()
 self.productGroupId = self.generate_id()
-self.build_source_list(target)
-self.sourceObj['children'].extend(list(self.sourceRefList.keys()))
-
 self.rootObj['attributes']['TargetAttributes'].update({
 self.targetId: {'CreatedOnToolsVersion': '8.2',
 'ProvisioningStyle': 'Automatic'}})
@@ -633,16 +636,6 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-28 Thread jan Iversen
 bin/gbuild-to-ide |   20 
 1 file changed, 12 insertions(+), 8 deletions(-)

New commits:
commit bcaba2ca3622a66d475bf41cf2fea3d828ece342
Author: jan Iversen 
Date:   Sat Jan 28 11:51:48 2017 +0100

gbuild-to-ide source code is relative to module

Last central change, before rewrapping xcode.

Change-Id: If9b3d668fa59fe32a7a89a17ea56a6852b260a2b

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 47c7cae..3d9eccf 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': ''}
 
-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': ''}
@@ -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' 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-28 Thread jan Iversen
 bin/gbuild-to-ide |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 53d3755972bfd3bd2cd650edf91f1483038028c8
Author: jan Iversen 
Date:   Sat Jan 28 10:03:22 2017 +0100

gbuild-to-ide, add pr module sources

Additional to having sources pr target (needed
for generarition), each module also has a sources key
where all the module source files are sorted, this allows
to present the user with a sorted list of sources.

Change-Id: I8fd8249c88dc55f47199b7998faeb721d74f982f

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 18f88d3..47c7cae 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -49,9 +49,6 @@ class GbuildParser:
 
foundincludes.append(includeswitch.strip()[len(json_srcdir)+1:])
 else:
 foundincludes.append(includeswitch.strip())
-
-#foundincludes = [includeswitch.strip()[len(json_srcdir)+1:] for 
includeswitch in GbuildParser._includepattern.findall(includes) if
-#len(includeswitch) > 2]
 return (foundincludes, foundisystem)
 
 def __split_objs(module,objsline, ext):
@@ -91,6 +88,7 @@ class GbuildParser:
 #  tools translations
 #  udkapi unoid
 # Add handling of BLACKLIST
+
 # Relation between json object and file extension
 jsonSrc = {
 'CXXOBJECTS': '.cxx', 'OBJCOBJECTS': '.m', 
'OBJCXXOBJECTS': '.mm', 'COBJECTS': '.c',
@@ -135,8 +133,14 @@ class GbuildParser:
 
 moduleDict['include']={ 'targets': [], 
'headers':self.headers_of('include')}
 
-for module in sorted(moduleDict):
-self.modules[module] = moduleDict[module]
+for i in sorted(moduleDict):
+module = moduleDict[i]
+src = []
+for target in module['targets']:
+for ext in jsonSrc:
+src.extend(target[ext])
+module['sources'] = sorted(src)
+self.modules[i] = module
 return self
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-28 Thread jan Iversen
 bin/gbuild-to-ide |   50 --
 1 file changed, 24 insertions(+), 26 deletions(-)

New commits:
commit 03bbd573ca3eb1dd9aaf0ae0ba5255fae37ff587
Author: jan Iversen 
Date:   Sat Jan 28 09:33:12 2017 +0100

gbuild-to-ide, centralized adding extension.

Instead of each generator handling extensions it is
not done centrally.

Change-Id: I2cf1a499269a26c1c402577b3e8e508d578f9c6e

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 6a398d6..18f88d3 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -39,7 +39,7 @@ class GbuildParser:
  'Executable': re.compile('Executable_(.*)\.mk'),
  'CppunitTest': re.compile('CppunitTest_(.*)\.mk')}
 _allheaders=[]
-@staticmethod
+
 def __split_includes(json_srcdir,includes):
 foundisystem = GbuildParser._isystempattern.findall(includes)
 foundincludes=[]
@@ -54,11 +54,13 @@ class GbuildParser:
 #len(includeswitch) > 2]
 return (foundincludes, foundisystem)
 
-@staticmethod
-def __split_objs(module,objsline):
-return [obj[len(module)+1:] for obj in objsline.strip().split(' ') if 
len(obj) > 0 and obj != 'CXXOBJECTS' and obj != '+=']
+def __split_objs(module,objsline, ext):
+retObj = []
+for obj in objsline.strip().split(' '):
+if len(obj) > 0 and obj != 'CXXOBJECTS' and obj != '+=':
+retObj.append(obj + ext)
+return sorted(retObj)
 
-@staticmethod
 def __split_defs(defsline):
 defs = {}
 alldefs = [defswitch.strip() for defswitch in 
defsline.strip().lstrip('-D').split(' -D') if len(defswitch) > 2]
@@ -70,7 +72,6 @@ class GbuildParser:
 defs["LIBO_INTERNAL_ONLY"] = None
 return defs
 
-@staticmethod
 def __split_flags(flagsline, flagslineappend):
 return [cxxflag.strip() for cxxflag in 
GbuildParser._warningpattern.sub('', '%s %s' % (flagsline, 
flagslineappend)).split(' ') if len(cxxflag) > 1]
 
@@ -125,7 +126,7 @@ class GbuildParser:
 for i in ['CXXFLAGS', 'CFLAGS', 'OBJCFLAGS', 
'OBJCXXFLAGS']:
 jsondata[i] = GbuildParser.__split_flags(jsondata[i], 
jsondata[i+'APPEND'])
 for i in jsonSrc:
-jsondata[i] = sorted(GbuildParser.__split_objs(module, 
jsondata[i]))
+jsondata[i] = GbuildParser.__split_objs(module, 
jsondata[i], jsonSrc[i])
 
 if not module in moduleDict:
 moduleDict[module] = {'targets': [],'headers':{}}
@@ -238,13 +239,11 @@ class testWinIde(IdeIntegrationGenerator):
 return dependency_libs
 
 def write_solution(self, solution_path, projects):
-print('Solution %s:' % 
os.path.splitext(os.path.basename(solution_path))[0], end='')
 library_projects = [project for project in projects if 
project.target['build_type'] == 'Library']
 with open(solution_path, 'w') as f:
 f.write('Microsoft Visual Studio Solution File, Format Version 
12.00\n')
 for project in projects:
 target = project.target
-print(' %s' % target['target_name'], end='')
 proj_path = os.path.relpath(project.path, 
os.path.abspath(os.path.dirname(solution_path)))
 f.write('Project("{%s}") = "%s", "%s", "{%s}"\n' %
 (VisualStudioIntegrationGenerator.nmake_project_guid,
@@ -274,7 +273,6 @@ class testWinIde(IdeIntegrationGenerator):
 '\t\t{%(guid)s}.%(sol_cfg)s|%(platform)s.Build.0 = 
%(proj_cfg)s|%(platform)s\n' % params)
 f.write('\tEndGlobalSection\n')
 f.write('EndGlobal\n')
-print('')
 
 def write_project(self, project_path, target):
 # See info at 
http://blogs.msdn.com/b/visualstudio/archive/2010/05/14/a-guide-to-vcxproj-and-props-file-structure.aspx
@@ -355,9 +353,9 @@ 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)
-cxxfile = cxxabspath + '.cxx'
-if os.path.isfile(cxxfile):
-ET.SubElement(cxxobjects_node, '{%s}ClCompile' % ns, 
Include=cxxfile)
+cxxfile = cxxabspath
+if os.path.isfile(cxxabspath):
+ET.SubElement(cxxobjects_node, '{%s}ClCompile' % ns, 
Include=cxxabspath)
 else:
 print('Source %s in project %s does not exist' % (cxxfile, 
target['target_name']))
 
@@ -606,7 +604,7 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 ref = self.generate_id()
 self.sourceList[self.generate_id()] = ref
 self.sourceRefList[ref] = {'lastKnownFileType': 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-26 Thread jan Iversen
 bin/gbuild-to-ide |  564 +++---
 1 file changed, 288 insertions(+), 276 deletions(-)

New commits:
commit fc68a2677006467455eb064c1ddc3666a660af7c
Author: jan Iversen 
Date:   Thu Jan 26 10:38:32 2017 +0100

gbuild-to-ide finalized split of maintained code

Added "testIde-ide-integration" to allow test of new vs2013 generator.

Change-Id: Ia7d286f06e287ce97faa0a262ee4f93172d4ed28

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 6d59d6a..3d9460c 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -75,9 +75,6 @@ class GbuildParser:
 return [cxxflag.strip() for cxxflag in 
GbuildParser._warningpattern.sub('', '%s %s' % (flagsline, 
flagslineappend)).split(' ') if len(cxxflag) > 1]
 
 
-
-
-
 def parse(self):
 # Relation between json object and file extension
 jsonSrc = {
@@ -154,6 +151,8 @@ class GbuildParser:
 headersof=[]
 return headersof
 
+
+
 class IdeIntegrationGenerator:
 
 def __init__(self, gbuildparser, ide):
@@ -162,7 +161,9 @@ class IdeIntegrationGenerator:
 def emit(self):
 pass
 
-class testide(IdeIntegrationGenerator):
+
+
+class testWinIde(IdeIntegrationGenerator):
 
 def __init__(self, gbuildparser, ide):
 IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
@@ -415,6 +416,7 @@ class testide(IdeIntegrationGenerator):
 self.write_pretty_xml(proj_node, filters_path)
 
 
+
 class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 def __init__(self, gbuildparser, ide):
 IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
@@ -627,7 +629,281 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 'sourceTree': ''}
 return objects
 
-#  LO supported ide ---
+
+
+class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
+
+def __init__(self, gbuildparser, ide):
+IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
+self.toolset = self.retrieve_toolset()
+self.solution_directory = './windows'
+self.configurations = {
+'Build': {
+'build': self.module_make_command('%(target)s'),
+'clean': self.module_make_command('%(target)s.clean'),
+'rebuild': self.module_make_command('%(target)s.clean 
%(target)s')
+},
+'Unit Tests': {
+'build': self.module_make_command('unitcheck'),
+'clean': self.module_make_command('clean'),
+'rebuild': self.module_make_command('clean unitcheck'),
+},
+'Integration tests': {
+'build': self.module_make_command('unitcheck slowcheck 
screenshot subsequentcheck'),
+'clean': self.module_make_command('clean'),
+'rebuild': self.module_make_command('clean unitcheck slowcheck 
screenshot subsequentcheck')
+}
+}
+
+def retrieve_toolset(self):
+return {'vs2013': 'v120', 'vs2015': 'v140'}.get(self.ide, None)
+
+def module_make_command(self, targets):
+return '%(sh)s -c "PATH=\\"/bin:$PATH\\";BUILDDIR=\\"%(builddir)s\\" 
%(makecmd)s -rsC %(location)s ' + targets + '"'
+
+class Project:
+
+def __init__(self, guid, target, project_path):
+self.guid = guid
+self.target = target
+self.path = project_path
+
+def emit(self):
+all_projects = []
+for module in self.gbuildparser.modules:
+projects = []
+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)
+projects.append(p)
+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)
+
+nmake_project_guid = '8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942'
+
+def get_dependency_libs(self, linked_libs, library_projects):
+dependency_libs = {}
+for linked_lib in linked_libs:
+for library_project in library_projects:
+if library_project.target['name'] == linked_lib:
+dependency_libs[library_project.guid] = library_project
+return dependency_libs
+
+def write_solution(self, solution_path, projects):
+print('Solution %s:' % 
os.path.splitext(os.path.basename(solution_path))[0], end='')
+library_projects = 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-24 Thread Federico Bassini
 bin/gbuild-to-ide |   27 +++
 1 file changed, 19 insertions(+), 8 deletions(-)

New commits:
commit 92c2c5f62d6e8962259e03424a40b6ac7ef32e7d
Author: Federico Bassini 
Date:   Tue Jan 24 22:03:27 2017 +0100

gbuild-to-ide: moduleDict targets -> all paths replaced with relative

in moduleDict[][] all absolute paths are replaced
with a relative path:
-include/libs relative to core(contained in json) directory
-json objects, makefile, relative to  directory

Change-Id: I5dd64942c2a4d6fc2f01037ee7417de91c41906a
Reviewed-on: https://gerrit.libreoffice.org/33506
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 783a94a..6d59d6a 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -40,15 +40,23 @@ class GbuildParser:
  'CppunitTest': re.compile('CppunitTest_(.*)\.mk')}
 _allheaders=[]
 @staticmethod
-def __split_includes(includes):
+def __split_includes(json_srcdir,includes):
 foundisystem = GbuildParser._isystempattern.findall(includes)
-foundincludes = [includeswitch.strip() for includeswitch in 
GbuildParser._includepattern.findall(includes) if
-len(includeswitch) > 2]
+foundincludes=[]
+for includeswitch in GbuildParser._includepattern.findall(includes):
+if len(includeswitch) > 2:
+if includeswitch.strip()[:len(json_srcdir)] == json_srcdir:
+
foundincludes.append(includeswitch.strip()[len(json_srcdir)+1:])
+else:
+foundincludes.append(includeswitch.strip())
+
+#foundincludes = [includeswitch.strip()[len(json_srcdir)+1:] for 
includeswitch in GbuildParser._includepattern.findall(includes) if
+#len(includeswitch) > 2]
 return (foundincludes, foundisystem)
 
 @staticmethod
-def __split_objs(objsline):
-return [obj for obj in objsline.strip().split(' ') if len(obj) > 0 and 
obj != 'CXXOBJECTS' and obj != '+=']
+def __split_objs(module,objsline):
+return [obj[len(module)+1:] for obj in objsline.strip().split(' ') if 
len(obj) > 0 and obj != 'CXXOBJECTS' and obj != '+=']
 
 @staticmethod
 def __split_defs(defsline):
@@ -95,9 +103,12 @@ class GbuildParser:
 jsondata = json.load(f)
 match = 
GbuildParser._buildpattern[jsontype].match(os.path.basename(jsondata['MAKEFILE'])).group(1)
 jsondata['location'] = 
os.path.dirname(jsondata['MAKEFILE'])
-
 module = jsondata['location'].split('/')[-1]
-(jsondata['include'], jsondata['include_sys']) = 
GbuildParser.__split_includes(jsondata['INCLUDE'])
+json_srcdir=jsondata['location'][:-(len(module)+1)]
+
jsondata['MAKEFILE']=jsondata['MAKEFILE'][len(jsondata['location'])+1:]
+jsondata['ILIBTARGET']='../' + 
jsondata['ILIBTARGET'][len(json_srcdir)+1:]
+
+(jsondata['include'], jsondata['include_sys']) = 
GbuildParser.__split_includes(json_srcdir, jsondata['INCLUDE'])
 jsondata['name'] = match
 jsondata['build_type'] = jsontype
 jsondata['target_name'] = module + '_' + jsontype + '_' + 
match
@@ -106,7 +117,7 @@ class GbuildParser:
 for i in ['CXXFLAGS', 'CFLAGS', 'OBJCFLAGS', 
'OBJCXXFLAGS']:
 jsondata[i] = GbuildParser.__split_flags(jsondata[i], 
jsondata[i+'APPEND'])
 for i in jsonSrc:
-jsondata[i] = 
sorted(GbuildParser.__split_objs(jsondata[i]))
+jsondata[i] = sorted(GbuildParser.__split_objs(module, 
jsondata[i]))
 
 if not module in moduleDict:
 moduleDict[module] = {'targets': [],'headers':{}}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-24 Thread Federico Bassini
 bin/gbuild-to-ide |  738 --
 1 file changed, 499 insertions(+), 239 deletions(-)

New commits:
commit c3580d08a6dded99f67c4a126b9b9c8fb08b26b8
Author: Federico Bassini 
Date:   Tue Jan 24 12:11:00 2017 +0100

gbuild-to-ide: replacement of the code

this patch do 2 things:
1a) create class testide, a duplicate of
VisualStudioIntegrationGeneration to work on it without touch the
real one
1b) place xcodeintegrationgenerator under testide, and under this
last one all of generators that work yet

Change-Id: Ib678134678ed19de9dcd9d1f47e8e7c16ae59f74
Reviewed-on: https://gerrit.libreoffice.org/33495
Reviewed-by: jan iversen 
Tested-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 90d2064..783a94a 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -66,6 +66,10 @@ class GbuildParser:
 def __split_flags(flagsline, flagslineappend):
 return [cxxflag.strip() for cxxflag in 
GbuildParser._warningpattern.sub('', '%s %s' % (flagsline, 
flagslineappend)).split(' ') if len(cxxflag) > 1]
 
+
+
+
+
 def parse(self):
 # Relation between json object and file extension
 jsonSrc = {
@@ -91,6 +95,7 @@ class GbuildParser:
 jsondata = json.load(f)
 match = 
GbuildParser._buildpattern[jsontype].match(os.path.basename(jsondata['MAKEFILE'])).group(1)
 jsondata['location'] = 
os.path.dirname(jsondata['MAKEFILE'])
+
 module = jsondata['location'].split('/')[-1]
 (jsondata['include'], jsondata['include_sys']) = 
GbuildParser.__split_includes(jsondata['INCLUDE'])
 jsondata['name'] = match
@@ -103,7 +108,6 @@ class GbuildParser:
 for i in jsonSrc:
 jsondata[i] = 
sorted(GbuildParser.__split_objs(jsondata[i]))
 
-module = jsondata['location'].split('/')[-1]
 if not module in moduleDict:
 moduleDict[module] = {'targets': [],'headers':{}}
 moduleDict[module]['targets'].append(jsondata)
@@ -115,35 +119,504 @@ class GbuildParser:
 self.modules[module] = moduleDict[module]
 return self
 
+
+
 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)
 
-allfiles={}
-for file in cmdResult2.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
+allfiles={}
+for file in cmdResult2.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):
+if modulename in self._allheaders: #for the modules that not have 
headers
+headersof = self._allheaders[modulename]
+else:
+headersof=[]
+return headersof
+
+class IdeIntegrationGenerator:
+
+def __init__(self, gbuildparser, ide):
+(self.gbuildparser, self.ide) = (gbuildparser, ide)
+
+def emit(self):
+pass
+
+class testide(IdeIntegrationGenerator):
+
+def __init__(self, gbuildparser, ide):
+IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
+self.toolset = self.retrieve_toolset()
+self.solution_directory = './windows'
+self.configurations = {
+'Build': {
+'build': self.module_make_command('%(target)s'),
+'clean': self.module_make_command('%(target)s.clean'),
+'rebuild': self.module_make_command('%(target)s.clean 
%(target)s')
+},
+'Unit Tests': {
+'build': self.module_make_command('unitcheck'),
+'clean': self.module_make_command('clean'),
+'rebuild': self.module_make_command('clean unitcheck'),
+},
+'Integration tests': {
+'build': self.module_make_command('unitcheck slowcheck 
screenshot subsequentcheck'),
+'clean': self.module_make_command('clean'),
+'rebuild': self.module_make_command('clean unitcheck slowcheck 
screenshot 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-23 Thread Miklos Vajna
 0 files changed

New commits:
commit a983ad7cf9a2d1720fdf1fcfcfbbd91c67d966e0
Author: Miklos Vajna 
Date:   Mon Jan 23 20:21:11 2017 +0100

gbuild-to-ide: restore exec bit

Lost in commit 115797f070888cbad93656dda8fa01ec6c98a3f5 (beginning of
support for CodeLite in gbuild-to-ide, 2017-01-19), probably
accidentally.

Change-Id: I641ba0b5e2960ff9b98403bd6379608f3e452c9c

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
old mode 100644
new mode 100755
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-22 Thread Noel Grandin
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 38f9082771b7842d056a04965bffd57cb655a558
Author: Noel Grandin 
Date:   Mon Jan 23 09:12:38 2017 +0200

didn't mean to commit that part

Change-Id: Ica8384b374e0d680704cba17a9d4c9f30ae08bf5

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index d4a32b2..90d2064 100644
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1,4 +1,4 @@
-#! /usr/local/bin/python3
+#! /usr/bin/env python3
 # -*- Mode: python; tab-width: 4; indent-tabs-mode: t -*-
 #
 # This file is part of the LibreOffice project.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide Makefile.in

2017-01-22 Thread Noel Grandin
 Makefile.in   |1 
 bin/gbuild-to-ide |   68 +-
 2 files changed, 68 insertions(+), 1 deletion(-)

New commits:
commit 115797f070888cbad93656dda8fa01ec6c98a3f5
Author: Noel Grandin 
Date:   Thu Jan 19 20:25:10 2017 +0200

beginning of support for CodeLite in gbuild-to-ide

Change-Id: I5640ad193f2766400554012383d6c910f2160378
Reviewed-on: https://gerrit.libreoffice.org/33396
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/Makefile.in b/Makefile.in
index 454755e..d01cbf4 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
old mode 100755
new mode 100644
index 22a08cd..d4a32b2
--- 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 = """
+
+  
+  
+
+  
+{0}
+  
+
+  
+  {1}
+
+
+  
+  {2}
+
+  
+
+"""
+codelite_projects1_template = """
+"""
+
+codelite_projects2_template = """
+"""
 
 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():
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-21 Thread jan Iversen
 bin/gbuild-to-ide |   54 +-
 1 file changed, 21 insertions(+), 33 deletions(-)

New commits:
commit ad98ba87cb799cd31822168afecbdf6692a9cba8
Author: jan Iversen 
Date:   Sun Jan 22 08:55:14 2017 +0100

gbuild-to-ide, final cleanup in parser.

Now the json file can be expanded with new keys, without
the need to touch parser.

Change-Id: I8182e8030e206e302258bd156d7392ff5c98f3d4

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 7cd2f44..22a08cd 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -89,39 +89,27 @@ class GbuildParser:
 for jsonfilename in os.listdir(os.path.join(self.workdir, 
'GbuildToJson', jsontype)):
 with open(os.path.join(self.workdir, 'GbuildToJson', jsontype, 
jsonfilename), 'r') as f:
 jsondata = json.load(f)
-
-(foundincludes, foundisystem) = 
GbuildParser.__split_includes(jsondata['INCLUDE'])
 match = 
GbuildParser._buildpattern[jsontype].match(os.path.basename(jsondata['MAKEFILE'])).group(1)
-location = os.path.dirname(jsondata['MAKEFILE'])
-
-# build Central data object (holds all json information is 
a easy accessible form
-obj = {'name': match,
-   'location': location,
-   'include' : foundincludes,
-   'include_sys' : foundisystem,
-   'defs': 
GbuildParser.__split_defs(jsondata['DEFS']),
-   'cxxflags': 
GbuildParser.__split_flags(jsondata['CXXFLAGS'], jsondata['CXXFLAGSAPPEND']),
-   'linked_libs' : 
jsondata['LINKED_LIBS'].strip().split(' '),
-   'cflags'  : 
GbuildParser.__split_flags(jsondata['CFLAGS'], jsondata['CFLAGSAPPEND']),
-   'ilibtarget'  : jsondata['ILIBTARGET'],
-'linked_static_libs' :  
jsondata['LINKED_STATIC_LIBS'],
-'linktarget' : jsondata['LINKTARGET'],
-'objcflags' :  
GbuildParser.__split_flags(jsondata['OBJCFLAGS'], jsondata['OBJCFLAGSAPPEND']),
-   'objcxxflags': 
GbuildParser.__split_flags(jsondata['OBJCXXFLAGS'], 
jsondata['OBJCXXFLAGSAPPEND']),
-   'build_type' : jsontype,
-   'target_name' : jsontype + '_' + match
-}
+jsondata['location'] = 
os.path.dirname(jsondata['MAKEFILE'])
+module = jsondata['location'].split('/')[-1]
+(jsondata['include'], jsondata['include_sys']) = 
GbuildParser.__split_includes(jsondata['INCLUDE'])
+jsondata['name'] = match
+jsondata['build_type'] = jsontype
+jsondata['target_name'] = module + '_' + jsontype + '_' + 
match
+jsondata['DEFS'] = 
GbuildParser.__split_defs(jsondata['DEFS'])
+jsondata['LINKED_LIBS'] = 
jsondata['LINKED_LIBS'].strip().split(' ')
+for i in ['CXXFLAGS', 'CFLAGS', 'OBJCFLAGS', 
'OBJCXXFLAGS']:
+jsondata[i] = GbuildParser.__split_flags(jsondata[i], 
jsondata[i+'APPEND'])
 for i in jsonSrc:
-obj[i] = sorted(GbuildParser.__split_objs(jsondata[i]))
+jsondata[i] = 
sorted(GbuildParser.__split_objs(jsondata[i]))
 
-module = location.split('/')[-1]
+module = jsondata['location'].split('/')[-1]
 if not module in moduleDict:
 moduleDict[module] = {'targets': [],'headers':{}}
-moduleDict[module]['targets'].append(obj)
+moduleDict[module]['targets'].append(jsondata)
 moduleDict[module]['headers'] =self.headers_of(module)
 
-
-moduleDict['include']={ 'targets': set(), 
'headers':self.headers_of('include')}
+moduleDict['include']={ 'targets': [], 
'headers':self.headers_of('include')}
 
 for module in sorted(moduleDict):
 self.modules[module] = moduleDict[module]
@@ -194,8 +182,8 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 defineset = set()
 for lib in modulelibs:
 for target in self.target_path[lib]:
-for i in target[0]['defs'].keys():
-tmp = str(i) +','+str(target[0]['defs'][i])
+for i in target[0]['DEFS'].keys():
+tmp = str(i) +','+str(target[0]['DEFS'][i])
 if tmp not in defineset:
 defineset.add(tmp)
 macrofile.write('\n'.join(defineset))
@@ -332,7 +320,7 @@ class 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-21 Thread jan Iversen
 bin/gbuild-to-ide |  183 ++
 1 file changed, 75 insertions(+), 108 deletions(-)

New commits:
commit 9da87ef8d9dadbd981f34f312ca446d59aa17a0f
Author: jan Iversen 
Date:   Sat Jan 21 20:16:40 2017 +0100

gbuild-to-ide clean replaced GbuildLinkTarget with dict

The class GbuildLinkTarget was removed and replaced by a dict.
This is first step in avoiding typing the json key names multiple times

Change-Id: I3a2006979929c5d21549693e51eb47df7233400d

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 3d2c685..7cd2f44 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -22,26 +22,6 @@ import traceback
 import collections
 import subprocess
 
-class GbuildLinkTarget:
-def __init__(self, name, location, sources, include, include_sys, defs, 
cxxobjects, cxxflags, linked_libs,
- asmobjects, cflags, gencobjects, gencxxobjects, ilibtarget, 
linked_static_libs, linktarget,
- objcflags, objcobjects, objcxxflags, objcxxobjects, 
yaccobjects, build_type):
-(self.name, self.location, self.include,
- self.include_sys, self.defs, self.cxxobjects,
- self.cxxflags, self.linked_libs,
- self.asmobjects, self.cflags, self.gencobjects,
- self.gencxxobjects, self.ilibtarget, self.linked_static_libs,
- self.linktarget, self.objcflags, self.objcobjects,
- self.objcxxflags, self.objcxxobjects, self.yaccobjects,
- self.build_type) = (name, location, include,
- include_sys, defs, cxxobjects,
- cxxflags, linked_libs, asmobjects,
- cflags, gencobjects, gencxxobjects,
- ilibtarget, linked_static_libs, linktarget,
- objcflags, objcobjects, objcxxflags,
- objcxxobjects, yaccobjects, build_type)
-self.target_name = self.build_type + '_' + self.name
-self.sources = sources
 
 
 class GbuildParser:
@@ -96,8 +76,6 @@ class GbuildParser:
'ASMOBJECTS': '.s',
'YACCOBJECTS': '.y',
'GENCOBJECTS': '.c',
-
-# not in GbuildLinkTarget
'COBJECTS':  '.c',
'FLEXOBJECTS': '.l',
'JAVAOBJECTS': '.java',
@@ -115,41 +93,31 @@ class GbuildParser:
 (foundincludes, foundisystem) = 
GbuildParser.__split_includes(jsondata['INCLUDE'])
 match = 
GbuildParser._buildpattern[jsontype].match(os.path.basename(jsondata['MAKEFILE'])).group(1)
 location = os.path.dirname(jsondata['MAKEFILE'])
-sources = {}
+
+# build Central data object (holds all json information is 
a easy accessible form
+obj = {'name': match,
+   'location': location,
+   'include' : foundincludes,
+   'include_sys' : foundisystem,
+   'defs': 
GbuildParser.__split_defs(jsondata['DEFS']),
+   'cxxflags': 
GbuildParser.__split_flags(jsondata['CXXFLAGS'], jsondata['CXXFLAGSAPPEND']),
+   'linked_libs' : 
jsondata['LINKED_LIBS'].strip().split(' '),
+   'cflags'  : 
GbuildParser.__split_flags(jsondata['CFLAGS'], jsondata['CFLAGSAPPEND']),
+   'ilibtarget'  : jsondata['ILIBTARGET'],
+'linked_static_libs' :  
jsondata['LINKED_STATIC_LIBS'],
+'linktarget' : jsondata['LINKTARGET'],
+'objcflags' :  
GbuildParser.__split_flags(jsondata['OBJCFLAGS'], jsondata['OBJCFLAGSAPPEND']),
+   'objcxxflags': 
GbuildParser.__split_flags(jsondata['OBJCXXFLAGS'], 
jsondata['OBJCXXFLAGSAPPEND']),
+   'build_type' : jsontype,
+   'target_name' : jsontype + '_' + match
+}
 for i in jsonSrc:
-if i in jsondata and len(jsondata[i]) > 0:
-sources[i] = 
sorted(GbuildParser.__split_objs(jsondata[i]))
-else:
-sources[i] = []
-
-# TODO: extend GbuildLinkTarget with new json keys
-# Find a better way instead on a zillion parameters
-newObj = GbuildLinkTarget(match,
-  location,
-  sources,
-  foundincludes,
-  foundisystem,
-  
GbuildParser.__split_defs(jsondata['DEFS']),
-   

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-20 Thread Federico Bassini
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1585415e7869d525b70751004c46ce008b4ef129
Author: Federico Bassini 
Date:   Thu Jan 19 09:49:15 2017 +0100

gbuild-to-ide.py - change directory for .sln,.vcxproj,.filters

this change the directory of all files .sln, . vcxproj,.filters to windows 
folder

i change only a variable VisualStudioIntegrationGenerator.solution_path 
from './' to './windows'.
i investigate in the .vcxproj, .filters, .sln if there are references to 
change but i don't find anything (all the files written in this files are an 
absolute path) and i test 'make vs2013-ide-integration'...
the files are exactly generated, i test in a windows machine and visual 
studio work perfectly...

Change-Id: I111c39173b95a6888c8d39058b1db4da7a9be206
Reviewed-on: https://gerrit.libreoffice.org/33301
Reviewed-by: jan iversen 
Tested-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index dae2f97..3d2c685 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -788,7 +788,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 def __init__(self, gbuildparser, ide):
 IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
 self.toolset = self.retrieve_toolset()
-self.solution_directory = './'
+self.solution_directory = './windows'
 self.configurations = {
 'Build': {
 'build': self.module_make_command('%(target)s'),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-18 Thread Federico Bassini
 bin/gbuild-to-ide |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 239e877d51399daedd315b6d1b31543e491169b6
Author: Federico Bassini 
Date:   Wed Jan 18 10:15:28 2017 +0100

gbuil-to-ide.py functions improvment

this patch improve the functions:
-find_all_headers -> make _allheaders a dict: _allheaders[''] 
contains the list of all headers for that module
-headers_of(modulename) -> it return the list of headers for that module, 
or a empty list for module that not have headers

Change-Id: I7e4e2bf063ccf6fd2e3e5155b58d2be2412480ba
Reviewed-on: https://gerrit.libreoffice.org/33255
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index c8cd067..dae2f97 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -154,7 +154,7 @@ class GbuildParser:
 
 
 moduleDict['include']={ 'targets': set(), 
'headers':self.headers_of('include')}
-# sort ['sources'] and ['headers'] for each module
+
 for module in sorted(moduleDict):
 self.modules[module] = moduleDict[module]
 return self
@@ -164,15 +164,21 @@ class GbuildParser:
 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)
 
-#decode from byte to string
-allfiles=[]
+allfiles={}
 for file in cmdResult2.splitlines():
-allfiles.append(file.decode())
+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):
-modulename_lenght=len(modulename)
-headersof = [element[modulename_lenght+1:] for element in 
self._allheaders if element.split('/')[0] == modulename]
+if modulename in self._allheaders: #for the modules that not have 
headers
+headersof = self._allheaders[modulename]
+else:
+headersof=[]
 return headersof
 
 class IdeIntegrationGenerator:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-17 Thread jan Iversen
 bin/gbuild-to-ide |   34 --
 1 file changed, 16 insertions(+), 18 deletions(-)

New commits:
commit 6cd57bc27ebb381adfe90da8420291b9cb19d91f
Author: jan Iversen 
Date:   Tue Jan 17 19:50:03 2017 +0100

gbuild-to-ide prepare for missing file types.

Expanded the parser to understand the new json keys.

Change-Id: I8ff91a9113a7b539a1d85e8ea936555825260ba0

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index cb809da..c8cd067 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -23,7 +23,7 @@ import collections
 import subprocess
 
 class GbuildLinkTarget:
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs,
+def __init__(self, name, location, sources, include, include_sys, defs, 
cxxobjects, cxxflags, linked_libs,
  asmobjects, cflags, gencobjects, gencxxobjects, ilibtarget, 
linked_static_libs, linktarget,
  objcflags, objcobjects, objcxxflags, objcxxobjects, 
yaccobjects, build_type):
 (self.name, self.location, self.include,
@@ -41,6 +41,7 @@ class GbuildLinkTarget:
  objcflags, objcobjects, objcxxflags,
  objcxxobjects, yaccobjects, build_type)
 self.target_name = self.build_type + '_' + self.name
+self.sources = sources
 
 
 class GbuildParser:
@@ -92,14 +93,12 @@ class GbuildParser:
'GENCXXOBJECTS': '.cxx', # remark is in workdir/GenCxxObject
'OBJCOBJECTS':   '.m',
'OBJCXXOBJECTS': '.mm',
-   'COBJECTS':  '.c',
-
-# gbuildtojson defines but does not fill these:
'ASMOBJECTS': '.s',
-   'GENCOBJECTS': '.c',
'YACCOBJECTS': '.y',
+   'GENCOBJECTS': '.c',
 
-   # gbuildtojson need to be extended to fill these:
+# not in GbuildLinkTarget
+   'COBJECTS':  '.c',
'FLEXOBJECTS': '.l',
'JAVAOBJECTS': '.java',
'PYTHONOBJECTS': '.py'
@@ -116,35 +115,36 @@ class GbuildParser:
 (foundincludes, foundisystem) = 
GbuildParser.__split_includes(jsondata['INCLUDE'])
 match = 
GbuildParser._buildpattern[jsontype].match(os.path.basename(jsondata['MAKEFILE'])).group(1)
 location = os.path.dirname(jsondata['MAKEFILE'])
-filesSorted = {}
+sources = {}
 for i in jsonSrc:
 if i in jsondata and len(jsondata[i]) > 0:
-filesSorted[i] = 
sorted(GbuildParser.__split_objs(jsondata[i]))
+sources[i] = 
sorted(GbuildParser.__split_objs(jsondata[i]))
 else:
-filesSorted[i] = []
+sources[i] = []
 
 # TODO: extend GbuildLinkTarget with new json keys
 # Find a better way instead on a zillion parameters
 newObj = GbuildLinkTarget(match,
   location,
+  sources,
   foundincludes,
   foundisystem,
   
GbuildParser.__split_defs(jsondata['DEFS']),
-  filesSorted['CXXOBJECTS'],
+  sources['CXXOBJECTS'],
   
GbuildParser.__split_flags(jsondata['CXXFLAGS'], jsondata['CXXFLAGSAPPEND']),
   
jsondata['LINKED_LIBS'].strip().split(' '),
-  filesSorted['ASMOBJECTS'],
+  sources['ASMOBJECTS'],
   
GbuildParser.__split_flags(jsondata['CFLAGS'], jsondata['CFLAGSAPPEND']),
-  filesSorted['GENCOBJECTS'],
-  filesSorted['GENCXXOBJECTS'],
+  sources['GENCOBJECTS'],
+  sources['GENCXXOBJECTS'],
   jsondata['ILIBTARGET'],
   jsondata['LINKED_STATIC_LIBS'],
   jsondata['LINKTARGET'],
   
GbuildParser.__split_flags(jsondata['OBJCFLAGS'], jsondata['OBJCFLAGSAPPEND']),
-  filesSorted['OBJCOBJECTS'],
+  sources['OBJCOBJECTS'],

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-17 Thread Federico Bassini
 bin/gbuild-to-ide |   34 +++---
 1 file changed, 23 insertions(+), 11 deletions(-)

New commits:
commit e81be49e242121e19a424cc467ec91adc82c7429
Author: Federico Bassini 
Date:   Tue Jan 17 09:14:22 2017 +0100

gbuild-to-ide - all headers add to moduleDict for each module

i added a key 'headers' in the moduleDict that contains a list of all the 
headers files (.hxx, .h, .hpp) fot that module...

moduleDict['']['headers']= list of all the 's headers files

i run "make debug-ide-integration" found 3 error:
i added also a if statement to skip 'include' module for eclipse and 
kdevelop...(2 error)
the 3° error leave untouched; it is at the line 495 'os.mkdir', the error 
say(for UnoControls module) Unocontrols/.kdev exist yet!

Update:
i have change the code as jan suggests!
i do 2 function:
-find_all_headers(): that call only one a subprocess and it founds all the  
headers file contents in core folder and save it in a list
-headers_of(modulename): it return a list of the headers only for the 
modulename parameter, it called in the assignment 
moduleDict[module]['headers']=...

this only create a process once! it's more faster :)

Change-Id: If05ce4104bcdd178c0c6a6f589fa0720d493dad6
Reviewed-on: https://gerrit.libreoffice.org/33208
Reviewed-by: jan iversen 
Tested-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index b2c23c8..cb809da 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -57,7 +57,7 @@ class GbuildParser:
 _buildpattern = {'Library': re.compile('Library_(.*)\.mk'),
  'Executable': re.compile('Executable_(.*)\.mk'),
  'CppunitTest': re.compile('CppunitTest_(.*)\.mk')}
-
+_allheaders=[]
 @staticmethod
 def __split_includes(includes):
 foundisystem = GbuildParser._isystempattern.findall(includes)
@@ -107,6 +107,7 @@ class GbuildParser:
 
 
 moduleDict = {}
+self.find_all_headers()
 for jsontype in ['Library', 'Executable', 'CppunitTest']:
 for jsonfilename in os.listdir(os.path.join(self.workdir, 
'GbuildToJson', jsontype)):
 with open(os.path.join(self.workdir, 'GbuildToJson', jsontype, 
jsonfilename), 'r') as f:
@@ -147,26 +148,32 @@ class GbuildParser:
   jsontype)
 module = location.split('/')[-1]
 if not module in moduleDict:
-moduleDict[module] = {'targets': set()}
+moduleDict[module] = {'targets': set(),'headers':{}}
 moduleDict[module]['targets'] |= set([newObj])
+moduleDict[module]['headers'] =self.headers_of(module)
 
-moduleDict['include']={'headers':self.find_all_headers_include_git(), 
'targets': {}}
 
+moduleDict['include']={ 'targets': set(), 
'headers':self.headers_of('include')}
 # sort ['sources'] and ['headers'] for each module
 for module in sorted(moduleDict):
 self.modules[module] = moduleDict[module]
 return self
 
+def find_all_headers(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)
+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)
 
 #decode from byte to string
 allfiles=[]
 for file in cmdResult2.splitlines():
-allfiles.append(file.decode()[8:])
-return allfiles
+allfiles.append(file.decode())
+self._allheaders = allfiles
+
+def headers_of(self,modulename):
+modulename_lenght=len(modulename)
+headersof = [element[modulename_lenght+1:] for element in 
self._allheaders if element.split('/')[0] == modulename]
+return headersof
 
 class IdeIntegrationGenerator:
 
@@ -298,13 +305,15 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 def emit(self):
 self.target_path = {}
 for m in self.gbuildparser.modules:
+if m == 'include':
+continue
 for target in self.gbuildparser.modules[m]['targets']:
 for cxx in target.cxxobjects:
 path = '/'.join(cxx.split('/')[:-1])
 if path not in self.target_path:
 self.target_path[path] = set()
 self.target_path[path] |= 

[Libreoffice-commits] core.git: bin/gbuild-to-ide solenv/gbuild

2017-01-16 Thread jan Iversen
 bin/gbuild-to-ide |6 --
 solenv/gbuild/extensions/post_GbuildToJson.mk |7 ---
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 1fb2947aea679afeb061b38538c0a6ea8b3254a2
Author: jan Iversen 
Date:   Mon Jan 16 19:01:18 2017 +0100

post_GbuildToJson.mk, extended with extra file types

Extended the call to gbuildtojson, with extra file types.
Some filetypes still need data collection, this
is noted in the file as todo.

Change-Id: I3e832f82656236d42d1d7b59bf3ac2925c5b1568

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 47eaebd..b2c23c8 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -92,14 +92,14 @@ class GbuildParser:
'GENCXXOBJECTS': '.cxx', # remark is in workdir/GenCxxObject
'OBJCOBJECTS':   '.m',
'OBJCXXOBJECTS': '.mm',
+   'COBJECTS':  '.c',
 
-# gbuildtojson defines but does not fill these:
+# gbuildtojson defines but does not fill these:
'ASMOBJECTS': '.s',
'GENCOBJECTS': '.c',
'YACCOBJECTS': '.y',
 
# gbuildtojson need to be extended to fill these:
-   'COBJECTS': '.c',
'FLEXOBJECTS': '.l',
'JAVAOBJECTS': '.java',
'PYTHONOBJECTS': '.py'
@@ -122,6 +122,8 @@ class GbuildParser:
 else:
 filesSorted[i] = []
 
+# TODO: extend GbuildLinkTarget with new json keys
+# Find a better way instead on a zillion parameters
 newObj = GbuildLinkTarget(match,
   location,
   foundincludes,
diff --git a/solenv/gbuild/extensions/post_GbuildToJson.mk 
b/solenv/gbuild/extensions/post_GbuildToJson.mk
index 89a4c84..512a871 100644
--- a/solenv/gbuild/extensions/post_GbuildToJson.mk
+++ b/solenv/gbuild/extensions/post_GbuildToJson.mk
@@ -14,9 +14,6 @@
 #   --ASMOBJECTS
 #   --GENCOBJECTS
 #   --YACCOBJECTS
-#
-# add new arguments:
-#   --COBJECTS
 #   --FLEXOBJECTS
 #   --JAVAOBJECTS
 #   --PYTHONOBJECTS
@@ -61,6 +58,10 @@ $(call gb_Executable_get_command,gbuildtojson) \
 --asmobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(ASMOBJECTS)) \
 --gencobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(GENCOBJECTS)) \
 --gencxxobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(GENCXXOBJECTS)) \
+--cobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(COBJECTS)) \
+--flexobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(FLEXOBJECTS)) \
+--javaobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(JAVAOBJECTS)) \
+--pythonobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(PYTHONOBJECTS)) \
 --cflags=$(call var2file,$(shell $(gb_MKTEMP)),100,$(T_CFLAGS)) \
 --cflagsappend=$(call var2file,$(shell $(gb_MKTEMP)),100,$(T_CFLAGS_APPEND)) \
 --cxxflags=$(call var2file,$(shell $(gb_MKTEMP)),100,$(T_CXXFLAGS)) \
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-16 Thread jan Iversen
 bin/gbuild-to-ide |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit b7e6f68858198cef294774e85134088828c742c3
Author: jan Iversen 
Date:   Mon Jan 16 18:29:52 2017 +0100

gbuild-to-ide, temporary fix

added test if key is in json file,
this is needed at least temporary.

Change-Id: I6fca2dff7fd198ac6b324869146c14de5f38b414

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index cf44d5e..47eaebd 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -117,9 +117,7 @@ class GbuildParser:
 location = os.path.dirname(jsondata['MAKEFILE'])
 filesSorted = {}
 for i in jsonSrc:
-if len(jsondata[i]) > 0:
-if jsonSrc[i] == '?':
-raise Exception('type need conversion')
+if i in jsondata and len(jsondata[i]) > 0:
 filesSorted[i] = 
sorted(GbuildParser.__split_objs(jsondata[i]))
 else:
 filesSorted[i] = []
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide solenv/gbuild solenv/gbuildtojson

2017-01-16 Thread jan Iversen
 bin/gbuild-to-ide |   20 -
 solenv/gbuild/extensions/post_GbuildToJson.mk |   18 
 solenv/gbuildtojson/gbuildtojson.cxx  |   29 --
 3 files changed, 32 insertions(+), 35 deletions(-)

New commits:
commit dd7539262d5d1a25da0856f8e1965cf0e4351ff9
Author: jan Iversen 
Date:   Mon Jan 16 18:23:00 2017 +0100

gbuildtojson prepare for new filetypes.

gbuild-to-ide now contains a dict with json name -> file extension
post_GbuildToJson.ml contains a todo list (missing files, new arguments)
gbuildtojson.cxx made resistent (no extra argument list to maintain)

Change-Id: I7f346f606ed5fba0a1eaffdd38454b484cecfcf5

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 7186ed4..cf44d5e 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -87,15 +87,23 @@ class GbuildParser:
 
 def parse(self):
 # Relation between json object and file extension
-# Missing relations: .hxx  .hpp .hrc  .src  .java  .py  .h  .s  .c  
.pl  .S  .ui  .l  .cpp
-jsonSrc = {'ASMOBJECTS':'.asm',
+jsonSrc = {
'CXXOBJECTS':'.cxx',
-   'GENCOBJECTS':   '?',
-   'GENCXXOBJECTS': '.cxx', # this does not sound right
+   'GENCXXOBJECTS': '.cxx', # remark is in workdir/GenCxxObject
'OBJCOBJECTS':   '.m',
'OBJCXXOBJECTS': '.mm',
-   'YACCOBJECTS':   '.y'
-   }
+
+# gbuildtojson defines but does not fill these:
+   'ASMOBJECTS': '.s',
+   'GENCOBJECTS': '.c',
+   'YACCOBJECTS': '.y',
+
+   # gbuildtojson need to be extended to fill these:
+   'COBJECTS': '.c',
+   'FLEXOBJECTS': '.l',
+   'JAVAOBJECTS': '.java',
+   'PYTHONOBJECTS': '.py'
+  }
 
 
 moduleDict = {}
diff --git a/solenv/gbuild/extensions/post_GbuildToJson.mk 
b/solenv/gbuild/extensions/post_GbuildToJson.mk
index d0e8611..89a4c84 100644
--- a/solenv/gbuild/extensions/post_GbuildToJson.mk
+++ b/solenv/gbuild/extensions/post_GbuildToJson.mk
@@ -7,6 +7,24 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
+
+# Outstanding work:
+#
+# fill files names in:
+#   --ASMOBJECTS
+#   --GENCOBJECTS
+#   --YACCOBJECTS
+#
+# add new arguments:
+#   --COBJECTS
+#   --FLEXOBJECTS
+#   --JAVAOBJECTS
+#   --PYTHONOBJECTS
+#
+# Add black listed modules a json files (--BLACKLIST)
+#
+# Reduce number of blacklisted modules
+
 ifneq ($(filter gbuildtojson,$(MAKECMDGOALS)),)
 
 ifeq ($(MAKE_VERSION),3.81)
diff --git a/solenv/gbuildtojson/gbuildtojson.cxx 
b/solenv/gbuildtojson/gbuildtojson.cxx
index 96d38ea..7c2429e 100644
--- a/solenv/gbuildtojson/gbuildtojson.cxx
+++ b/solenv/gbuildtojson/gbuildtojson.cxx
@@ -17,30 +17,6 @@
 #include 
 
 using namespace std;
-static const list validargs = {
-"makefile",
-"linktarget",
-"ilibtarget",
-"cxxobjects",
-"yaccobjects",
-"objcobjects",
-"objcxxobjects",
-"asmobjects",
-"gencobjects",
-"gencxxobjects",
-"cflags",
-"cflagsappend",
-"cxxflags",
-"cxxflagsappend",
-"objcflags",
-"objcflagsappend",
-"objcxxflags",
-"objcxxflagsappend",
-"defs",
-"include",
-"linked_libs",
-"linked_static_libs"
-};
 
 int main(int argc, char** argv)
 {
@@ -61,11 +37,6 @@ int main(int argc, char** argv)
 return 2;
 }
 const string argname(arg.substr(2, eqpos-2));
-if(find(validargs.begin(), validargs.end(), argname) == 
validargs.end())
-{
-cerr << "Option" << argname << "invalid." << endl;
-return 3;
-}
 vartofile[argname] = arg.substr(eqpos+1, string::npos);
 }
 cout << "{";
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-16 Thread jan Iversen
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d602f404883f7303a927668dcef32eaf17a01f3f
Author: jan Iversen 
Date:   Mon Jan 16 15:20:12 2017 +0100

gbuild-to-ide, typo

create_include_pathks --> create_include_paths

Change-Id: I23a88e4c3685306beecc34df72fe6691fde042ca

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index a68a73a..7186ed4 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -173,7 +173,7 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 def __init__(self, gbuildparser, ide):
 IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
 
-def create_include_pathks(self):
+def create_include_path(self):
 for module in self.gbuildparser.modules:
 if module == 'include':
 continue
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-16 Thread jan Iversen
 bin/gbuild-to-ide |   88 --
 1 file changed, 20 insertions(+), 68 deletions(-)

New commits:
commit cc1698665011457147b1f15ea00f04665a05
Author: jan Iversen 
Date:   Mon Jan 16 14:00:51 2017 +0100

gbuild-to-ide xcode-ide-integration

change target to use "make" for now.
this patch enables debug/build in xcode.

Change-Id: I1bac15beb77af35d7348eab9e645a1bf3522c2c8

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index d9e2535..a68a73a 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -143,6 +143,8 @@ class GbuildParser:
 moduleDict[module]['targets'] |= set([newObj])
 
 moduleDict['include']={'headers':self.find_all_headers_include_git(), 
'targets': {}}
+
+# sort ['sources'] and ['headers'] for each module
 for module in sorted(moduleDict):
 self.modules[module] = moduleDict[module]
 return self
@@ -171,7 +173,7 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 def __init__(self, gbuildparser, ide):
 IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
 
-def create_include_paths(self):
+def create_include_pathks(self):
 for module in self.gbuildparser.modules:
 if module == 'include':
 continue
@@ -548,7 +550,7 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 def emit(self):
 rootId = 'X001'
 mainGroupId = 'X002'
-self.rootObj = {'attributes': {'LastUpgradeCheck': '0500',
+self.rootObj = {'attributes': {'LastUpgradeCheck': '0820',
'ORGANIZATIONNAME': 'LibreOffice',
'TargetAttributes': {}},
 'compatibilityVersion': 'Xcode 3.2',
@@ -557,7 +559,7 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 'hasScannedForEncodings': 0,
 'knownRegions': ['en'],
 'mainGroup': mainGroupId,
-'projectDirPath': '',
+'projectDirPath': self.gbuildparser.srcdir,
 'projectRoot': '',
 'buildConfigurationList': '',
 'targets': []}
@@ -569,22 +571,15 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
mainGroupId : mainGroup},
'rootObject': rootId}
 for module in self.gbuildparser.modules:
+if module == 'include':
+continue
 sourceId, self.sourceObj = self.define_pbxgroup('Sources')
 includeId, self.includeObj = self.define_pbxgroup('Headers')
-targetId, targetObj = self.define_pbxgroup('Targets')
-targetLibId, self.targetLibObj = self.define_pbxgroup('Libraries')
-targetCUId, self.targetCUObj = self.define_pbxgroup('Unittests')
-targetExeId, self.targetExeObj = self.define_pbxgroup('Executable')
 moduleId, self.moduleObj = self.define_pbxgroup(module)
 
-targetObj['children'] = [targetLibId, targetCUId,targetExeId]
-self.moduleObj['children'] = [sourceId, includeId, targetId]
+self.moduleObj['children'] = [sourceId, includeId]
 pbxproj['objects'].update( {sourceId: self.sourceObj,
 includeId: self.includeObj,
-targetId: targetObj,
-targetLibId: self.targetLibObj,
-targetCUId: self.targetCUObj,
-targetExeId: self.targetExeObj,
 moduleId: self.moduleObj})
 mainGroup['children'].append(moduleId)
 
@@ -645,16 +640,6 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 file.write('""')
 
 
-
-
-def generate_ref_target(self, modulename):
-result = {'isa': 'PBXFileReference',
-  'explicitFileType': 'compiled.mach-o.executable',
-  'includeInIndex': 0,
-  'path': modulename.name,
-  'sourceTree': 'BUILT_PRODUCTS_DIR'}
-return result
-
 def generate_target(self, modulename):
 if modulename.build_type == 'Library':
 product = 'com.apple.product-type.library.dynamic'
@@ -665,15 +650,16 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 else:
 product = 'com.apple.product-type.something'
 
-result = {'isa': 'PBXNativeTarget',
+result = {'isa': 'PBXLegacyTarget',
   'buildConfigurationList': self.configurationListId,
-  'buildPhases': [self.sourcesBuildPhaseId, 
self.copyBuildPhaseId],
-  'buildRules': [],
+  

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-16 Thread Federico Bassini
 bin/gbuild-to-ide |   37 ++---
 1 file changed, 30 insertions(+), 7 deletions(-)

New commits:
commit de409aeed2e1efad47a25794d7a1ffba0272e35c
Author: Federico Bassini 
Date:   Mon Jan 16 12:08:54 2017 +0100

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[]['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 
Tested-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 2d9e721..d9e2535 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -20,6 +20,7 @@ import xml.etree.ElementTree as ET
 import xml.dom.minidom as minidom
 import traceback
 import collections
+import subprocess
 
 class GbuildLinkTarget:
 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([newObj])
 
+moduleDict['include']={'headers':self.find_all_headers_include_git(), 
'targets': {}}
 for module in sorted(moduleDict):
 self.modules[module] = moduleDict[module]
 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:
 
 def __init__(self, gbuildparser, ide):
@@ -161,6 +173,8 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 
 def create_include_paths(self):
 for module in self.gbuildparser.modules:
+if module == 'include':
+continue
 modulepath = os.path.join(self.gbuildparser.builddir, module)
 includedirfile = open(os.path.join(modulepath, 
'.eclipsesettingfile'), 'w')
 modulelibs = []
@@ -177,6 +191,8 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 
 def create_macros(self):
 for module in self.gbuildparser.modules:
+if module == 'include':
+continue
 modulepath = os.path.join(self.gbuildparser.builddir, module)
 macrofile = open(os.path.join(modulepath, '.macros'), 'w')
 modulelibs = []
@@ -233,6 +249,8 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 """
 
 for module in self.gbuildparser.modules:
+if module == 'include':
+continue
 tempxml = []
 modulepath = os.path.join(self.gbuildparser.builddir, module)
 
@@ -832,13 +850,14 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 for module in self.gbuildparser.modules:
 projects = []
 module_directory = os.path.join(self.solution_directory, module)
-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)
-projects.append(p)
-self.write_solution(os.path.join(module_directory, '%s.sln' % 
module), projects)
-all_projects += projects
+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)
+projects.append(p)
+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-commits] core.git: bin/gbuild-to-ide

2017-01-14 Thread jan Iversen
 bin/gbuild-to-ide |   36 
 1 file changed, 28 insertions(+), 8 deletions(-)

New commits:
commit f963c33ddcc2d3f70cc927104d6d1c3ed4ef9b27
Author: jan Iversen 
Date:   Sat Jan 14 15:57:00 2017 +0100

gbuild-to-ide, prepare for more file types.

The structure how to capture new file types is in place,
now search need to start in post_Gbuildtojson for missing/wrong macros.

Change-Id: I9f97a6181c24d2cffbb004ee660c9cfbf5d0a099

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index cf673e3..2d9e721 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -21,7 +21,6 @@ import xml.dom.minidom as minidom
 import traceback
 import collections
 
-
 class GbuildLinkTarget:
 def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs,
  asmobjects, cflags, gencobjects, gencxxobjects, ilibtarget, 
linked_static_libs, linktarget,
@@ -86,6 +85,18 @@ class GbuildParser:
 return [cxxflag.strip() for cxxflag in 
GbuildParser._warningpattern.sub('', '%s %s' % (flagsline, 
flagslineappend)).split(' ') if len(cxxflag) > 1]
 
 def parse(self):
+# Relation between json object and file extension
+# Missing relations: .hxx  .hpp .hrc  .src  .java  .py  .h  .s  .c  
.pl  .S  .ui  .l  .cpp
+jsonSrc = {'ASMOBJECTS':'.asm',
+   'CXXOBJECTS':'.cxx',
+   'GENCOBJECTS':   '?',
+   'GENCXXOBJECTS': '.cxx', # this does not sound right
+   'OBJCOBJECTS':   '.m',
+   'OBJCXXOBJECTS': '.mm',
+   'YACCOBJECTS':   '.y'
+   }
+
+
 moduleDict = {}
 for jsontype in ['Library', 'Executable', 'CppunitTest']:
 for jsonfilename in os.listdir(os.path.join(self.workdir, 
'GbuildToJson', jsontype)):
@@ -95,26 +106,35 @@ class GbuildParser:
 (foundincludes, foundisystem) = 
GbuildParser.__split_includes(jsondata['INCLUDE'])
 match = 
GbuildParser._buildpattern[jsontype].match(os.path.basename(jsondata['MAKEFILE'])).group(1)
 location = os.path.dirname(jsondata['MAKEFILE'])
+filesSorted = {}
+for i in jsonSrc:
+if len(jsondata[i]) > 0:
+if jsonSrc[i] == '?':
+raise Exception('type need conversion')
+filesSorted[i] = 
sorted(GbuildParser.__split_objs(jsondata[i]))
+else:
+filesSorted[i] = []
+
 newObj = GbuildLinkTarget(match,
   location,
   foundincludes,
   foundisystem,
   
GbuildParser.__split_defs(jsondata['DEFS']),
-  
sorted(GbuildParser.__split_objs(jsondata['CXXOBJECTS'])),
+  filesSorted['CXXOBJECTS'],
   
GbuildParser.__split_flags(jsondata['CXXFLAGS'], jsondata['CXXFLAGSAPPEND']),
   
jsondata['LINKED_LIBS'].strip().split(' '),
-  sorted(jsondata['ASMOBJECTS']),
+  filesSorted['ASMOBJECTS'],
   
GbuildParser.__split_flags(jsondata['CFLAGS'], jsondata['CFLAGSAPPEND']),
-  sorted(jsondata['GENCOBJECTS']),
-  
sorted(jsondata['GENCXXOBJECTS']),
+  filesSorted['GENCOBJECTS'],
+  filesSorted['GENCXXOBJECTS'],
   jsondata['ILIBTARGET'],
   jsondata['LINKED_STATIC_LIBS'],
   jsondata['LINKTARGET'],
   
GbuildParser.__split_flags(jsondata['OBJCFLAGS'], jsondata['OBJCFLAGSAPPEND']),
-  sorted(jsondata['OBJCOBJECTS']),
+  filesSorted['OBJCOBJECTS'],
   
GbuildParser.__split_flags(jsondata['OBJCXXFLAGS'], 
jsondata['OBJCXXFLAGSAPPEND']),
-  
sorted(jsondata['OBJCXXOBJECTS']),
-  sorted(jsondata['YACCOBJECTS']),
+  filesSorted['OBJCXXOBJECTS'],
+  filesSorted['YACCOBJECTS'],
   

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-14 Thread jan Iversen
 bin/gbuild-to-ide |   45 +
 1 file changed, 25 insertions(+), 20 deletions(-)

New commits:
commit 2a4b291d3bfb378776388f67670d877c658fce47
Author: jan Iversen 
Date:   Sat Jan 14 12:53:51 2017 +0100

gbuild-to-ide GbuildParser cleaned

Removed target_by_path.
All targets listing is now via
.modules[*]['targets']

Eclipse & Kdevelop classes updated.

Change-Id: I71ec088cf2e7eeb51ec68517c22bff9ddf44

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index afba068..cf673e3 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -49,7 +49,7 @@ class GbuildParser:
 self.binpath = os.path.dirname(os.environ['GPERF']) # woha, this is 
quite a hack
 (self.srcdir, self.builddir, self.instdir, self.workdir) = 
(os.environ['SRCDIR'], os.environ['BUILDDIR'],
 
os.environ['INSTDIR'], os.environ['WORKDIR'])
-(self.modules, self.target_by_path) = (collections.OrderedDict(), 
collections.OrderedDict())
+self.modules = collections.OrderedDict()
 
 _includepattern = re.compile('-I(\S+)')
 _isystempattern = re.compile('-isystem\s*(\S+)')
@@ -119,22 +119,10 @@ class GbuildParser:
 module = location.split('/')[-1]
 if not module in moduleDict:
 moduleDict[module] = {'targets': set()}
-moduleDict[module]['targets'] |= set([newObj])
+moduleDict[module]['targets'] |= set([newObj])
 
 for module in sorted(moduleDict):
 self.modules[module] = moduleDict[module]
-for m in self.modules:
-for target in self.modules[m]['targets']:
-for cxx in target.cxxobjects:
-path = '/'.join(cxx.split('/')[:-1])
-if path not in self.target_by_path:
-self.target_by_path[path] = set()
-self.target_by_path[path] |= set([target])
-for path in self.target_by_path:
-x = self.target_by_path[path]
-if path != '' and len(set(self.target_by_path[path])) > 1:
-print('fdo#70422: multiple target use dir %s: %s' % (
-path, ', '.join([target.target_name for target in 
set(self.target_by_path[path])])))
 return self
 
 
@@ -156,12 +144,12 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 modulepath = os.path.join(self.gbuildparser.builddir, module)
 includedirfile = open(os.path.join(modulepath, 
'.eclipsesettingfile'), 'w')
 modulelibs = []
-for lib in self.gbuildparser.target_by_path.keys():
+for lib in self.target_path.keys():
 if lib.startswith(module+'/'):
 modulelibs.append(lib)
 include = set()
 for lib in modulelibs:
-for target in self.gbuildparser.target_by_path[lib]:
+for target in self.target_path[lib]:
 include |= set(target.include)
 includedirfile.write('\n'.join(include))
 includedirfile.close()
@@ -172,13 +160,13 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 modulepath = os.path.join(self.gbuildparser.builddir, module)
 macrofile = open(os.path.join(modulepath, '.macros'), 'w')
 modulelibs = []
-for lib in self.gbuildparser.target_by_path.keys():
+for lib in self.target_path.keys():
 if lib.startswith(module+'/'):
 modulelibs.append(lib)
 define = []
 defineset = set()
 for lib in modulelibs:
-for target in self.gbuildparser.target_by_path[lib]:
+for target in self.target_path[lib]:
 for i in target.defs.keys():
 tmp = str(i) +','+str(target.defs[i])
 if tmp not in defineset:
@@ -260,6 +248,14 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 os.remove(os.path.join(modulepath, '.macros'))
 
 def emit(self):
+self.target_path = {}
+for m in self.gbuildparser.modules:
+for target in self.gbuildparser.modules[m]['targets']:
+for cxx in target.cxxobjects:
+path = '/'.join(cxx.split('/')[:-1])
+if path not in self.target_path:
+self.target_path[path] = set()
+self.target_path[path] |= set([target])
 self.create_include_paths()
 self.create_macros()
 self.create_settings_file()
@@ -474,7 +470,7 @@ VersionControl=kdevgit
 def write_includepaths(self, path):
 includedirfile = open(os.path.join(path, '.kdev_include_paths'), 'w')
 include = set()
-

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-14 Thread jan Iversen
 bin/gbuild-to-ide |   84 --
 1 file changed, 44 insertions(+), 40 deletions(-)

New commits:
commit 9cb3b064e55fcb8d44698bec7aae76edd44b06a3
Author: jan Iversen 
Date:   Sat Jan 14 10:02:28 2017 +0100

gbuild-to-ide cleanup GbuildParser

Removed .files replaced by
.modules[*]['targets']

Affected generators updated.

Change-Id: I4bf4cb5a23ba0b48b11adb1795c0a4f9dfbb0d3a

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 287aeeb..afba068 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -49,8 +49,7 @@ class GbuildParser:
 self.binpath = os.path.dirname(os.environ['GPERF']) # woha, this is 
quite a hack
 (self.srcdir, self.builddir, self.instdir, self.workdir) = 
(os.environ['SRCDIR'], os.environ['BUILDDIR'],
 
os.environ['INSTDIR'], os.environ['WORKDIR'])
-(self.modules, self.files) = (collections.OrderedDict(), [])
-self.target_by_path = collections.OrderedDict()
+(self.modules, self.target_by_path) = (collections.OrderedDict(), 
collections.OrderedDict())
 
 _includepattern = re.compile('-I(\S+)')
 _isystempattern = re.compile('-isystem\s*(\S+)')
@@ -87,6 +86,7 @@ class GbuildParser:
 return [cxxflag.strip() for cxxflag in 
GbuildParser._warningpattern.sub('', '%s %s' % (flagsline, 
flagslineappend)).split(' ') if len(cxxflag) > 1]
 
 def parse(self):
+moduleDict = {}
 for jsontype in ['Library', 'Executable', 'CppunitTest']:
 for jsonfilename in os.listdir(os.path.join(self.workdir, 
'GbuildToJson', jsontype)):
 with open(os.path.join(self.workdir, 'GbuildToJson', jsontype, 
jsonfilename), 'r') as f:
@@ -94,48 +94,47 @@ class GbuildParser:
 
 (foundincludes, foundisystem) = 
GbuildParser.__split_includes(jsondata['INCLUDE'])
 match = 
GbuildParser._buildpattern[jsontype].match(os.path.basename(jsondata['MAKEFILE'])).group(1)
+location = os.path.dirname(jsondata['MAKEFILE'])
 newObj = GbuildLinkTarget(match,
-  
os.path.dirname(jsondata['MAKEFILE']),
+  location,
   foundincludes,
   foundisystem,
   
GbuildParser.__split_defs(jsondata['DEFS']),
-  
GbuildParser.__split_objs(jsondata['CXXOBJECTS']),
+  
sorted(GbuildParser.__split_objs(jsondata['CXXOBJECTS'])),
   
GbuildParser.__split_flags(jsondata['CXXFLAGS'], jsondata['CXXFLAGSAPPEND']),
   
jsondata['LINKED_LIBS'].strip().split(' '),
-  jsondata['ASMOBJECTS'],
+  sorted(jsondata['ASMOBJECTS']),
   
GbuildParser.__split_flags(jsondata['CFLAGS'], jsondata['CFLAGSAPPEND']),
-  jsondata['GENCOBJECTS'],
-  jsondata['GENCXXOBJECTS'],
+  sorted(jsondata['GENCOBJECTS']),
+  
sorted(jsondata['GENCXXOBJECTS']),
   jsondata['ILIBTARGET'],
   jsondata['LINKED_STATIC_LIBS'],
   jsondata['LINKTARGET'],
   
GbuildParser.__split_flags(jsondata['OBJCFLAGS'], jsondata['OBJCFLAGSAPPEND']),
-  jsondata['OBJCOBJECTS'],
+  sorted(jsondata['OBJCOBJECTS']),
   
GbuildParser.__split_flags(jsondata['OBJCXXFLAGS'], 
jsondata['OBJCXXFLAGSAPPEND']),
-  jsondata['OBJCXXOBJECTS'],
-  jsondata['YACCOBJECTS'],
+  
sorted(jsondata['OBJCXXOBJECTS']),
+  sorted(jsondata['YACCOBJECTS']),
   jsontype)
-self.files.append(newObj)
+module = location.split('/')[-1]
+if not module in moduleDict:
+moduleDict[module] = {'targets': set()}
+moduleDict[module]['targets'] |= set([newObj])
 
-moduleDict = {}
-for target in self.files:
-module = target.location.split('/')[-1]
- 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-14 Thread jan Iversen
 bin/gbuild-to-ide |   86 +++---
 1 file changed, 50 insertions(+), 36 deletions(-)

New commits:
commit b6e6d2d31da7d6dc37a7ba949bd7d09f8f4d7fc3
Author: jan Iversen 
Date:   Sat Jan 14 09:28:08 2017 +0100

gbuild-to-ide added control of platforms.

The debug generator is extended to build IDE for all platforms,
these IDE will of course not be useable, but it gives a security
that the script does not break.

Removed target_by_location from GbuildParser, to simplify that
class.

Change-Id: Ie41ca3d15632104195821b2d73c57ba918f9

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 12f107c..287aeeb 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -47,21 +47,22 @@ class GbuildParser:
 def __init__(self, makecmd):
 self.makecmd = makecmd
 self.binpath = os.path.dirname(os.environ['GPERF']) # woha, this is 
quite a hack
-(self.srcdir, self.builddir, self.instdir, self.workdir) = 
(os.environ['SRCDIR'], os.environ['BUILDDIR'], os.environ['INSTDIR'], 
os.environ['WORKDIR'])
-(self.modulenamelist, self.files) = ([], [])
-(self.target_by_path, self.target_by_location) = 
(collections.OrderedDict(), collections.OrderedDict())
-
-includepattern = re.compile('-I(\S+)')
-isystempattern = re.compile('-isystem\s*(\S+)')
-warningpattern = re.compile('-W\S+')
-buildpattern = {'Library': re.compile('Library_(.*)\.mk'),
-'Executable': re.compile('Executable_(.*)\.mk'),
-'CppunitTest': re.compile('CppunitTest_(.*)\.mk')}
+(self.srcdir, self.builddir, self.instdir, self.workdir) = 
(os.environ['SRCDIR'], os.environ['BUILDDIR'],
+
os.environ['INSTDIR'], os.environ['WORKDIR'])
+(self.modules, self.files) = (collections.OrderedDict(), [])
+self.target_by_path = collections.OrderedDict()
+
+_includepattern = re.compile('-I(\S+)')
+_isystempattern = re.compile('-isystem\s*(\S+)')
+_warningpattern = re.compile('-W\S+')
+_buildpattern = {'Library': re.compile('Library_(.*)\.mk'),
+ 'Executable': re.compile('Executable_(.*)\.mk'),
+ 'CppunitTest': re.compile('CppunitTest_(.*)\.mk')}
 
 @staticmethod
 def __split_includes(includes):
-foundisystem = GbuildParser.isystempattern.findall(includes)
-foundincludes = [includeswitch.strip() for includeswitch in 
GbuildParser.includepattern.findall(includes) if
+foundisystem = GbuildParser._isystempattern.findall(includes)
+foundincludes = [includeswitch.strip() for includeswitch in 
GbuildParser._includepattern.findall(includes) if
 len(includeswitch) > 2]
 return (foundincludes, foundisystem)
 
@@ -83,7 +84,7 @@ class GbuildParser:
 
 @staticmethod
 def __split_flags(flagsline, flagslineappend):
-return [cxxflag.strip() for cxxflag in 
GbuildParser.warningpattern.sub('', '%s %s' % (flagsline, 
flagslineappend)).split(' ') if len(cxxflag) > 1]
+return [cxxflag.strip() for cxxflag in 
GbuildParser._warningpattern.sub('', '%s %s' % (flagsline, 
flagslineappend)).split(' ') if len(cxxflag) > 1]
 
 def parse(self):
 for jsontype in ['Library', 'Executable', 'CppunitTest']:
@@ -92,7 +93,7 @@ class GbuildParser:
 jsondata = json.load(f)
 
 (foundincludes, foundisystem) = 
GbuildParser.__split_includes(jsondata['INCLUDE'])
-match = 
GbuildParser.buildpattern[jsontype].match(os.path.basename(jsondata['MAKEFILE'])).group(1)
+match = 
GbuildParser._buildpattern[jsontype].match(os.path.basename(jsondata['MAKEFILE'])).group(1)
 newObj = GbuildLinkTarget(match,
   
os.path.dirname(jsondata['MAKEFILE']),
   foundincludes,
@@ -115,10 +116,14 @@ class GbuildParser:
   jsondata['YACCOBJECTS'],
   jsontype)
 self.files.append(newObj)
+
+moduleDict = {}
 for target in self.files:
-if target.location not in self.target_by_location:
-self.target_by_location[target.location] = set()
-self.target_by_location[target.location] |= set([target])
+module = target.location.split('/')[-1]
+if not module in moduleDict:
+moduleDict[module] = {'targets': set()}
+moduleDict[module]['targets'] |= set([target])
+
 for cxx in target.cxxobjects:
 path = '/'.join(cxx.split('/')[:-1])
 if path not in self.target_by_path:
@@ -129,8 +134,8 @@ class GbuildParser:
 if path != '' and 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-13 Thread jan Iversen
 bin/gbuild-to-ide |   36 +---
 1 file changed, 9 insertions(+), 27 deletions(-)

New commits:
commit 057c526b88cf8b1049fc93319050b480fc2a12ee
Author: jan Iversen 
Date:   Fri Jan 13 13:18:07 2017 +0100

gbuild-to-ide simplifications.

Simplified GbuildLinkTarget, removed functions.

Prepare to clean GbuildParser

Change-Id: I67bb3ba0279f615cb6c361818ade6fe629dca60c

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 6fdcb3f..12f107c 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -40,26 +40,8 @@ class GbuildLinkTarget:
  ilibtarget, linked_static_libs, linktarget,
  objcflags, objcobjects, objcxxflags,
  objcxxobjects, yaccobjects, build_type)
+self.target_name = self.build_type + '_' + self.name
 
-def name(self):
-return self.name
-
-def target_name(self):
-return self.build_type + '_' + self.name
-
-def short_name(self):
-return self.build_type + ' ' + self.name
-
-def module(self):
-return self.location[self.location.rindex('/')+1:]
-
-def is_empty(self):
-return not self.include and not self.defs and not self.cxxobjects and 
not self.linked_libs
-
-def __str__(self):
-return '%s at %s with include path: %s, isystem includes: %s, defines: 
%s, objects: %s, cxxflags: %s and linked libs: %s' % (
-self.short_name(), self.location, self.include, self.include_sys, 
self.defs, self.cxxobjects,
-self.cxxflags, self.linked_libs)
 
 class GbuildParser:
 def __init__(self, makecmd):
@@ -146,7 +128,7 @@ class GbuildParser:
 x = self.target_by_path[path]
 if path != '' and len(set(self.target_by_path[path])) > 1:
 print('fdo#70422: multiple target use dir %s: %s' % (
-path, ', '.join([target.short_name() for target in 
set(self.target_by_path[path])])))
+path, ', '.join([target.target_name for target in 
set(self.target_by_path[path])])))
 for location in self.target_by_location:
 self.modulenamelist.append(os.path.split(location)[1])
 return self
@@ -815,7 +797,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 module = location.split('/')[-1]
 module_directory = os.path.join(self.solution_directory, module)
 for target in self.gbuildparser.target_by_location[location]:
-project_path = os.path.join(module_directory, '%s.vcxproj' % 
target.target_name())
+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)
 projects.append(p)
@@ -841,11 +823,11 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 f.write('Microsoft Visual Studio Solution File, Format Version 
12.00\n')
 for project in projects:
 target = project.target
-print(' %s' % target.target_name(), end='')
+print(' %s' % target.target_name, end='')
 proj_path = os.path.relpath(project.path, 
os.path.abspath(os.path.dirname(solution_path)))
 f.write('Project("{%s}") = "%s", "%s", "{%s}"\n' %
 (VisualStudioIntegrationGenerator.nmake_project_guid,
- target.short_name(), proj_path, project.guid))
+ target.target_name, proj_path, project.guid))
 libs_in_solution = self.get_dependency_libs(target.linked_libs,
 library_projects)
 if libs_in_solution:
@@ -898,7 +880,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 proj_keyword_node = ET.SubElement(globals_node, '{%s}Keyword' % ns)
 proj_keyword_node.text = 'MakeFileProj'
 proj_name_node = ET.SubElement(globals_node, '{%s}ProjectName' % ns)
-proj_name_node.text = target.short_name()
+proj_name_node.text = target.target_name
 
 ET.SubElement(proj_node, '{%s}Import' % ns, 
Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props')
 for configuration in self.configurations:
@@ -930,7 +912,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 'builddir': self.gbuildparser.builddir,
 'location': target.location,
 'makecmd': self.gbuildparser.makecmd,
-'target': target.target_name()}
+'target': target.target_name}
 nmake_build_node = ET.SubElement(conf_node, 
'{%s}NMakeBuildCommandLine' % ns)
 nmake_build_node.text = cfg_targets['build'] % 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-11 Thread Edmund Wong
 bin/gbuild-to-ide |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit a6931e8d00a77e6db9390aeee9a8b0b533986220
Author: Edmund Wong 
Date:   Wed Dec 14 13:06:05 2016 +0800

No need for a separate variable. Just get the value directly from the 
dictionary.

Change-Id: Ic8a707ac78cf5ad3e225131ae23f1f1277f3ae7c
Reviewed-on: https://gerrit.libreoffice.org/31991
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index d4eb5e9..6fdcb3f 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -775,7 +775,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 
 def __init__(self, gbuildparser, ide):
 IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
-self.toolset = self.retrieve_toolset(ide)
+self.toolset = self.retrieve_toolset()
 self.solution_directory = './'
 self.configurations = {
 'Build': {
@@ -795,9 +795,8 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 }
 }
 
-def retrieve_toolset(self, ide):
-ide_toolset_map = {'vs2013': 'v120', 'vs2015': 'v140'}
-return ide_toolset_map[ide]
+def retrieve_toolset(self):
+return {'vs2013': 'v120', 'vs2015': 'v140'}.get(self.ide, None)
 
 def module_make_command(self, targets):
 return '%(sh)s -c "PATH=\\"/bin:$PATH\\";BUILDDIR=\\"%(builddir)s\\" 
%(makecmd)s -rsC %(location)s ' + targets + '"'
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-10 Thread jan Iversen
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e4b6c3b2f9dc579c278b47a777fb57def9e0df1f
Author: jan Iversen 
Date:   Tue Jan 10 18:03:57 2017 +0100

gbuild-to-ide, solved vs2013 generation problem.

mikekaganski reported a problem with the vs2013 class, due to the
latest changes. Problem solved:

.name() -> .name

Change-Id: Idb3e063bee93041dd010ed0c0b5bb71ac7efcd57

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index c1022b4..d4eb5e9 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -831,7 +831,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 dependency_libs = {}
 for linked_lib in linked_libs:
 for library_project in library_projects:
-if library_project.target.name() == linked_lib:
+if library_project.target.name == linked_lib:
 dependency_libs[library_project.guid] = library_project
 return dependency_libs
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-05 Thread jan Iversen
 bin/gbuild-to-ide |   95 +-
 1 file changed, 38 insertions(+), 57 deletions(-)

New commits:
commit bc5bd4a0297141863acebc6fc7bcd3a6e6008869
Author: jan Iversen 
Date:   Thu Jan 5 12:12:04 2017 +0100

gbuild xcode-ide-integration code cleaning

Cleaned some function to ease readability

Prepare to add header files to solution.

Change-Id: I7d9c5ea18cf74147d0639b6a8dcbf11bd9ad7bc8

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index ab9c785..c1022b4 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -532,13 +532,13 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
'rootObject': rootId}
 for location in self.gbuildparser.target_by_location:
 module = location[location.rindex('/') + 1:]
-sourceId, self.sourceObj = self.define_pbxgroup('Sources', 
'source', '')
-includeId, self.includeObj = self.define_pbxgroup('Headers', 
'inc', '')
-targetId, targetObj = self.define_pbxgroup('Targets', 'target', 
'')
-targetLibId, self.targetLibObj = self.define_pbxgroup('Libraries', 
'target', '')
-targetCUId, self.targetCUObj = self.define_pbxgroup('Unittests', 
'target', '')
-targetExeId, self.targetExeObj = 
self.define_pbxgroup('Executable', 'target', '')
-moduleId, self.moduleObj = self.define_pbxgroup(module, 
module,'')
+sourceId, self.sourceObj = self.define_pbxgroup('Sources')
+includeId, self.includeObj = self.define_pbxgroup('Headers')
+targetId, targetObj = self.define_pbxgroup('Targets')
+targetLibId, self.targetLibObj = self.define_pbxgroup('Libraries')
+targetCUId, self.targetCUObj = self.define_pbxgroup('Unittests')
+targetExeId, self.targetExeObj = self.define_pbxgroup('Executable')
+moduleId, self.moduleObj = self.define_pbxgroup(module)
 
 targetObj['children'] = [targetLibId, targetCUId,targetExeId]
 self.moduleObj['children'] = [sourceId, includeId, targetId]
@@ -561,15 +561,11 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 pass
 with open(os.path.join(xcodeprojdir, 'project.pbxproj'), 'w') as f:
 f.write('// !$*UTF8*$!\n')
-self.write_dict(pbxproj, f, 0)
+self.write_object(pbxproj, f, 0)
 
 
-def define_pbxgroup(self, name, pathEnd, sourcetree):
-return self.generate_id(), {'isa': 'PBXGroup',
-  'children': [],
-  'name': name,
-  'path': '../../' + name + '/' + pathEnd,
-  'sourceTree': sourcetree}
+def define_pbxgroup(self, name):
+return self.generate_id(), {'isa': 'PBXGroup','children': [],'name': 
name,'sourceTree': ''}
 
 counter = 16777216
 
@@ -577,14 +573,10 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 XcodeIntegrationGenerator.counter += 1
 return str('X%07x' % XcodeIntegrationGenerator.counter)
 
-
-
-
 def indent(self, file, level):
-if level == 0:
-return
-for i in range(0, level):
-file.write('\t')
+if level != 0:
+for i in range(0, level):
+file.write('\t')
 
 def write_object(self, object, file, indent):
 if isinstance(object, int):
@@ -597,44 +589,24 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
   else:
 file.write('"%s"' % object)
 elif isinstance(object, dict):
-self.write_dict(object, file, indent)
+file.write('{')
+file.write('\n')
+for key in sorted(object.keys()):
+self.indent(file, indent + 1)
+file.write('%s = ' % key)
+self.write_object(object[key], file, indent + 1)
+file.write(';\n')
+self.indent(file, indent)
+file.write('}')
 elif isinstance(object, list):
-self.write_list(object, file, indent)
+file.write('(')
+for key in object:
+self.write_object(key, file, 1)
+file.write(',')
+file.write(')')
 elif isinstance(object, GbuildLinkTarget):
 file.write('""')
 
-# Write a dictionary out as an "old-style (NeXT) ASCII plist"
-def write_dict(self, dict, file, indent):
-file.write('{')
-file.write('\n')
-for key in sorted(dict.keys()):
-self.indent(file, indent + 1)
-file.write('%s = ' % key)
-self.write_object(dict[key], file, indent + 1)
-file.write(';\n')
-self.indent(file, indent)
-file.write('}')
-
-def write_list(self, list, file, indent):
-file.write('(')
-for key in list:
-

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-04 Thread jan Iversen
 bin/gbuild-to-ide |   64 +-
 1 file changed, 35 insertions(+), 29 deletions(-)

New commits:
commit 87d0251a9e12e8a82c8d81c1c342c1f02945e4b8
Author: jan Iversen 
Date:   Wed Jan 4 13:20:41 2017 +0100

gbuild-to-ide xcode update

Update to isolate module, and have groups for:
   Sources
   Headers
   Targets
   Other files

Change-Id: Id2c48b0e3dae7c943c122e767d391d324e936619

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 48babb8..64723c6 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -593,7 +593,6 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
   'hasScannedForEncodings': 0,
   'knownRegions': ['en'],
   'mainGroup': self.mainGroupId,
-  'productRefGroup': self.productRefGroupId,
   'projectDirPath': '',
   'projectRoot': '',
   'buildConfigurationList': self.configurationListId,
@@ -675,33 +674,41 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
   'defaultConfigurationName': 'Debug'}
 return result
 
-def generate_main_group(self, modulename):
-result = {'isa': 'PBXGroup',
-  'children': [self.subMainGroupId, self.productRefGroupId],
-  'sourceTree': ''}
-return result
-
-def generate_sub_main_children(self, modulename):
-return list(self.sourceRefList.keys())
-
-def generate_sub_main_group(self, modulename):
+def generate_module_group(self, modulename):
 try:
   name = modulename.module()
 except:
   name = 'target'
-result = {'isa': 'PBXGroup',
-  'children': self.generate_sub_main_children(modulename),
-  'name': name,
-  'path': '../' + name,
-  'sourceTree': ''}
-return result
-
-def generate_product_group(self, modulename):
-result = {'isa': 'PBXGroup',
-  'children': [self.targetRefId],
-  'name': 'Products',
-  'sourceTree': ''}
-return result
+moduleId = self.generate_id()
+sourceId = self.generate_id()
+includeId = self.generate_id()
+targetId = self.generate_id()
+otherId = self.generate_id()
+objs = {moduleId: {'isa': 'PBXGroup',
+  'children': [sourceId, includeId, targetId, 
otherId],
+  'name': name,
+  'path': '../' + name,
+  'sourceTree': ''},
+sourceId : {'isa': 'PBXGroup',
+'children': list(self.sourceRefList.keys()),
+'name': 'Sources',
+'path': '../../' + name + '/source',
+'sourceTree': ''},
+includeId: {'isa': 'PBXGroup',
+'children': [],
+'name': 'Headers',
+'path': '../../' + name,
+'sourceTree': ''},
+targetId : {'isa': 'PBXGroup',
+'children': [self.targetRefId],
+'name': 'Targets',
+'sourceTree': ''},
+otherId: {'isa': 'PBXGroup',
+  'children': [],
+'name': 'Other files',
+'path': '../' + name,
+'sourceTree': ''}}
+return moduleId, objs
 
 def build_source_list(self, module):
 self.sourceRefList = {}
@@ -734,8 +741,6 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 self.mainGroupId = self.generate_id()
 self.targetId = self.generate_id()
 self.configurationListId = self.generate_id()
-self.productRefGroupId = self.generate_id()
-self.subMainGroupId = self.generate_id()
 self.sourcesBuildPhaseId = self.generate_id()
 self.copyBuildPhaseId = self.generate_id()
 self.targetRefId = self.generate_id()
@@ -747,14 +752,15 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 objects = {self.rootObjectId: self.generate_root_object(target),
self.targetId: self.generate_target(target),
self.targetRefId: self.generate_ref_target(target),
-   self.mainGroupId: self.generate_main_group(target),
-   self.subMainGroupId: self.generate_sub_main_group(target),
-   self.productRefGroupId: self.generate_product_group(target),
+   self.mainGroupId: {'isa': 'PBXGroup', 'children': [], 
'sourceTree': ''},
self.sourcesBuildPhaseId: 
self.generate_sources_build_phase(target),
   

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-02 Thread jan Iversen
 bin/gbuild-to-ide |   32 +++-
 1 file changed, 15 insertions(+), 17 deletions(-)

New commits:
commit a4e9943d810829734849aed0254ac7bca2c3d258
Author: jan Iversen 
Date:   Mon Jan 2 19:33:03 2017 +0100

gbuild-to-ide xcode generator moved proj files

All .xcodeproj files are now located in /osx
to prepare for combining into 1 .xcodeproj for all of LO

Change-Id: I649389ba2b94355ebaf6b5413bdb5dfae8c04764

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 9c13907..48babb8 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -507,10 +507,10 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
 
 def emit(self):
-self.rootlocation = './'
+self.rootlocation = './osx'
 for location in self.gbuildparser.target_by_location:
 for target in self.gbuildparser.target_by_location[location]:
-xcodeprojdir = os.path.join(location, '%s.xcodeproj' % 
target.target_name())
+xcodeprojdir = os.path.join(self.rootlocation, '%s.xcodeproj' 
% target.target_name())
 try:
 os.mkdir(xcodeprojdir)
 except:
@@ -692,7 +692,7 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 result = {'isa': 'PBXGroup',
   'children': self.generate_sub_main_children(modulename),
   'name': name,
-  'path': name,
+  'path': '../' + name,
   'sourceTree': ''}
 return result
 
@@ -709,9 +709,7 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 
 for i in module.cxxobjects:
 ref = self.generate_id()
-ref = 'X0100012'  # Ugly hack for today
-self.sourceList['X0100011'] = ref # second ugly hack
-#self.sourceList[self.generate_id()] = ref
+self.sourceList[self.generate_id()] = ref
 self.sourceRefList[ref] = {'lastKnownFileType': 
'sourcecode.cpp.cpp',
'path': i + '.cxx',
'sourceTree': ''}
@@ -732,16 +730,16 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
   'runOnlyForDeploymentPostprocessing': 0}
 return result
 def generate_project(self, target):
-self.rootObjectId = 'X011' # self.generate_id()
-self.mainGroupId = 'X012' # self.generate_id()
-self.targetId = 'X013' # self.generate_id()
-self.configurationListId = 'X014' # self.generate_id()
-self.productRefGroupId = 'X015' # self.generate_id()
-self.subMainGroupId = 'X016' # self.generate_id()
-self.sourcesBuildPhaseId = 'X017' #  self.generate_id()
-self.copyBuildPhaseId = 'X018' # self.generate_id()
-self.targetRefId = 'X019' # self.generate_id()
-self.configurationDebugId = 'X0100010' # self.generate_id()
+self.rootObjectId = self.generate_id()
+self.mainGroupId = self.generate_id()
+self.targetId = self.generate_id()
+self.configurationListId = self.generate_id()
+self.productRefGroupId = self.generate_id()
+self.subMainGroupId = self.generate_id()
+self.sourcesBuildPhaseId = self.generate_id()
+self.copyBuildPhaseId = self.generate_id()
+self.targetRefId = self.generate_id()
+self.configurationDebugId = self.generate_id()
 
 self.productReferenceId = self.generate_id()
 self.productGroupId = self.generate_id()
@@ -768,7 +766,7 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 name = path
 objects[ref] = {'isa': 'PBXFileReference',
 'lastKnownFileType': 
self.sourceRefList[ref]['lastKnownFileType'],
-'path': '../../' + path,
+'path': '../' + path,
 'name': name,
 'sourceTree': ''}
 project = {'archiveVersion': 1,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-02 Thread jan Iversen
 bin/gbuild-to-ide |   51 ---
 1 file changed, 32 insertions(+), 19 deletions(-)

New commits:
commit f61f34c900534b960f19425d1fe51608d6a4f12d
Author: jan Iversen 
Date:   Mon Jan 2 17:16:51 2017 +0100

gbuild-to-ide update to xcode generator

The generator now generates the same groups as xcode, with
relative paths.

This patch has been tested with l10ntools/pocheck.

Next step is "sal" and actually compile

Change-Id: I02c202434a346918e9ec725bd20e4713fc6fa73e

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 3f326c5..9c13907 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -507,7 +507,7 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
 
 def emit(self):
-self.rootlocation = self.gbuildparser.srcdir + '/osx'
+self.rootlocation = './'
 for location in self.gbuildparser.target_by_location:
 for target in self.gbuildparser.target_by_location[location]:
 xcodeprojdir = os.path.join(location, '%s.xcodeproj' % 
target.target_name())
@@ -572,14 +572,14 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 else:
 return 'com.apple.product-type.something'
 
-counter = 0
+counter = 16777216
 
 def generate_id(self):
 XcodeIntegrationGenerator.counter = XcodeIntegrationGenerator.counter 
+ 1
 return str('X%07x' % XcodeIntegrationGenerator.counter)
 
 def generate_build_phases(self, modulename):
-result = [self.sourcesBuildPhaseId]
+result = [self.sourcesBuildPhaseId, self.copyBuildPhaseId]
 return result
 
 def generate_root_object(self, modulename):
@@ -593,7 +593,7 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
   'hasScannedForEncodings': 0,
   'knownRegions': ['en'],
   'mainGroup': self.mainGroupId,
-  'productRefGroup': self.productGroupId,
+  'productRefGroup': self.productRefGroupId,
   'projectDirPath': '',
   'projectRoot': '',
   'buildConfigurationList': self.configurationListId,
@@ -604,7 +604,7 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 result = {'isa': 'PBXFileReference',
   'explicitFileType': 'compiled.mach-o.executable',
   'includeInIndex': 0,
-  'path': 'target',
+  'path': modulename.name,
   'sourceTree': 'BUILT_PRODUCTS_DIR'}
 return result
 
@@ -614,8 +614,8 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
   'buildPhases': self.generate_build_phases(modulename),
   'buildRules': [],
   'dependencies': [],
-  'name': 'target', # modulename,
-  'productName': 'target', # modulename,
+  'name': modulename.name, # modulename,
+  'productName': modulename.name, # modulename,
   'productReference': self.targetRefId,
   'productType': self.get_product_type(modulename)}
 return result
@@ -632,7 +632,7 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
   'CLANG_WARN_BOOL_CONVERSION': 'YES',
   'CLANG_WARN_CONSTANT_CONVERSION': 'YES',
   'CLANG_WARN_DIRECT_OBJC_ISA_USAGE': 'YES_ERROR',
-  'CLANG_WARN_DOCUMENTATION_COMMENTS': 'YES',
+  'CLANG_WARN_DOCUMEjNTATION_COMMENTS': 'YES',
   'CLANG_WARN_EMPTY_BODY': 'YES',
   'CLANG_WARN_ENUM_CONVERSION': 'YES',
   'CLANG_WARN_INFINITE_RECURSION': 'YES',
@@ -663,7 +663,8 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
   'MTL_ENABLE_DEBUG_INFO': 'YES',
   'ONLY_ACTIVE_ARCH': 'YES',
   'PRODUCT_NAME': '$(TARGET_NAME)',
-  'SDKROOT': 'macosx'},
+  'SDKROOT': 'macosx',
+  'HEADER_SEARCH_PATHS': modulename.include},
   'name': 'Debug'}
 return result
 
@@ -676,7 +677,7 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 
 def generate_main_group(self, modulename):
 result = {'isa': 'PBXGroup',
-  'children': [self.subMainGroupId, self.productGroupId],
+  'children': [self.subMainGroupId, self.productRefGroupId],
   'sourceTree': ''}
 return result
 
@@ -691,13 +692,13 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 result = {'isa': 'PBXGroup',
   'children': self.generate_sub_main_children(modulename),
   'name': name,
-  'path': 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-02 Thread jan Iversen
 bin/gbuild-to-ide |   57 ++
 1 file changed, 24 insertions(+), 33 deletions(-)

New commits:
commit f42751f534f56f1d465582ebce8d17094f640175
Author: jan Iversen 
Date:   Mon Jan 2 09:35:14 2017 +0100

gbuild-to-ide, fixed typo and changed xcode generator

target_name used - instead of _ which caused solutions to have a new name

xcode generator changed to use fixed id for the major groups, in
order to facilitate debugging of the solutions.

Change-Id: I444c74f37dc471625fa3f28240678f9968d1e710

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 978fd17..3f326c5 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -44,7 +44,7 @@ class GbuildLinkTarget:
 return self.name
 
 def target_name(self):
-return self.build_type + '-' + self.name
+return self.build_type + '_' + self.name
 
 def short_name(self):
 return self.build_type + ' ' + self.name
@@ -503,6 +503,23 @@ VersionControl=kdevgit
 
 class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 
+def __init__(self, gbuildparser, ide):
+IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
+
+def emit(self):
+self.rootlocation = self.gbuildparser.srcdir + '/osx'
+for location in self.gbuildparser.target_by_location:
+for target in self.gbuildparser.target_by_location[location]:
+xcodeprojdir = os.path.join(location, '%s.xcodeproj' % 
target.target_name())
+try:
+os.mkdir(xcodeprojdir)
+except:
+pass
+p = self.generate_project(target)
+with open(os.path.join(xcodeprojdir, 'project.pbxproj'), 'w') 
as f:
+f.write('// !$*UTF8*$!\n')
+self.write_dict(p, f, 0)
+
 def indent(self, file, level):
 if level == 0:
 return
@@ -545,10 +562,6 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 file.write(',')
 file.write(')')
 
-def write_dict_to_plist(self, dict, file):
-file.write('// !$*UTF8*$!\n')
-self.write_dict(dict, file, 0)
-
 def get_product_type(self, modulename):
 if modulename.build_type == 'Library':
 return 'com.apple.product-type.library.dynamic'
@@ -708,17 +721,18 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 return result
 
 def generate_project(self, target):
-self.rootObjectId = self.generate_id()
-self.mainGroupId = self.generate_id()
+self.rootObjectId = 'X011' # self.generate_id()
+self.mainGroupId = 'X012' # self.generate_id()
+self.targetId = 'X013' # self.generate_id()
+self.configurationListId = 'X014' # self.generate_id()
+self.productRefGroupId = 'X015' # self.generate_id()
+
 self.subMainGroupId = self.generate_id()
 self.productReferenceId = self.generate_id()
-self.productRefGroupId = self.generate_id()
 self.productGroupId = self.generate_id()
-self.targetId = self.generate_id()
 self.targetRefId = self.generate_id()
 self.build_source_list(target)
 self.sourcesBuildPhaseId = self.generate_id()
-self.configurationListId =  self.generate_id()
 self.configurationDebugId =  self.generate_id()
 objects = {self.rootObjectId: self.generate_root_object(target),
self.targetId: self.generate_target(target),
@@ -751,29 +765,6 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
'rootObject': self.rootObjectId}
 return project
 
-# For some reverse-engineered documentation on the project.pbxproj format,
-# see http://www.monobjc.net/xcode-project-file-format.html .
-def write_xcodeproj(self, moduledir, target):
-xcodeprojdir = os.path.join(moduledir, '%s.xcodeproj' % 
target.target_name())
-try:
-os.mkdir(xcodeprojdir)
-except:
-pass
-self.write_dict_to_plist(self.generate_project(target),
- open(os.path.join(xcodeprojdir, 
'project.pbxproj'), 'w'))
-
-def __init__(self, gbuildparser, ide):
-IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
-
-def emit(self):
-self.rootlocation = './'
-for location in self.gbuildparser.target_by_location:
-# module = location.split('/')[-1]
-# module_directory = os.path.join(self.rootlocation, module)
-for target in self.gbuildparser.target_by_location[location]:
-# project_path = os.path.join(module_directory, '%s.pbxroj' % 
target.target_name())
-self.write_xcodeproj(location, target)
-
 
 class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 
___

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-01 Thread jan Iversen
 bin/gbuild-to-ide |   19 +--
 1 file changed, 9 insertions(+), 10 deletions(-)

New commits:
commit ae4f8ac9a16b7a0631124272d08c625e86c432d8
Author: jan Iversen 
Date:   Sun Jan 1 18:26:37 2017 +0100

gbuild-to-ide performance optimize parser

Change-Id: I93c81e027269830af7d6b2c9df2f1b0f0194880e

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index e12e0fa..978fd17 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -108,26 +108,26 @@ class GbuildParser:
 with open(os.path.join(self.workdir, 'GbuildToJson', jsontype, 
jsonfilename), 'r') as f:
 jsondata = json.load(f)
 
-(foundincludes, foundisystem) = 
self.__split_includes(jsondata['INCLUDE'])
-match = 
self.buildpattern[jsontype].match(os.path.basename(jsondata['MAKEFILE'])).group(1)
+(foundincludes, foundisystem) = 
GbuildParser.__split_includes(jsondata['INCLUDE'])
+match = 
GbuildParser.buildpattern[jsontype].match(os.path.basename(jsondata['MAKEFILE'])).group(1)
 newObj = GbuildLinkTarget(match,
   
os.path.dirname(jsondata['MAKEFILE']),
   foundincludes,
   foundisystem,
-  
self.__split_defs(jsondata['DEFS']),
-  
self.__split_objs(jsondata['CXXOBJECTS']),
-  
self.__split_flags(jsondata['CXXFLAGS'], jsondata['CXXFLAGSAPPEND']),
+  
GbuildParser.__split_defs(jsondata['DEFS']),
+  
GbuildParser.__split_objs(jsondata['CXXOBJECTS']),
+  
GbuildParser.__split_flags(jsondata['CXXFLAGS'], jsondata['CXXFLAGSAPPEND']),
   
jsondata['LINKED_LIBS'].strip().split(' '),
   jsondata['ASMOBJECTS'],
-  
self.__split_flags(jsondata['CFLAGS'], jsondata['CFLAGSAPPEND']),
+  
GbuildParser.__split_flags(jsondata['CFLAGS'], jsondata['CFLAGSAPPEND']),
   jsondata['GENCOBJECTS'],
   jsondata['GENCXXOBJECTS'],
   jsondata['ILIBTARGET'],
   jsondata['LINKED_STATIC_LIBS'],
   jsondata['LINKTARGET'],
-  
self.__split_flags(jsondata['OBJCFLAGS'], jsondata['OBJCFLAGSAPPEND']),
+  
GbuildParser.__split_flags(jsondata['OBJCFLAGS'], jsondata['OBJCFLAGSAPPEND']),
   jsondata['OBJCOBJECTS'],
-  
self.__split_flags(jsondata['OBJCXXFLAGS'], jsondata['OBJCXXFLAGSAPPEND']),
+  
GbuildParser.__split_flags(jsondata['OBJCXXFLAGS'], 
jsondata['OBJCXXFLAGSAPPEND']),
   jsondata['OBJCXXOBJECTS'],
   jsondata['YACCOBJECTS'],
   jsontype)
@@ -154,8 +154,7 @@ class GbuildParser:
 class IdeIntegrationGenerator:
 
 def __init__(self, gbuildparser, ide):
-self.gbuildparser = gbuildparser
-self.ide = ide
+(self.gbuildparser, self.ide) = (gbuildparser, ide)
 
 def emit(self):
 pass
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-01 Thread jan Iversen
 bin/gbuild-to-ide |   37 +++--
 1 file changed, 15 insertions(+), 22 deletions(-)

New commits:
commit 2823fd4698fdc8019af36f881aa90a89ba8d8236
Author: jan Iversen 
Date:   Sun Jan 1 11:46:17 2017 +0100

gbuild-to-ide parser simplification.

Added build_type to objects instead of having 3 sets.

Modified the generators to use build_type

Change-Id: Ic884522eb6d2c41e7b838f62a0d0800dc4e02c8a

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index ea75965..e12e0fa 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -65,7 +65,7 @@ class GbuildParser:
 self.makecmd = makecmd
 self.binpath = os.path.dirname(os.environ['GPERF']) # woha, this is 
quite a hack
 (self.srcdir, self.builddir, self.instdir, self.workdir) = 
(os.environ['SRCDIR'], os.environ['BUILDDIR'], os.environ['INSTDIR'], 
os.environ['WORKDIR'])
-(self.libs, self.exes, self.tests, self.modulenamelist) = ([], [], [], 
[])
+(self.modulenamelist, self.files) = ([], [])
 (self.target_by_path, self.target_by_location) = ({}, {})
 
 includepattern = re.compile('-I(\S+)')
@@ -131,13 +131,8 @@ class GbuildParser:
   jsondata['OBJCXXOBJECTS'],
   jsondata['YACCOBJECTS'],
   jsontype)
-if jsontype == 'Library':
-self.libs.append(newObj)
-elif jsontype == 'Executable':
-self.exes.append(newObj)
-elif jsontype == 'CppunitTest':
-self.tests.append(newObj)
-for target in set(self.libs) | set(self.exes) | set(self.tests):
+self.files.append(newObj)
+for target in self.files:
 if target.location not in self.target_by_location:
 self.target_by_location[target.location] = set()
 self.target_by_location[target.location] |= set([target])
@@ -291,12 +286,8 @@ class DebugIntegrationGenerator(IdeIntegrationGenerator):
 def emit(self):
 print(self.gbuildparser.srcdir)
 print(self.gbuildparser.builddir)
-for lib in self.gbuildparser.libs:
-print(lib)
-for exe in self.gbuildparser.exes:
-print(exe)
-for test in self.gbuildparser.tests:
-print(test)
+for f in self.gbuildparser.files:
+print(f)
 
 
 class VimIntegrationGenerator(IdeIntegrationGenerator):
@@ -306,7 +297,7 @@ class VimIntegrationGenerator(IdeIntegrationGenerator):
 
 def emit(self):
 global_list = []
-for lib in set(self.gbuildparser.libs) | set(self.gbuildparser.tests):
+for lib in self.gbuildparser.files:
 entries = []
 for file in lib.cxxobjects:
 filePath = os.path.join(self.gbuildparser.srcdir, file) + 
".cxx"
@@ -560,12 +551,14 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 self.write_dict(dict, file, 0)
 
 def get_product_type(self, modulename):
-if modulename in self.gbuildparser.libs:
+if modulename.build_type == 'Library':
 return 'com.apple.product-type.library.dynamic'
-elif modulename in self.gbuildparser.exes:
-return 'com.apple.product-type.something'
-else:
+elif modulename.build_type == 'Executable':
+return 'com.apple.product-type.executable'
+elif modulename.build_type == 'CppunitTest':
 return 'com.apple.product-type.cppunit'
+else:
+return 'com.apple.product-type.something'
 
 counter = 0
 
@@ -849,7 +842,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 
 def write_solution(self, solution_path, projects):
 print('Solution %s:' % 
os.path.splitext(os.path.basename(solution_path))[0], end='')
-library_projects = [project for project in projects if project.target 
in self.gbuildparser.libs]
+library_projects = [project for project in projects if 
project.target.build_type == 'Library']
 with open(solution_path, 'w') as f:
 f.write('Microsoft Visual Studio Solution File, Format Version 
12.00\n')
 for project in projects:
@@ -1038,7 +1031,7 @@ class 
QtCreatorIntegrationGenerator(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):
+for target in self.gbuildparser.files:
 if target.location not in self.target_by_location:
 self.target_by_location[target.location] = set()
 self.target_by_location[target.location] |= set([target])
@@ -1494,7 +1487,7 @@ class 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-01 Thread jan Iversen
 bin/gbuild-to-ide |  184 +++---
 1 file changed, 66 insertions(+), 118 deletions(-)

New commits:
commit d3c44886c56f401cc18c2ba480131a621d06c781
Author: jan Iversen 
Date:   Sun Jan 1 10:29:50 2017 +0100

Update json parser in gbuild-to-ide

Simplified parser and added the missing json elements:
ASMOBJECTS
CFLAGS
CFLAGSAPPEND
CXXFLAGS
CXXFLAGSAPPEND
CXXOBJECTS
DEFS
GENCOBJECTS
GENCXXOBJECTS
ILIBTARGET
INCLUDE
LINKED_LIBS
LINKED_STATIC_LIBS
LINKTARGET
MAKEFILE
OBJCFLAGS
OBJCFLAGSAPPEND
OBJCOBJECTS
OBJCXXFLAGS
OBJCXXFLAGSAPPEND
OBJCXXOBJECTS
YACCOBJECTS

This patch should not affect the different generators

Change-Id: I74795880d7d34868d61ef73859bda0aedc8b2e28

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 451f6b5..ea75965 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -22,74 +22,43 @@ import traceback
 
 
 class GbuildLinkTarget:
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs):
-(self.name, self.location, self.include, self.include_sys, self.defs, 
self.cxxobjects, self.cxxflags, self.linked_libs) = (
-name, location, include, include_sys, defs, cxxobjects, cxxflags, 
linked_libs)
-
-def short_name(self):
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs,
+ asmobjects, cflags, gencobjects, gencxxobjects, ilibtarget, 
linked_static_libs, linktarget,
+ objcflags, objcobjects, objcxxflags, objcxxobjects, 
yaccobjects, build_type):
+(self.name, self.location, self.include,
+ self.include_sys, self.defs, self.cxxobjects,
+ self.cxxflags, self.linked_libs,
+ self.asmobjects, self.cflags, self.gencobjects,
+ self.gencxxobjects, self.ilibtarget, self.linked_static_libs,
+ self.linktarget, self.objcflags, self.objcobjects,
+ self.objcxxflags, self.objcxxobjects, self.yaccobjects,
+ self.build_type) = (name, location, include,
+ include_sys, defs, cxxobjects,
+ cxxflags, linked_libs, asmobjects,
+ cflags, gencobjects, gencxxobjects,
+ ilibtarget, linked_static_libs, linktarget,
+ objcflags, objcobjects, objcxxflags,
+ objcxxobjects, yaccobjects, build_type)
+
+def name(self):
 return self.name
 
-def is_empty(self):
-return not self.include and not self.defs and not self.cxxobjects and 
not self.linked_libs
-
-def __str__(self):
-return '%s at %s with include path: %s, isystem includes: %s, defines: 
%s, objects: %s, cxxflags: %s and linked libs: %s' % (
-self.short_name(), self.location, self.include, self.include_sys, 
self.defs, self.cxxobjects,
-self.cxxflags, self.linked_libs)
-
-
-class GbuildLib(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, linked_libs)
-
-def short_name(self):
-"""Return the short name of target based on the Library_* makefile 
name"""
-return 'Library %s' % self.name
-
-def short_name(self):
-"""Return the short name of target based on the Library_* makefile 
name"""
-return 'Library %s' % self.name
-
-def module(self):
-"""Return module name """
-return self.location[self.location.rindex('/')+1:]
-
 def target_name(self):
-return 'Library_%s' % self.name
-
-def library_name(self):
-return self.name
-
-class GbuildTest(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, linked_libs)
+return self.build_type + '-' + self.name
 
 def short_name(self):
-"""Return the short name of target based n the CppunitTest_* makefile 
names"""
-return 'CppunitTest %s' % self.name
+return self.build_type + ' ' + self.name
 
 def module(self):
-"""Return module name """
 return self.location[self.location.rindex('/')+1:]
 
-def target_name(self):
-return 'CppunitTest_%s' % self.name
-
-class GbuildExe(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, linked_libs)
-
-def short_name(self):
-"""Return the short name of target based on the Executable_* 

[Libreoffice-commits] core.git: bin/gbuild-to-ide sw/CppunitTest_sw_ooxmlexport2.mk sw/CppunitTest_sw_ooxmlexport3.mk sw/CppunitTest_sw_ooxmlexport4.mk sw/CppunitTest_sw_ooxmlexport5.mk sw/CppunitTest

2016-12-29 Thread Matúš Kukan
 bin/gbuild-to-ide |   10 +-
 sw/CppunitTest_sw_ooxmlexport.mk  |2 --
 sw/CppunitTest_sw_ooxmlexport2.mk |2 --
 sw/CppunitTest_sw_ooxmlexport3.mk |2 --
 sw/CppunitTest_sw_ooxmlexport4.mk |2 --
 sw/CppunitTest_sw_ooxmlexport5.mk |2 --
 sw/CppunitTest_sw_ooxmlexport6.mk |2 --
 sw/CppunitTest_sw_ooxmlexport7.mk |2 --
 sw/CppunitTest_sw_ooxmlexport9.mk |2 --
 sw/CppunitTest_sw_ooxmlfieldexport.mk |2 --
 sw/CppunitTest_sw_ooxmlw14export.mk   |2 --
 sw/Module_sw.mk   |2 ++
 12 files changed, 3 insertions(+), 29 deletions(-)

New commits:
commit d8a9d483898d94868bc502d52f0fcd166d18959f
Author: Matúš Kukan 
Date:   Thu Dec 29 23:42:23 2016 +0100

Workaround strange sw test makefiles

Include ooxmlexport_setup.mk only once in Module_sw.mk,
so that gbuildtojson can properly set last included
makefile for test jsons.

Change-Id: Ie8ed3296ae97cf4a33d652599673f389b224993e
Reviewed-on: https://gerrit.libreoffice.org/32502
Tested-by: Jenkins 
Reviewed-by: Matúš Kukan 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 3b84394..451f6b5 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -149,16 +149,8 @@ class GbuildParser:
 @staticmethod
 def __test_from_json(json):
 (foundincludes, foundisystem) = 
GbuildParser.__split_includes(json['INCLUDE'])
-testname_match = 
GbuildParser.testpattern.match(os.path.basename(json['MAKEFILE']))
-
-# Workaround strange writer test makefile setup
-if testname_match is None:
-testname = "StrangeWriterMakefiles"
-else:
-testname = testname_match.group(1)
-
 return GbuildTest(
-testname,
+
GbuildParser.testpattern.match(os.path.basename(json['MAKEFILE'])).group(1),
 os.path.dirname(json['MAKEFILE']),
 foundincludes,
 foundisystem,
diff --git a/sw/CppunitTest_sw_ooxmlexport.mk b/sw/CppunitTest_sw_ooxmlexport.mk
index d3e7ac1..dec6978 100644
--- a/sw/CppunitTest_sw_ooxmlexport.mk
+++ b/sw/CppunitTest_sw_ooxmlexport.mk
@@ -9,8 +9,6 @@
 #
 #*
 
-include $(SRCDIR)/sw/ooxmlexport_setup.mk
-
 # empty second argument (i.e. no 1)
 $(eval $(call sw_ooxmlexport_test,))
 
diff --git a/sw/CppunitTest_sw_ooxmlexport2.mk 
b/sw/CppunitTest_sw_ooxmlexport2.mk
index 2be67c0..18a3456 100644
--- a/sw/CppunitTest_sw_ooxmlexport2.mk
+++ b/sw/CppunitTest_sw_ooxmlexport2.mk
@@ -9,8 +9,6 @@
 #
 #*
 
-include $(SRCDIR)/sw/ooxmlexport_setup.mk
-
 $(eval $(call sw_ooxmlexport_test,2))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sw/CppunitTest_sw_ooxmlexport3.mk 
b/sw/CppunitTest_sw_ooxmlexport3.mk
index cdb9ab1..5969aea 100644
--- a/sw/CppunitTest_sw_ooxmlexport3.mk
+++ b/sw/CppunitTest_sw_ooxmlexport3.mk
@@ -9,8 +9,6 @@
 #
 #*
 
-include $(SRCDIR)/sw/ooxmlexport_setup.mk
-
 $(eval $(call sw_ooxmlexport_test,3))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sw/CppunitTest_sw_ooxmlexport4.mk 
b/sw/CppunitTest_sw_ooxmlexport4.mk
index 1a92a48..e328593 100644
--- a/sw/CppunitTest_sw_ooxmlexport4.mk
+++ b/sw/CppunitTest_sw_ooxmlexport4.mk
@@ -9,8 +9,6 @@
 #
 #*
 
-include $(SRCDIR)/sw/ooxmlexport_setup.mk
-
 $(eval $(call sw_ooxmlexport_test,4))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sw/CppunitTest_sw_ooxmlexport5.mk 
b/sw/CppunitTest_sw_ooxmlexport5.mk
index 42b873e..674fcee 100644
--- a/sw/CppunitTest_sw_ooxmlexport5.mk
+++ b/sw/CppunitTest_sw_ooxmlexport5.mk
@@ -9,8 +9,6 @@
 #
 #*
 
-include $(SRCDIR)/sw/ooxmlexport_setup.mk
-
 $(eval $(call sw_ooxmlexport_test,5))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sw/CppunitTest_sw_ooxmlexport6.mk 
b/sw/CppunitTest_sw_ooxmlexport6.mk
index f619ada..9b3ebe18 100644
--- a/sw/CppunitTest_sw_ooxmlexport6.mk
+++ b/sw/CppunitTest_sw_ooxmlexport6.mk
@@ -9,8 +9,6 @@
 #
 #*
 
-include $(SRCDIR)/sw/ooxmlexport_setup.mk
-
 $(eval $(call sw_ooxmlexport_test,6))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sw/CppunitTest_sw_ooxmlexport7.mk 
b/sw/CppunitTest_sw_ooxmlexport7.mk
index 8a8f53e..2145a94 100644
--- a/sw/CppunitTest_sw_ooxmlexport7.mk
+++ b/sw/CppunitTest_sw_ooxmlexport7.mk
@@ -9,8 +9,6 @@
 #
 #*
 
-include $(SRCDIR)/sw/ooxmlexport_setup.mk
-
 $(eval $(call sw_ooxmlexport_test,7))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sw/CppunitTest_sw_ooxmlexport9.mk 
b/sw/CppunitTest_sw_ooxmlexport9.mk
index 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2016-12-25 Thread jan Iversen
 bin/gbuild-to-ide |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 13d9f5cfc31d8eb01206d39361c55b9784da8acd
Author: jan Iversen 
Date:   Sun Dec 25 21:37:40 2016 +0100

update to make cppunit load in xcode

cppunit was unknown product type, assigned it

Change-Id: I39a08f52cd07c06fc77fc4ac6dc4ecfb167a86ae

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 3e7d04f3..3b84394 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -624,6 +624,8 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 return 'com.apple.product-type.library.dynamic'
 elif modulename in self.gbuildparser.exes:
 return 'com.apple.product-type.something'
+else:
+return 'com.apple.product-type.cppunit'
 
 counter = 0
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2016-12-25 Thread jan Iversen
 bin/gbuild-to-ide |   37 -
 1 file changed, 28 insertions(+), 9 deletions(-)

New commits:
commit 535a677c1defdc6f5d575ced2161464034634bad
Author: jan Iversen 
Date:   Sun Dec 25 19:15:27 2016 +0100

update to prepare for multiple modules.

module filter name changes from source
to module name.

Change-Id: I979b3ca7f86bad70d0812207b3eccbed20499a08

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 8fa98ea..3e7d04f3 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -46,6 +46,14 @@ class GbuildLib(GbuildLinkTarget):
 """Return the short name of target based on the Library_* makefile 
name"""
 return 'Library %s' % self.name
 
+def short_name(self):
+"""Return the short name of target based on the Library_* makefile 
name"""
+return 'Library %s' % self.name
+
+def module(self):
+"""Return module name """
+return self.location[self.location.rindex('/')+1:]
+
 def target_name(self):
 return 'Library_%s' % self.name
 
@@ -60,6 +68,10 @@ class GbuildTest(GbuildLinkTarget):
 """Return the short name of target based n the CppunitTest_* makefile 
names"""
 return 'CppunitTest %s' % self.name
 
+def module(self):
+"""Return module name """
+return self.location[self.location.rindex('/')+1:]
+
 def target_name(self):
 return 'CppunitTest_%s' % self.name
 
@@ -71,6 +83,10 @@ class GbuildExe(GbuildLinkTarget):
 """Return the short name of target based on the Executable_* makefile 
name"""
 return 'Executable %s' % self.name
 
+def module(self):
+"""Return module name """
+return self.location[self.location.rindex('/')+1:]
+
 def target_name(self):
 return 'Executable_%s' % self.name
 
@@ -721,9 +737,13 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 return list(self.sourceRefList.keys())
 
 def generate_sub_main_group(self, modulename):
+try:
+  name = modulename.module()
+except:
+  name = 'target'
 result = {'isa': 'PBXGroup',
   'children': self.generate_sub_main_children(modulename),
-  'name': 'Source',
+  'name': name,
   'path': modulename,
   'sourceTree': ''}
 return result
@@ -754,13 +774,13 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 return result
 
 def generate_project(self, target):
-self.rootObjectId = "X001" # self.generate_id()
-self.mainGroupId = "X003" # self.generate_id()
-self.subMainGroupId = "X005" # self.generate_id()
-self.productReferenceId = "X006" # self.generate_id()
+self.rootObjectId = self.generate_id()
+self.mainGroupId = self.generate_id()
+self.subMainGroupId = self.generate_id()
+self.productReferenceId = self.generate_id()
 self.productRefGroupId = self.generate_id()
-self.productGroupId = "X004" # self.generate_id()
-self.targetId = "X901" # self.generate_id()
+self.productGroupId = self.generate_id()
+self.targetId = self.generate_id()
 self.targetRefId = self.generate_id()
 self.build_source_list(target)
 self.sourcesBuildPhaseId = self.generate_id()
@@ -782,13 +802,12 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
   'fileRef': ref}
 path = self.sourceRefList[ref]['path']
 try:
-path = path[path.index('/')+1:]
 name = path[path.rindex('/')+1:]
 except:
 name = path
 objects[ref] = {'isa': 'PBXFileReference',
 'lastKnownFileType': 
self.sourceRefList[ref]['lastKnownFileType'],
-'path': path,
+'path': '../' + path,
 'name': name,
 'sourceTree': ''}
 project = {'archiveVersion': 1,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2016-12-23 Thread jan Iversen
 bin/gbuild-to-ide |   36 +---
 1 file changed, 25 insertions(+), 11 deletions(-)

New commits:
commit 37907576d81dae2e1d31e4391cf15f6b1ad3b0dd
Author: jan Iversen 
Date:   Wed Dec 21 18:43:54 2016 +0100

First attempt to make xcode project work again.

There are still a problem with references, but committing this part, since
it is controlled, and before conflicting with other changes.

Change-Id: I6a7551bfbb44edc5876e5432ca04bfd595cb3fab

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index e18f3bd..981b1c5 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -187,7 +187,8 @@ class GbuildParser:
 self.target_by_path[path] = set()
 self.target_by_path[path] |= set([target])
 for path in self.target_by_path:
-if len(set(self.target_by_path[path])) > 1:
+x = self.target_by_path[path]
+if path != '' and len(set(self.target_by_path[path])) > 1:
 print('fdo#70422: multiple target use dir %s: %s' % (
 path, ', '.join([target.short_name() for target in 
set(self.target_by_path[path])])))
 for location in self.target_by_location:
@@ -280,7 +281,7 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 
 
 
-""" 
+"""
 
 for module in self.gbuildparser.modulenamelist:
 tempxml = []
@@ -305,7 +306,7 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 macrokey = macroskeyvalue[0]
 macrovalue = macroskeyvalue[1]
 if macrovalue[-1:] == "\n":
-macrovalue = macrovalue[:-1] 
+macrovalue = macrovalue[:-1]
 templine = "%s%s\n" 
%(macrokey, macrovalue)
 tempxml.insert(-13, templine)
 tempxml="".join(tempxml)
@@ -320,7 +321,7 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 def emit(self):
 self.create_include_paths()
 self.create_macros()
-self.create_settings_file() 
+self.create_settings_file()
 
 class DebugIntegrationGenerator(IdeIntegrationGenerator):
 
@@ -567,6 +568,8 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 file.write('"%s"' % object)
 elif isinstance(object, dict):
 self.write_dict(object, file, indent)
+elif isinstance(object, list):
+self.write_list(object, file, indent)
 
 # Write a dictionary out as an "old-style (NeXT) ASCII plist"
 def write_dict(self, dict, file, indent):
@@ -580,6 +583,13 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 self.indent(file, indent)
 file.write('}')
 
+def write_list(self, list, file, indent):
+file.write('(')
+for key in list:
+self.write_object(key, file, 1)
+file.write(',')
+file.write(')')
+
 def write_dict_to_plist(self, dict, file):
 file.write('// !$*UTF8*$!\n')
 self.write_dict(dict, file, 0)
@@ -601,18 +611,21 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 return result
 
 def generate_root_object(self, modulename):
-result = {'isa': 'PBXProject',
-  'attributes': {'LastUpgradeCheck': '0500',
- 'ORGANIZATIONNAME': 'LibreOffice'},
-  'buildConfigurationList': self.generate_id(),
+result = {'attributes': {'LastUpgradeCheck': '0500',
+ 'ORGANIZATIONNAME': 'LibreOffice',
+ 'TargetAttributes' : {self.targetId : 
{'CreatedOnToolsVersion' : '8.2',
+
'ProvisioningStyle' : 'Automatic'}}},
   'compatibilityVersion': 'Xcode 3.2',
+  'developmentRegion': 'English',
+  'isa': 'PBXProject',
   'hasScannedForEncodings': 0,
   'knownRegions': ['en'],
   'mainGroup': self.mainGroupId,
   'productRefGroup': self.productRefGroupId,
   'projectDirPath': '',
   'projectRoot': '',
-  'targets': self.targetId}
+  'buildConfigurationList': self.generate_id(),
+  'targets': [self.targetId]}
 return result
 
 def generate_target(self, modulename):
@@ -623,7 +636,7 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
   'dependencies': [],
   'name': modulename,
   'productName': modulename,
-  'productReference': self.productReferenceId,
+  'productRefGroup': self.productGroupId,
   'productType': self.get_product_type(modulename)}
 return result
 
@@ -634,11 +647,12 @@ class 

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2016-12-15 Thread Edmund Wong
 bin/gbuild-to-ide |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 15aa0fbb706067d936edac7fdf64f60d07f95e6d
Author: Edmund Wong 
Date:   Wed Dec 14 12:59:23 2016 +0800

Move get options to a separate function.

Change-Id: I014f49b8239b0165ab696398b5ef0a2af5e0ae8c
Reviewed-on: https://gerrit.libreoffice.org/31990
Reviewed-by: Samuel Mehrbrodt 
Tested-by: Samuel Mehrbrodt 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 8ee2d13..e18f3bd 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1607,14 +1607,18 @@ SUBDIRS = %(subdirs)s
 """
 
 
-if __name__ == '__main__':
+def get_options():
 parser = argparse.ArgumentParser(
 description='LibreOffice gbuild IDE project generator')
 parser.add_argument('--ide', dest='ide', required=True,
 help='the IDE to generate project files for')
 parser.add_argument('--make', dest='makecmd', required=True,
 help='the command to execute make')
-args = parser.parse_args()
+return parser.parse_args()
+
+
+if __name__ == '__main__':
+args = get_options()
 # FIXME: Hack
 if args.makecmd == 'make':
 args.makecmd = '/usr/bin/make'
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2016-12-14 Thread Matúš Kukan
 bin/gbuild-to-ide |   39 +--
 1 file changed, 13 insertions(+), 26 deletions(-)

New commits:
commit ee3f793a2d4e2977a3e952e1439708d8936953d7
Author: Matúš Kukan 
Date:   Wed Dec 14 22:25:12 2016 +0100

tdf#70414: Fix VisualStudio ide integration

'LINKTARGET' is not really helpful as target name.
Use name based on makefile's name and hope something like
b81ac16e65b311d6e43c05c22c65d2040c9d7e04 is not needed anymore.
And if there are still some inconsistencies, we should fix makefile's name.

Also, don't use target.name because it's not unique.
There can be e.g. both Library_smoketest and CppunitTest_smoketest.

Change-Id: I541a1e41f80446e875e1bb2bfa89786e356e0e74
Reviewed-on: https://gerrit.libreoffice.org/32027
Reviewed-by: jan iversen 
Tested-by: jan iversen 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 7de2fb4..8ee2d13 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -39,47 +39,40 @@ class GbuildLinkTarget:
 
 
 class GbuildLib(GbuildLinkTarget):
-def __init__(self, name, library, location, include, include_sys, defs, 
cxxobjects, cxxflags, linked_libs):
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs):
 GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, linked_libs)
-self.library = library
 
 def short_name(self):
 """Return the short name of target based on the Library_* makefile 
name"""
 return 'Library %s' % self.name
 
 def target_name(self):
-return 'Library_%s' % self.library
+return 'Library_%s' % self.name
 
 def library_name(self):
-return self.library
+return self.name
 
 class GbuildTest(GbuildLinkTarget):
-def __init__(self, name, test, location, include, include_sys, defs, 
cxxobjects, cxxflags, linked_libs):
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs):
 GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, linked_libs)
-self.test = test
 
 def short_name(self):
 """Return the short name of target based n the CppunitTest_* makefile 
names"""
 return 'CppunitTest %s' % self.name
 
 def target_name(self):
-return 'CppunitTest_%s' % self.test
-
-def test_name(self):
-return self.test
-
+return 'CppunitTest_%s' % self.name
 
 class GbuildExe(GbuildLinkTarget):
-def __init__(self, name, executable, location, include, include_sys, defs, 
cxxobjects, cxxflags, linked_libs):
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, linked_libs):
 GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, linked_libs)
-self.executable = executable
 
 def short_name(self):
 """Return the short name of target based on the Executable_* makefile 
name"""
 return 'Executable %s' % self.name
 
 def target_name(self):
-return 'Executable_%s' % self.executable
+return 'Executable_%s' % self.name
 
 
 class GbuildParser:
@@ -88,7 +81,7 @@ class GbuildParser:
 self.binpath = os.path.dirname(os.environ['GPERF']) # woha, this is 
quite a hack
 (self.srcdir, self.builddir, self.instdir, self.workdir) = 
(os.environ['SRCDIR'], os.environ['BUILDDIR'], os.environ['INSTDIR'], 
os.environ['WORKDIR'])
 (self.libs, self.exes, self.tests, self.modulenamelist) = ([], [], [], 
[])
-(self.libnames, self.exenames, self.testnames, self.target_by_path, 
self.target_by_location) = ({}, {}, {}, {}, {})
+(self.target_by_path, self.target_by_location) = ({}, {})
 
 includepattern = re.compile('-I(\S+)')
 isystempattern = re.compile('-isystem\s*(\S+)')
@@ -129,7 +122,6 @@ class GbuildParser:
 (foundincludes, foundisystem) = 
GbuildParser.__split_includes(json['INCLUDE'])
 return GbuildLib(
 
GbuildParser.libpattern.match(os.path.basename(json['MAKEFILE'])).group(1),
-json['LINKTARGET'],
 os.path.dirname(json['MAKEFILE']),
 foundincludes,
 foundisystem,
@@ -151,7 +143,6 @@ class GbuildParser:
 
 return GbuildTest(
 testname,
-json['LINKTARGET'],
 os.path.dirname(json['MAKEFILE']),
 foundincludes,
 foundisystem,
@@ -165,7 +156,6 @@ class GbuildParser:
 (foundincludes, foundisystem) = 
GbuildParser.__split_includes(json['INCLUDE'])
 return GbuildExe(
 
GbuildParser.exepattern.match(os.path.basename(json['MAKEFILE'])).group(1),
-json['LINKTARGET'],
 os.path.dirname(json['MAKEFILE']),
 foundincludes,
   

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2016-11-28 Thread Markus Mohrhard
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a2cfcfead5e62dfef067ee97e43ce7291ee365d4
Author: Markus Mohrhard 
Date:   Sun Nov 27 21:46:09 2016 +0100

add cppunit tests to vim-ide-integration

Change-Id: I5a03ff6d6e740d8032030d1590837610f39acd5e
Reviewed-on: https://gerrit.libreoffice.org/31273
Reviewed-by: Markus Mohrhard 
Tested-by: Markus Mohrhard 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index e241f3f..6d549cb 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -358,7 +358,7 @@ class VimIntegrationGenerator(IdeIntegrationGenerator):
 
 def emit(self):
 global_list = []
-for lib in set(self.gbuildparser.libs):
+for lib in set(self.gbuildparser.libs) | set(self.gbuildparser.tests):
 entries = []
 for file in lib.cxxobjects:
 filePath = os.path.join(self.gbuildparser.srcdir, file) + 
".cxx"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   >