diff options
author | RMZeroFour <ritobroto04@gmail.com> | 2024-06-12 13:56:05 +0530 |
---|---|---|
committer | Hossein <hossein@libreoffice.org> | 2024-06-19 09:34:45 +0200 |
commit | e597e712b6e1c199a6241df3c29f35baeef9f457 (patch) | |
tree | f4517de769cd6a8e8d1b47ce87caf378122f7f83 /net_ure | |
parent | 64365dfa67d5a1d8fbc710238a4ea9c492645de4 (diff) |
.NET Bindings: Add netmaker (.NET codemaker)
This commit adds the netmaker executable to the codemaker/ module, to
generate C# code from UNOIDL specifications.
Also adds some Makefiles in the net_ure/ directory to generate code for
udkapi and offapi, to build the net_uretypes and net_oootypes assemblies.
Change-Id: Ifb61fe6a0f8f594eaa6ff95b025ba57f247b0d4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168710
Tested-by: Jenkins
Tested-by: Hossein <hossein@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'net_ure')
-rw-r--r-- | net_ure/CustomTarget_net_oootypes.mk | 40 | ||||
-rw-r--r-- | net_ure/CustomTarget_net_uretypes.mk | 39 | ||||
-rw-r--r-- | net_ure/DotnetLibrary_net_oootypes.mk | 27 | ||||
-rw-r--r-- | net_ure/DotnetLibrary_net_uretypes.mk | 27 | ||||
-rw-r--r-- | net_ure/Module_net_ure.mk | 4 | ||||
-rw-r--r-- | net_ure/README.md | 2 |
6 files changed, 138 insertions, 1 deletions
diff --git a/net_ure/CustomTarget_net_oootypes.mk b/net_ure/CustomTarget_net_oootypes.mk new file mode 100644 index 000000000000..b8a007c05db0 --- /dev/null +++ b/net_ure/CustomTarget_net_oootypes.mk @@ -0,0 +1,40 @@ +# -*- 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_CustomTarget_CustomTarget,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 + +$(net_ure_DIR)/net_oootypes.done : \ + $(call gb_UnoApi_get_target,offapi) \ + $(call gb_UnoApi_get_target,udkapi) \ + $(call gb_Executable_get_target,netmaker) \ + $(call gb_Executable_get_runtime_dependencies,netmaker) \ + | $(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_Trace_EndRange,$(subst $(WORKDIR)/,,$@),NET) + +# vim: set noet sw=4 ts=4: diff --git a/net_ure/CustomTarget_net_uretypes.mk b/net_ure/CustomTarget_net_uretypes.mk new file mode 100644 index 000000000000..419f71ac4420 --- /dev/null +++ b/net_ure/CustomTarget_net_uretypes.mk @@ -0,0 +1,39 @@ +# -*- 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_CustomTarget_CustomTarget,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 + +$(net_ure_DIR)/net_uretypes.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) + + +# vim: set noet sw=4 ts=4: diff --git a/net_ure/DotnetLibrary_net_oootypes.mk b/net_ure/DotnetLibrary_net_oootypes.mk new file mode 100644 index 000000000000..f799f5056764 --- /dev/null +++ b/net_ure/DotnetLibrary_net_oootypes.mk @@ -0,0 +1,27 @@ +# -*- 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_DotnetLibrary_CsLibrary,net_oootypes)) + +$(call gb_DotnetLibrary_get_target,net_oootypes) : \ + $(call gb_CustomTarget_get_target,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_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> \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/net_ure/DotnetLibrary_net_uretypes.mk b/net_ure/DotnetLibrary_net_uretypes.mk new file mode 100644 index 000000000000..a5e6968887c2 --- /dev/null +++ b/net_ure/DotnetLibrary_net_uretypes.mk @@ -0,0 +1,27 @@ +# -*- 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_DotnetLibrary_CsLibrary,net_uretypes)) + +$(call gb_DotnetLibrary_get_target,net_uretypes) : \ + $(call gb_CustomTarget_get_target,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_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> \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/net_ure/Module_net_ure.mk b/net_ure/Module_net_ure.mk index 2d939717e367..6693a5ad58ee 100644 --- a/net_ure/Module_net_ure.mk +++ b/net_ure/Module_net_ure.mk @@ -10,7 +10,11 @@ $(eval $(call gb_Module_Module,net_ure)) ifeq ($(ENABLE_DOTNET),TRUE) $(eval $(call gb_Module_add_targets,net_ure,\ + CustomTarget_net_uretypes \ + CustomTarget_net_oootypes \ DotnetLibrary_net_basetypes \ + DotnetLibrary_net_uretypes \ + DotnetLibrary_net_oootypes \ )) endif diff --git a/net_ure/README.md b/net_ure/README.md index 4aaae40a4e86..042981eb9113 100644 --- a/net_ure/README.md +++ b/net_ure/README.md @@ -2,4 +2,4 @@ Support assemblies and tools for the newer cross-platform .NET UNO binding. -Currently only contains code for the net_basetypes assembly in the source/basetypes subdirectory.
\ No newline at end of file +Currently only contains code for the `net_basetypes` assembly in the source/basetypes subdirectory, as well as Makefiles to build the `net_uretypes` (for `udkapi`) and `net_oootypes` (for `offapi`) assemblies, using `netmaker` from the codemaker/ module
\ No newline at end of file |