Kaydet (Commit) f2061f85 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen Kaydeden (comit) Björn Michaelsen

add initial json export for gbuild data

- also add gbuild selftest to test this (and possibly more later)

Change-Id: Ia4ef41095613e596f39d107df700e929579ba45f
Reviewed-on: https://gerrit.libreoffice.org/29744Reviewed-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@canonical.com>
üst 7f77e684
......@@ -15,7 +15,7 @@ MAKECMDGOALS?=all
build_goal:=$(if $(filter build check,$(MAKECMDGOALS)),all)\
$(if $(filter build-nocheck,$(MAKECMDGOALS)),build)\
$(if $(filter check,$(MAKECMDGOALS)),subsequentcheck)\
$(filter all build-l10n-only build-non-l10n-only debugrun help showmodules translations $(gb_Top_MODULE_CHECK_TARGETS) check packageinfo,$(MAKECMDGOALS))
$(filter all build-l10n-only build-non-l10n-only debugrun help showmodules translations $(gb_Top_MODULE_CHECK_TARGETS) check packageinfo gbuildtoide,$(MAKECMDGOALS))
SRCDIR := @SRC_ROOT@
BUILDDIR := @BUILDDIR@
......@@ -270,7 +270,7 @@ endif
build-non-l10n-only build-l10n-only build-nocheck check debugrun translations packageinfo $(gb_Top_MODULE_CHECK_TARGETS): build
help showmodules:
help showmodules gbuildtoide:
$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
cross-toolset: bootstrap fetch
......
......@@ -21,4 +21,10 @@ $(eval $(call gb_Module_add_targets,solenv,\
))
endif
ifneq ($(DISABLE_PYTHON),TRUE)
$(eval $(call gb_Module_add_subsequentcheck_targets,solenv,\
PythonTest_solenv_python \
))
endif
# vim: set shiftwidth=4 tabstop=4 noexpandtab:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_PythonTest_PythonTest,solenv_python))
$(eval $(call gb_PythonTest_add_modules,solenv_python,$(SRCDIR)/solenv/qa/python,\
gbuildtoide \
))
# vim: set noet sw=4 ts=4:
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
ifneq ($(filter gbuildtoide,$(MAKECMDGOALS)),)
gbuildtoide:
true
.PHONY : foo
foo:
true
define gb_Postprocess_register_target
gbuildtoide : $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(3)))
$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(3))): $(gb_Helper_MISCDUMMY) foo
define gb_LinkTarget__command
mkdir -p $(WORKDIR)/GbuildToIde/Library
printf '{"LINKTARGET": "%s"' '$$(2)' > $(WORKDIR)/GbuildToIde/$$(2)
printf ', "ILIBTARGET": "%s"' '$$(ILIBTARGET)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "COBJECTS": "%s"' '$$(COBJECTS)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "CXXOBJECTS": "%s"' '$$(CXXOBJECTS)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "YACCOBJECTS": "%s"' '$$(YACCOBJECTS)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "OBJCOBJECTS": "%s"' '$$(OBJCOBJECTS)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "OBJCXXOBJECTS": "%s"' '$$(OBJCXXOBJECTS)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "ASMOBJECTS": "%s"' '$$(ASMOBJECTS)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "GENCOBJECTS": "%s"' '$$(GENCOBJECTS)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "GENCXXOBJECTS": "%s"' '$$(GENCXXOBJECTS)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "CFLAGS": "%s"' '$$(T_CFLAGS) $$(T_CFLAGS_APPEND)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "CXXFLAGS": "%s"' '$$(T_CXXFLAGS) $$(T_CXXFLAGS_APPEND)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "OBJCFLAGS": "%s"' '$$(T_OBJCFLAGS)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "OBJCXXFLAGS": "%s"' '$$(T_OBJCXXFLAGS)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "DEFS": "%s"' '$$(DEFS)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "INCLUDE": "%s"' '$$(INCLUDE)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "LINKED_LIBS": "%s"' '$$(LINKED_LIBS)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf ', "LINKED_STATIC_LIBS": "%s"' '$$(LINKED_STATIC_LIBS)' >> $(WORKDIR)/GbuildToIde/$$(2)
printf '}\n' >> $(WORKDIR)/GbuildToIde/$$(2)
endef
endef
endif
# vim: set noet ts=4 sw=4:
'''
This is file is part of the LibreOffice project.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
This file incorporates work covered by the following license notice:
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed
with this work for additional information regarding copyright
ownership. The ASF licenses this file to you under the Apache
License, Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 .
'''
import subprocess
import unittest
import json
import os
import os.path
class CheckGbuildToIde(unittest.TestCase):
def test_gbuildtoide(self):
os.chdir(os.path.join(os.environ['SRCDIR'], 'solenv', 'qa', 'python', 'selftest'))
subprocess.check_call(['make', 'gbuildtoide'])
jsonfiles = os.listdir(os.path.join(os.environ['WORKDIR'], 'GbuildToIde', 'Library'))
gbuildlibs = []
for jsonfilename in jsonfiles:
with open(os.path.join(os.environ['WORKDIR'], 'GbuildToIde', 'Library', jsonfilename), 'r') as f:
print('loading %s' % jsonfilename)
gbuildlibs.append(json.load(f))
foundlibs = set()
for lib in gbuildlibs:
self.assertEqual(set(lib.keys()), set(['ASMOBJECTS', 'CFLAGS', 'COBJECTS', 'CXXFLAGS', 'CXXOBJECTS', 'DEFS', 'GENCOBJECTS', 'GENCXXOBJECTS', 'ILIBTARGET', 'INCLUDE', 'LINKED_LIBS', 'LINKED_STATIC_LIBS', 'LINKTARGET', 'OBJCFLAGS', 'OBJCOBJECTS', 'OBJCXXFLAGS', 'OBJCXXOBJECTS', 'YACCOBJECTS']))
if lib['LINKTARGET'].find('gbuildselftestdep') != -1:
foundlibs.add('gbuildselftestdep')
elif lib['LINKTARGET'].find('gbuildselftest') != -1:
foundlibs.add('gbuildselftest')
self.assertIn('-Igbuildtoidetestinclude', lib['INCLUDE'].split())
self.assertIn('gbuildselftestdep', lib['LINKED_LIBS'].split())
self.assertIn('solenv/qa/python/selftest/selftestobject', lib['CXXOBJECTS'].split())
self.assertIn('-DGBUILDSELFTESTDEF', lib['DEFS'].split())
self.assertIn('-DGBUILDSELFTESTCXXFLAG', lib['CXXFLAGS'].split())
self.assertIn('-DGBUILDSELFTESTCFLAG', lib['CFLAGS'].split())
else:
self.assertTrue(False)
self.assertEqual(foundlibs, set(['gbuildselftest', 'gbuildselftestdep']))
self.assertEqual(len(foundlibs), 2)
if __name__ == "__main__":
unittest.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment