diff options
author | RMZeroFour <ritobroto04@gmail.com> | 2024-07-08 21:23:42 +0530 |
---|---|---|
committer | Hossein <hossein@libreoffice.org> | 2024-08-03 11:08:57 +0200 |
commit | 2ddeef9ff5facd3551039504badd31d5cac7f2eb (patch) | |
tree | f86db7b5f8d122c3870c22d943fb1c5e7ea294bd /net_ure | |
parent | 5f4083ffa9e4ecd073063c904412f83986b8e813 (diff) |
.NET Bindings: Improve DotnetLibrary gbuild class
This commit rewrites the DotnetLibrary gbuild class to build a .NET
library. Logic for handling various .NET languages is now consolidated,
while earlier there were separate functions for each language. Usage
has been made much more similar to the Jar gbuild class.
The CustomTargets used to build net_uretypes and net_oootypes have
also been reworked, and a function has been added to DotnetLibrary
to consume sources generated by a custom target, for cleaner usage.
Change-Id: Ie494b2547d30c43f9bb0aedeac4d140f1f3a830b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170168
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'net_ure')
-rw-r--r-- | net_ure/CustomTarget_net_oootypes.mk | 35 | ||||
-rw-r--r-- | net_ure/CustomTarget_net_uretypes.mk | 34 | ||||
-rw-r--r-- | net_ure/DotnetLibrary_net_basetypes.mk | 22 | ||||
-rw-r--r-- | net_ure/DotnetLibrary_net_oootypes.mk | 19 | ||||
-rw-r--r-- | net_ure/DotnetLibrary_net_uretypes.mk | 19 |
5 files changed, 53 insertions, 76 deletions
diff --git a/net_ure/CustomTarget_net_oootypes.mk b/net_ure/CustomTarget_net_oootypes.mk index b8a007c05db0..d03f4eba1e4a 100644 --- a/net_ure/CustomTarget_net_oootypes.mk +++ b/net_ure/CustomTarget_net_oootypes.mk @@ -6,14 +6,13 @@ # 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_CustomTarget_CustomTarget,net_oootypes)) +$(eval $(call gb_CustomTarget_CustomTarget,net_ure/net_oootypes)) -net_ure_DIR := $(gb_CustomTarget_workdir)/net_ure net_oootypes_DIR := $(gb_CustomTarget_workdir)/net_ure/net_oootypes -$(call gb_CustomTarget_get_target,net_oootypes) : $(net_ure_DIR)/net_oootypes.done +$(call gb_CustomTarget_get_target,net_ure/net_oootypes) : $(net_oootypes_DIR)/done -$(net_ure_DIR)/net_oootypes.done : \ +$(net_oootypes_DIR)/done : \ $(call gb_UnoApi_get_target,offapi) \ $(call gb_UnoApi_get_target,udkapi) \ $(call gb_Executable_get_target,netmaker) \ @@ -21,20 +20,18 @@ $(net_ure_DIR)/net_oootypes.done : \ | $(net_oootypes_DIR)/.dir $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),NET,4) $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),NET) - $(call gb_Helper_abbreviate_dirs, \ - rm -r $(net_oootypes_DIR) && \ - $(call gb_Helper_execute,netmaker -v -O $(net_oootypes_DIR) \ - -X $(call gb_UnoApi_get_target,udkapi) \ - $(call gb_UnoApi_get_target,offapi) > $@.log 2>&1 || \ - (echo \ - && cat $@.log \ - && echo \ - && echo "net_oootypes failed to generate. To retry, use:" \ - && echo " make CustomTarget_net_oootypes" \ - && echo "cd into the net_ure/ directory to run make faster" \ - && echo \ - && false)) && \ - touch $@) + + $(call gb_Helper_abbreviate_dirs,\ + $(call gb_Helper_print_on_error,\ + $(call gb_Helper_execute,\ + netmaker \ + -v \ + -O $(net_oootypes_DIR) \ + -X $(call gb_UnoApi_get_target,udkapi) \ + $(call gb_UnoApi_get_target,offapi)) \ + $(file >$@,),\ + $(net_oootypes_DIR)/log)) + $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),NET) -# vim: set noet sw=4 ts=4: +# vim:set shiftwidth=4 tabstop=4 noexpandtab: diff --git a/net_ure/CustomTarget_net_uretypes.mk b/net_ure/CustomTarget_net_uretypes.mk index 419f71ac4420..7118e6801910 100644 --- a/net_ure/CustomTarget_net_uretypes.mk +++ b/net_ure/CustomTarget_net_uretypes.mk @@ -6,34 +6,30 @@ # 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_CustomTarget_CustomTarget,net_uretypes)) +$(eval $(call gb_CustomTarget_CustomTarget,net_ure/net_uretypes)) -net_ure_DIR := $(gb_CustomTarget_workdir)/net_ure net_uretypes_DIR := $(gb_CustomTarget_workdir)/net_ure/net_uretypes -$(call gb_CustomTarget_get_target,net_uretypes) : $(net_ure_DIR)/net_uretypes.done +$(call gb_CustomTarget_get_target,net_ure/net_uretypes) : $(net_uretypes_DIR)/done -$(net_ure_DIR)/net_uretypes.done : \ +$(net_uretypes_DIR)/done : \ $(call gb_UnoApi_get_target,udkapi) \ $(call gb_Executable_get_target,netmaker) \ $(call gb_Executable_get_runtime_dependencies,netmaker) \ | $(net_uretypes_DIR)/.dir $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),NET,4) $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),NET) - $(call gb_Helper_abbreviate_dirs, \ - rm -r $(net_uretypes_DIR) && \ - $(call gb_Helper_execute,netmaker -v -O $(net_uretypes_DIR) \ - $(call gb_UnoApi_get_target,udkapi) > $@.log 2>&1 || \ - (echo \ - && cat $@.log \ - && echo \ - && echo "net_uretypes failed to generate. To retry, use:" \ - && echo " make CustomTarget_net_uretypes" \ - && echo "cd into the net_ure/ directory to run make faster" \ - && echo \ - && false)) && \ - touch $@) - $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),NET) + $(call gb_Helper_abbreviate_dirs,\ + $(call gb_Helper_print_on_error,\ + $(call gb_Helper_execute,\ + netmaker \ + -v \ + -O $(net_uretypes_DIR) \ + $(call gb_UnoApi_get_target,udkapi)) \ + $(file >$@,),\ + $(net_uretypes_DIR)/log)) + + $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),NET) -# vim: set noet sw=4 ts=4: +# vim:set shiftwidth=4 tabstop=4 noexpandtab: diff --git a/net_ure/DotnetLibrary_net_basetypes.mk b/net_ure/DotnetLibrary_net_basetypes.mk index b6a847838344..77a8134bd180 100644 --- a/net_ure/DotnetLibrary_net_basetypes.mk +++ b/net_ure/DotnetLibrary_net_basetypes.mk @@ -6,23 +6,21 @@ # 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_DotnetLibrary_CsLibrary,net_basetypes)) +$(eval $(call gb_DotnetLibrary_DotnetLibrary,net_basetypes,$(gb_DotnetLibrary_CS))) $(eval $(call gb_DotnetLibrary_add_sources,net_basetypes,\ - $(SRCDIR)/net_ure/source/basetypes, \ - Any.cs \ - BoundAttribute.cs \ - Exception.cs \ - IQueryInterface.cs \ - RaisesAttribute.cs \ - UnoGeneratedAttribute.cs \ + net_ure/source/basetypes/Any \ + net_ure/source/basetypes/BoundAttribute \ + net_ure/source/basetypes/Exception \ + net_ure/source/basetypes/IQueryInterface \ + net_ure/source/basetypes/RaisesAttribute \ + net_ure/source/basetypes/UnoGeneratedAttribute \ )) $(eval $(call gb_DotnetLibrary_add_properties,net_basetypes,\ - <AssemblyName>net_basetypes</AssemblyName> \ - <Version>0.1.0</Version> \ - <Company>LibreOffice</Company> \ - <Description>Base datatypes for the .NET language UNO binding.</Description> \ + <Version>0.1.0</Version> \ + <Company>LibreOffice</Company> \ + <Description>Base datatypes for the .NET language UNO binding.</Description> \ )) # vim: set noet sw=4 ts=4: diff --git a/net_ure/DotnetLibrary_net_oootypes.mk b/net_ure/DotnetLibrary_net_oootypes.mk index b21f1bb92945..b12a32f50ed2 100644 --- a/net_ure/DotnetLibrary_net_oootypes.mk +++ b/net_ure/DotnetLibrary_net_oootypes.mk @@ -6,23 +6,16 @@ # 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_DotnetLibrary_CsLibrary,net_oootypes)) +$(eval $(call gb_DotnetLibrary_DotnetLibrary,net_oootypes,$(gb_DotnetLibrary_CS))) -$(call gb_DotnetLibrary_get_target,net_oootypes) : \ - $(call gb_CustomTarget_get_target,net_oootypes) +$(eval $(call gb_DotnetLibrary_use_customtarget,net_oootypes,net_ure/net_oootypes)) -$(eval $(call gb_DotnetLibrary_add_generated_sources,net_oootypes,\ - $(gb_CustomTarget_workdir)/net_ure/net_oootypes, \ - **/*.cs \ -)) - -$(eval $(call gb_DotnetLibrary_link_cs_library,net_oootypes,net_uretypes)) +$(eval $(call gb_DotnetLibrary_link_library,net_oootypes,net_uretypes)) $(eval $(call gb_DotnetLibrary_add_properties,net_oootypes,\ - <AssemblyName>net_oootypes</AssemblyName> \ - <Version>0.1.0</Version> \ - <Company>LibreOffice</Company> \ - <Description>LibreOffice datatypes for the .NET language UNO binding.</Description> \ + <Version>0.1.0</Version> \ + <Company>LibreOffice</Company> \ + <Description>LibreOffice datatypes for the .NET language UNO binding.</Description> \ )) # vim: set noet sw=4 ts=4: diff --git a/net_ure/DotnetLibrary_net_uretypes.mk b/net_ure/DotnetLibrary_net_uretypes.mk index 747e4574ecb9..a796032d8e55 100644 --- a/net_ure/DotnetLibrary_net_uretypes.mk +++ b/net_ure/DotnetLibrary_net_uretypes.mk @@ -6,23 +6,16 @@ # 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_DotnetLibrary_CsLibrary,net_uretypes)) +$(eval $(call gb_DotnetLibrary_DotnetLibrary,net_uretypes,$(gb_DotnetLibrary_CS))) -$(call gb_DotnetLibrary_get_target,net_uretypes) : \ - $(call gb_CustomTarget_get_target,net_uretypes) +$(eval $(call gb_DotnetLibrary_use_customtarget,net_uretypes,net_ure/net_uretypes)) -$(eval $(call gb_DotnetLibrary_add_generated_sources,net_uretypes,\ - $(gb_CustomTarget_workdir)/net_ure/net_uretypes, \ - **/*.cs \ -)) - -$(eval $(call gb_DotnetLibrary_link_cs_library,net_uretypes,net_basetypes)) +$(eval $(call gb_DotnetLibrary_link_library,net_uretypes,net_basetypes)) $(eval $(call gb_DotnetLibrary_add_properties,net_uretypes,\ - <AssemblyName>net_uretypes</AssemblyName> \ - <Version>0.1.0</Version> \ - <Company>LibreOffice</Company> \ - <Description>UNO runtime datatypes for the .NET language UNO binding.</Description> \ + <Version>0.1.0</Version> \ + <Company>LibreOffice</Company> \ + <Description>UNO runtime datatypes for the .NET language UNO binding.</Description> \ )) # vim: set noet sw=4 ts=4: |