Makefile.in                                       |    1 
 RepositoryModule_build.mk                         |    1 
 RepositoryModule_host.mk                          |    1 
 config_host.mk.in                                 |    1 
 configure.ac                                      |   46 +++++
 net_ure/DotnetLibrary_net_basetypes.mk            |   27 +++
 net_ure/Makefile                                  |   13 +
 net_ure/Module_net_ure.mk                         |   17 ++
 net_ure/README.md                                 |    5 
 net_ure/source/basetypes/Any.cs                   |   47 ++++++
 net_ure/source/basetypes/BoundAttribute.cs        |   15 +
 net_ure/source/basetypes/Exception.cs             |   25 +++
 net_ure/source/basetypes/IQueryInterface.cs       |   17 ++
 net_ure/source/basetypes/RaisesAttribute.cs       |   19 ++
 net_ure/source/basetypes/UnoGeneratedAttribute.cs |   16 ++
 solenv/gbuild/DotnetLibrary.mk                    |  171 ++++++++++++++++++++++
 solenv/gbuild/TargetLocations.mk                  |    3 
 solenv/gbuild/gbuild.help.txt                     |    1 
 solenv/gbuild/gbuild.mk                           |    1 
 19 files changed, 426 insertions(+), 1 deletion(-)

New commits:
commit 6538b3b09cf5a3c8fc6d9882dc817afd59c3599c
Author:     RMZeroFour <ritobrot...@gmail.com>
AuthorDate: Thu May 30 14:28:57 2024 +0530
Commit:     Hossein <hoss...@libreoffice.org>
CommitDate: Wed Jun 12 18:48:07 2024 +0200

    .NET Bindings: Add DotnetLibrary class to gbuild
    
    This commit adds the DotnetLibrary gbuild class to build a .NET assembly
    using the .NET SDK.
    
    Also adds an option to enable or disable building .NET components with
    --enable-dotnet (default) and --disable-dotnet to the autogen script.
    
    Also adds a net_ure/ directory for the updated .NET bindings, currently
    consisting of the net_basetypes library.
    
    Change-Id: I9256387a2463ff8476deee85d886c6b3dce8257b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166380
    Tested-by: Jenkins
    Reviewed-by: Hossein <hoss...@libreoffice.org>

diff --git a/Makefile.in b/Makefile.in
index 977e70da615e..b2d59e3075ab 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -137,6 +137,7 @@ gbuild_TARGETS := AllLangHelp \
        CppunitTest \
        CustomTarget \
        Dictionary \
+       DotnetLibrary \
        Executable \
        Extension \
        ExtensionPackage \
diff --git a/RepositoryModule_build.mk b/RepositoryModule_build.mk
index 3efcb3cad705..587e0454d9fd 100644
--- a/RepositoryModule_build.mk
+++ b/RepositoryModule_build.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_Module_add_moduledirs,cross_toolset,\
        jvmaccess \
        jvmfwk \
        l10ntools \
+       net_ure \
        o3tl \
        offapi \
        officecfg \
diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index 0679096de9e8..429df464023f 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -107,6 +107,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
        linguistic \
        lotuswordpro \
        $(call gb_Helper_optional,DESKTOP,l10ntools) \
+       net_ure \
        $(call gb_Helper_optional,NLPSOLVER,nlpsolver) \
        o3tl \
        $(call gb_Helper_optional,ODK,odk) \
diff --git a/config_host.mk.in b/config_host.mk.in
index a3a965364750..787a1e629c43 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -165,6 +165,7 @@ export ENABLE_DBGUTIL=@ENABLE_DBGUTIL@
 export ENABLE_DBUS=@ENABLE_DBUS@
 export ENABLE_DCONF=@ENABLE_DCONF@
 export ENABLE_DEBUG=@ENABLE_DEBUG@
+export ENABLE_DOTNET=@ENABLE_DOTNET@
 SYSTEM_DRAGONBOX=@SYSTEM_DRAGONBOX@
 SYSTEM_FROZEN=@SYSTEM_FROZEN@
 export ENABLE_EPOXY=@ENABLE_EPOXY@
