summaryrefslogtreecommitdiff
path: root/sccomp
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-12-15 15:50:42 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2021-12-21 00:20:36 +0100
commitb8a801def427255587a7e519577d29d1acb91162 (patch)
treee7d5ef44efe9dfda7715d0280c6d9b84a12d33e4 /sccomp
parent379b685730ca7adb3b8d1905c73a2c3df1d31799 (diff)
Disallow multiple component files per library
This converts existing users of multiple component files to the new filtering mechanism and adds a check to error in the case that someone tries to set multiple component files again. Change-Id: Ie75d6c5d1b78f446ff06faba7350715289b8d17e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126892 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sccomp')
-rw-r--r--sccomp/Library_solver.mk8
-rw-r--r--sccomp/source/solver/lpsolvesolver.component26
-rw-r--r--sccomp/source/solver/solver.component (renamed from sccomp/source/solver/coinmpsolver.component)11
-rw-r--r--sccomp/source/solver/solver.component.coinmp7
-rw-r--r--sccomp/source/solver/solver.component.lpsolve7
-rw-r--r--sccomp/source/solver/swarmsolver.component15
6 files changed, 29 insertions, 45 deletions
diff --git a/sccomp/Library_solver.mk b/sccomp/Library_solver.mk
index 900dcbd96072..933c0f7b6e38 100644
--- a/sccomp/Library_solver.mk
+++ b/sccomp/Library_solver.mk
@@ -19,10 +19,12 @@
$(eval $(call gb_Library_Library,solver))
-$(if $(ENABLE_COINMP),$(eval $(call gb_Library_set_componentfile,solver,sccomp/source/solver/coinmpsolver,services)))
-$(if $(ENABLE_LPSOLVE),$(eval $(call gb_Library_set_componentfile,solver,sccomp/source/solver/lpsolvesolver,services)))
+$(eval $(call gb_Library_set_componentfile,solver,sccomp/source/solver/solver,services))
-$(eval $(call gb_Library_set_componentfile,solver,sccomp/source/solver/swarmsolver,services))
+$(eval $(call gb_Library_add_componentimpls,solver, \
+ $(if $(ENABLE_COINMP),coinmp) \
+ $(if $(ENABLE_LPSOLVE),lpsolve) \
+))
$(eval $(call gb_Library_use_sdk_api,solver))
diff --git a/sccomp/source/solver/lpsolvesolver.component b/sccomp/source/solver/lpsolvesolver.component
deleted file mode 100644
index 76e2f3bbf722..000000000000
--- a/sccomp/source/solver/lpsolvesolver.component
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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/.
- *
- * 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 .
- -->
-
-<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.Calc.LpsolveSolver"
- constructor="com_sun_star_comp_Calc_LpsolveSolver_get_implementation">
- <service name="com.sun.star.sheet.Solver"/>
- </implementation>
-</component>
diff --git a/sccomp/source/solver/coinmpsolver.component b/sccomp/source/solver/solver.component
index 3ddeeea4af47..496be6628486 100644
--- a/sccomp/source/solver/coinmpsolver.component
+++ b/sccomp/source/solver/solver.component
@@ -6,11 +6,20 @@
* 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/.
-->
-
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.Calc.CoinMPSolver"
constructor="com_sun_star_comp_Calc_CoinMPSolver_get_implementation">
<service name="com.sun.star.sheet.Solver"/>
+ <optional/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Calc.LpsolveSolver"
+ constructor="com_sun_star_comp_Calc_LpsolveSolver_get_implementation">
+ <service name="com.sun.star.sheet.Solver"/>
+ <optional/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Calc.SwarmSolver"
+ constructor="com_sun_star_comp_Calc_SwarmSolver_get_implementation">
+ <service name="com.sun.star.sheet.Solver"/>
</implementation>
</component>
diff --git a/sccomp/source/solver/solver.component.coinmp b/sccomp/source/solver/solver.component.coinmp
new file mode 100644
index 000000000000..1ced6f61be45
--- /dev/null
+++ b/sccomp/source/solver/solver.component.coinmp
@@ -0,0 +1,7 @@
+# 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/.
+
+com.sun.star.comp.Calc.CoinMPSolver
diff --git a/sccomp/source/solver/solver.component.lpsolve b/sccomp/source/solver/solver.component.lpsolve
new file mode 100644
index 000000000000..3b571fbc324d
--- /dev/null
+++ b/sccomp/source/solver/solver.component.lpsolve
@@ -0,0 +1,7 @@
+# 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/.
+
+com.sun.star.comp.Calc.LpsolveSolver
diff --git a/sccomp/source/solver/swarmsolver.component b/sccomp/source/solver/swarmsolver.component
deleted file mode 100644
index 0cdd925ee9fd..000000000000
--- a/sccomp/source/solver/swarmsolver.component
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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/.
- -->
-
-<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.Calc.SwarmSolver" constructor="com_sun_star_comp_Calc_SwarmSolver_get_implementation">
- <service name="com.sun.star.sheet.Solver"/>
- </implementation>
-</component>