diff --git a/configure.ac b/configure.ac
index 7f77b8f2149a..190e6a9b2510 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1532,7 +1532,7 @@ libo_FUZZ_ARG_ENABLE(extensions,
 
 AC_ARG_ENABLE(scripting,
     AS_HELP_STRING([--disable-scripting],
-        [Disable BASIC, Java and Python. Work in progress, use only if you are 
hacking on it.]),
+        [Disable BASIC, Java, Python and .NET. Work in progress, use only if 
you are hacking on it.]),
 ,test "${enable_scripting+set}" = set || enable_scripting=yes)
 
 # This is mainly for Android and iOS, but could potentially be used in some
@@ -2158,6 +2158,10 @@ AC_ARG_ENABLE(customtarget-components,
     AS_HELP_STRING([--enable-customtarget-components],
         [Generates the static UNO object constructor mapping from the build.]))
 
+AC_ARG_ENABLE(dotnet,
+    AS_HELP_STRING([--enable-dotnet],
+        [Enables or disables .NET 8.0 support and bindings generation.]))
+
 dnl ===================================================================
 dnl Optional Packages (--with/without-)
 dnl ===================================================================
@@ -3561,6 +3565,46 @@ if test "$COMPATH" = "."; then
 fi
 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\$@@"`
 
+dnl ===================================================================
+dnl .NET support
+dnl ===================================================================
+AC_MSG_CHECKING([whether to build with .NET support])
+if test "$enable_dotnet" != "no"; then
+    if test "$DISABLE_SCRIPTING" = TRUE; then
+        AC_MSG_RESULT([no, overridden by --disable-scripting])
+        ENABLE_DOTNET=""
+        enable_dotnet=no
+    else
+        AC_MSG_RESULT([yes])
+        ENABLE_DOTNET="TRUE"
+    fi
+else
+    AC_MSG_RESULT([no])
+    ENABLE_DOTNET=""
+fi
+
+if test "$ENABLE_DOTNET" = TRUE; then
+    AC_PATH_PROG(DOTNET, dotnet)
+    if test "$DOTNET" != ""; then
+        AC_MSG_CHECKING([whether .NET SDK is installed])
+        DOTNET_SDK_VERION=`dotnet --list-sdks`
+        if test "$DOTNET_SDK_VERION" != ""; then
+            AC_MSG_RESULT([yes])
+            AC_DEFINE(HAVE_FEATURE_DOTNET)
+        else
+            AC_MSG_RESULT([no])
+            ENABLE_DOTNET=""
+        fi
+    else
+        ENABLE_DOTNET=""
+    fi
+fi
+
+AC_SUBST(ENABLE_DOTNET)
+
+dnl set ENABLE_DOTNET="TRUE" for build-time and run-time .NET support
+dnl set ENABLE_DOTNET="" for no .NET support at all
+
 dnl ===================================================================
 dnl Java support
 dnl ===================================================================
diff --git a/net_ure/DotnetLibrary_net_basetypes.mk 
b/net_ure/DotnetLibrary_net_basetypes.mk
new file mode 100644
index 000000000000..b8500fd7aa26
--- /dev/null
+++ b/net_ure/DotnetLibrary_net_basetypes.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_basetypes))
+
+$(eval $(call gb_DotnetLibrary_add_sources,net_basetypes,\
+    net_ure/source/basetypes/Any.cs \
+    net_ure/source/basetypes/BoundAttribute.cs \
+    net_ure/source/basetypes/Exception.cs \
+    net_ure/source/basetypes/IQueryInterface.cs \
+    net_ure/source/basetypes/RaisesAttribute.cs \
+    net_ure/source/basetypes/UnoGeneratedAttribute.cs \
+))
+
+$(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> \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/net_ure/Makefile b/net_ure/Makefile
new file mode 100644
index 000000000000..0c6f47b1790f
--- /dev/null
+++ b/net_ure/Makefile
@@ -0,0 +1,13 @@
+# -*- 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/.
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/net_ure/Module_net_ure.mk b/net_ure/Module_net_ure.mk
new file mode 100644
index 000000000000..2d939717e367
--- /dev/null
+++ b/net_ure/Module_net_ure.mk
@@ -0,0 +1,17 @@
+# -*- 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_Module_Module,net_ure))
+
+ifeq ($(ENABLE_DOTNET),TRUE)
+$(eval $(call gb_Module_add_targets,net_ure,\
+       DotnetLibrary_net_basetypes \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/net_ure/README.md b/net_ure/README.md
new file mode 100644
index 000000000000..4aaae40a4e86
--- /dev/null
+++ b/net_ure/README.md
@@ -0,0 +1,5 @@
+# .NET UNO Runtime Environment
+
+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
diff --git a/net_ure/source/basetypes/Any.cs b/net_ure/source/basetypes/Any.cs
new file mode 100644
index 000000000000..163bc59de631
--- /dev/null
+++ b/net_ure/source/basetypes/Any.cs
@@ -0,0 +1,47 @@
+/*
+ * 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/.
+ */
+
+using System;
+
+namespace com.sun.star.uno
+{
+    public class Any
+    {
+        public static readonly Any VOID = new Any(typeof(void), null);
+
+        public Type Type { get; private set; }
+        public Object Value { get; private set; }
+
+        public Any(Type type, object value) => setValue(type, value);
+        public static Any with<T>(T value) => new Any(typeof(T), value);
+
+        public bool hasValue() => Type != typeof(void);
+
+        public void setValue(Type type, object value)
+        {
+            if (type is null)
+                throw new ArgumentNullException(nameof(type), "Type of Any 
cannot be null.");
+
+            if (type == typeof(Any))
+                throw new ArgumentException("Any object cannot be nested 
inside another Any.");
+
+            if (value is null && type != typeof(void))
+                throw new ArgumentException("Value of Any can only be null if 
Type is void." +
+                    " Perhaps you want Any.VOID?");
+
+            Type = type;
+            Value = value;
+        }
+
+        public bool equals(Any obj) => Type == obj.Type && Value == obj.Value;
+
+        public override bool Equals(object obj) => (obj is Any other) && 
equals(other);
+        public override int GetHashCode() => (Type, Value).GetHashCode();
+        public override string ToString() => $"uno.Any {{ Type = {Type}, Value 
= {Value ?? "Null"} }}";
+    }
+}
diff --git a/net_ure/source/basetypes/BoundAttribute.cs 
b/net_ure/source/basetypes/BoundAttribute.cs
new file mode 100644
index 000000000000..93241f387f46
--- /dev/null
+++ b/net_ure/source/basetypes/BoundAttribute.cs
@@ -0,0 +1,15 @@
+/*
+ * 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/.
+ */
+
+using System;
+
+namespace com.sun.star.uno
+{
+    [AttributeUsage(AttributeTargets.Property, Inherited = false)]
+    public sealed class BoundAttribute : Attribute { }
+}
diff --git a/net_ure/source/basetypes/Exception.cs 
b/net_ure/source/basetypes/Exception.cs
new file mode 100644
index 000000000000..c4a485a7a855
--- /dev/null
+++ b/net_ure/source/basetypes/Exception.cs
@@ -0,0 +1,25 @@
+/*
+ * 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/.
+ */
+
+using System;
+
+namespace com.sun.star.uno
+{
+    public class Exception : System.Exception
+    {
+        public new string Message { get; set; }
+        public IQueryInterface Context { get; set; }
+        
+        public Exception() { }
+        public Exception(string Message, IQueryInterface Context)
+        {
+            this.Message = Message;
+            this.Context = Context;
+        }
+    }
+}
diff --git a/net_ure/source/basetypes/IQueryInterface.cs 
b/net_ure/source/basetypes/IQueryInterface.cs
new file mode 100644
index 000000000000..714beb54f333
--- /dev/null
+++ b/net_ure/source/basetypes/IQueryInterface.cs
@@ -0,0 +1,17 @@
+/*
+ * 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/.
+ */
+
+using System;
+
+namespace com.sun.star.uno
+{
+    public interface IQueryInterface
+    {
+        // Kept empty for now, until the .NET bridge is in place
+    }
+}
diff --git a/net_ure/source/basetypes/RaisesAttribute.cs 
b/net_ure/source/basetypes/RaisesAttribute.cs
new file mode 100644
index 000000000000..04f01bfc6726
--- /dev/null
+++ b/net_ure/source/basetypes/RaisesAttribute.cs
@@ -0,0 +1,19 @@
+/*
+ * 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/.
+ */
+
+using System;
+
+namespace com.sun.star.uno
+{
+    [AttributeUsage(AttributeTargets.Method, Inherited = false)]
+    public sealed class RaisesAttribute : Attribute
+    {
+        public Type[] Raises { get; }
+        public RaisesAttribute(params Type[] raises) => Raises = raises;
+    }
+}
diff --git a/net_ure/source/basetypes/UnoGeneratedAttribute.cs 
b/net_ure/source/basetypes/UnoGeneratedAttribute.cs
new file mode 100644
index 000000000000..b6ca950fc6fb
--- /dev/null
+++ b/net_ure/source/basetypes/UnoGeneratedAttribute.cs
@@ -0,0 +1,16 @@
+/*
+ * 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/.
+ */
+
+using System;
+
+namespace com.sun.star.uno
+{
+       [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class
+               | AttributeTargets.Interface | AttributeTargets.Enum, Inherited 
= false)]
+       public sealed class UnoGeneratedAttribute : Attribute { }
+}
\ No newline at end of file
diff --git a/solenv/gbuild/DotnetLibrary.mk b/solenv/gbuild/DotnetLibrary.mk
new file mode 100644
index 000000000000..10a32b159b40
--- /dev/null
+++ b/solenv/gbuild/DotnetLibrary.mk
@@ -0,0 +1,171 @@
+# -*- 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/.
+#
+
+##############################
+# DotnetLibrary Target Class #
+##############################
+
+####### Constant Strings #########
+
+gb_DotnetLibrary__CONFIG_RELEASE := -c Release
+gb_DotnetLibrary__CONFIG_DEBUG := -c Debug
+
+####### Helper Functions #########
+
+define gb_DotnetLibrary__get_build_config
+$(if $(or \
+               $(filter TRUE,$(strip $(debug))), \
+               $(filter TRUE,$(strip $(ENABLE_DBGUTIL))) \
+       ), \
+       $(gb_DotnetLibrary__CONFIG_DEBUG), \
+       $(gb_DotnetLibrary__CONFIG_RELEASE))
+
+endef
+
+define gb_DotnetLibrary__escape_quotes
+$(strip $(subst ",\",$(1)))
+
+endef
+
+####### Build and Clean Targets #########
+
+.PHONY : $(call gb_DotnetLibrary_get_clean_target,%)
+$(call gb_DotnetLibrary_get_clean_target,%) :
+       $(call gb_Output_announce,$*,$(false),NET,4)
+       $(call gb_Helper_abbreviate_dirs,\
+               rm -rf $(call gb_DotnetLibrary_get_target,$*))
+
+$(call gb_DotnetLibrary_get_target,%) :
+       $(call gb_Output_announce,$*,$(true),NET,4)
+       $(call gb_Trace_StartRange,$*,NET)
+       $(call gb_Helper_abbreviate_dirs,\
+               mkdir -p $(call gb_DotnetLibrary_get_workdir,$*) && \
+               P=$(DOTNET_PROJECT_FILE) && \
+               echo "<Project Sdk=\"Microsoft.NET.Sdk\">" > $$P && \
+               echo "<PropertyGroup>" >> $$P && \
+               echo "$(DOTNET_PROPERTY_ELEMENTS)" >> $$P && \
+               echo "</PropertyGroup>" >> $$P && \
+               echo "<ItemGroup>" >> $$P && \
+               echo "$(DOTNET_ITEM_ELEMENTS)" >> $$P && \
+               echo "</ItemGroup>" >> $$P && \
+               echo "</Project>" >> $$P && \
+               dotnet build $$P $(DOTNET_BUILD_FLAGS) \
+                       -o $(call gb_DotnetLibrary_get_workdir,$*) \
+                       > $@.log 2>&1 || \
+                       (cat $@.log \
+                               && echo \
+                               && echo "A library failed to build. To retry 
the build, use:" \
+                               && echo "    make DotnetLibrary_$*" \
+                               && echo "cd into the module directory to run 
the build faster" \
+                               && echo \
+                               && false) && \
+               touch $@)
+       $(call gb_Trace_EndRange,$*,NET)
+
+####### Library Target Constructors #########
+
+define gb_DotnetLibrary__common_ctor
+$(call gb_DotnetLibrary_get_target,$(1)) : DOTNET_BUILD_FLAGS := $(strip 
$(call gb_DotnetLibrary__get_build_config))
+$(call gb_DotnetLibrary_get_target,$(1)) : DOTNET_PROPERTY_ELEMENTS := 
<TargetFramework>netstandard20</TargetFramework>
+$(call gb_DotnetLibrary_get_target,$(1)) : DOTNET_ITEM_ELEMENTS :=
+$(call gb_DotnetLibrary_get_target,$(1)) : DOTNET_PROJECT_FILE := $(call 
gb_DotnetLibrary_get_workdir,$(1))/$(1).$(2)
+
+$(eval $(call gb_Module_register_target, \
+       $(call gb_DotnetLibrary_get_target,$(1)), \
+       $(call gb_DotnetLibrary_get_clean_target,$(1))))
+$(call gb_Helper_make_userfriendly_targets,$(1),DotnetLibrary)
+
+endef
+
+# Generates one csproj file from given inputs and builds it
+# call gb_DotnetLibrary_CsLibrary,targetname
+define gb_DotnetLibrary_CsLibrary
+$(call gb_DotnetLibrary__common_ctor,$(1),csproj)
+
+endef
+
+# Generates one fsproj file from given inputs and builds it
+# call gb_DotnetLibrary_FsLibrary,targetname
+define gb_DotnetLibrary_FsLibrary
+$(call gb_DotnetLibrary__common_ctor,$(1),fsproj)
+
+endef
+
+# Generates one vbproj file from given inputs and builds it
+# call gb_DotnetLibrary_VbLibrary,targetname
+define gb_DotnetLibrary_VbLibrary
+$(call gb_DotnetLibrary__common_ctor,$(1),vbproj)
+
+endef
+
+####### Target Property Setters #########
+
+# Add flags used for compilation
+# call gb_DotnetLibrary_add_build_flags,target,flags
+define gb_DotnetLibrary_add_build_flags
+$(call gb_DotnetLibrary_get_target,$(1)) : DOTNET_BUILD_FLAGS += $(2)
+
+endef
+
+# Add <PropertyGroup> elements to the project file
+# call gb_DotnetLibrary_add_properties,target,properties
+define gb_DotnetLibrary_add_properties
+$(call gb_DotnetLibrary_get_target,$(1)) : DOTNET_PROPERTY_ELEMENTS += $(strip 
$(call gb_DotnetLibrary__escape_quotes,$(2)))
+
+endef
+
+# Add <ItemGroup> elements to the project file
+# call gb_DotnetLibrary_add_items,target,items
+define gb_DotnetLibrary_add_items
+$(call gb_DotnetLibrary_get_target,$(1)) : DOTNET_ITEM_ELEMENTS += $(strip 
$(call gb_DotnetLibrary__escape_quotes,$(2)))
+
+endef
+
+# Add one source file to the project file
+# This add it to the project, and makes it a build dependency
+# so the library is rebuilt if the source changes
+# call gb_DotnetLibrary_add_source,target,source
+define gb_DotnetLibrary_add_source
+$(call gb_DotnetLibrary_get_target,$(1)) : $(SRCDIR)/$(strip $(2))
+$(call gb_DotnetLibrary_add_items,$(1),<Compile Include="$(SRCDIR)/$(strip 
$(2))"/>)
+
+endef
+
+# Add source files to the project file
+# call gb_DotnetLibrary_add_sources,target,sources
+define gb_DotnetLibrary_add_sources
+$(foreach source,$(2),$(call gb_DotnetLibrary_add_source,$(1),$(source)))
+
+endef
+
+# Link to a DotnetLibrary_CsLibrary target
+# call gb_DotnetLibrary_link_cs_project,target,project
+define gb_DotnetLibrary_link_cs_project
+$(call gb_DotnetLibrary_get_target,$(1)) : $(call 
gb_DotnetLibrary_get_target,$(strip $(2)))
+$(call gb_DotnetLibrary_add_items,$(1),<ProjectReference Include="$(call 
gb_DotnetLibrary_get_workdir,$(strip $(2)))/$(strip $(2)).csproj"/>)
+
+endef
+
+# Link to a DotnetLibrary_FsLibrary target
+# call gb_DotnetLibrary_link_fs_project,target,project
+define gb_DotnetLibrary_link_fs_project
+$(call gb_DotnetLibrary_get_target,$(1)) : $(call 
gb_DotnetLibrary_get_target,$(strip $(2)))
+$(call gb_DotnetLibrary_add_items,$(1),<ProjectReference Include="$(call 
gb_DotnetLibrary_get_workdir,$(strip $(2)))/$(strip $(2)).fsproj"/>)
+
+endef
+
+# Link to a DotnetLibrary_VbLibrary target
+# call gb_DotnetLibrary_link_vb_project,target,project
+define gb_DotnetLibrary_link_vb_project
+$(call gb_DotnetLibrary_get_target,$(1)) : $(call 
gb_DotnetLibrary_get_target,$(strip $(2)))
+$(call gb_DotnetLibrary_add_items,$(1),<ProjectReference Include="$(call 
gb_DotnetLibrary_get_workdir,$(strip $(2)))/$(strip $(2)).vbproj"/>)
+
+endef
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index f0f088315851..d315a2453560 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -62,6 +62,8 @@ gb_DescriptionTranslateTarget_get_target = 
$(WORKDIR)/DescriptionTranslateTarget
 gb_Dictionary_get_target = $(WORKDIR)/Dictionary/$(1).done
 gb_CxxObject_get_target = $(WORKDIR)/CxxObject/$(1).o
 gb_CxxObject_get_dwo_target = $(WORKDIR)/CxxObject/$(1).dwo
+gb_DotnetLibrary_get_target = $(WORKDIR)/DotnetLibrary/$(1).done
+gb_DotnetLibrary_get_workdir = $(WORKDIR)/DotnetLibrary/$(1)
 gb_GenCxxObject_get_target = $(WORKDIR)/GenCxxObject/$(1).o
 gb_GenCxxObject_get_dwo_target = $(WORKDIR)/GenCxxObject/$(1).dwo
 gb_GenAsmObject_get_target = $(WORKDIR)/GenAsmObject/$(1).o
@@ -272,6 +274,7 @@ $(eval $(call gb_Helper_make_clean_targets,\
        CustomPackage \
        DescriptionTranslateTarget \
        Dictionary \
+       DotnetLibrary \
        Executable \
        ExternalPackage \
        Extension \
diff --git a/solenv/gbuild/gbuild.help.txt b/solenv/gbuild/gbuild.help.txt
index 647bd74afea1..7b66d154b73a 100644
--- a/solenv/gbuild/gbuild.help.txt
+++ b/solenv/gbuild/gbuild.help.txt
@@ -82,6 +82,7 @@ AVAILABLE TARGETS
            o CppunitTest
            o CustomTarget
            o Dictionary
+           o DotnetLibrary
            o Executable
            o Extension
            o ExternalPackage
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index ab6132e3b5d2..30f2fbe3b21e 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -331,6 +331,7 @@ include $(foreach class, \
        CliLibrary \
        CliNativeLibrary \
        CliUnoApi \
+       DotnetLibrary \
        Zip \
        AllLangPackage \
        Configuration \

Reply via email to