From 758e7d1521ae3b383f2c57997ad3f311e263f585 Mon Sep 17 00:00:00 2001 From: Jacob Parker Date: Tue, 8 Oct 2019 21:31:39 -0400 Subject: [PATCH] Add limited net11/net30/net35/net403 support (mostly for NuGet packages) --- .../macros/setup_basic_nuget_package.bzl | 4 +++ csharp/private/providers.bzl | 26 ++++++++++++++++-- csharp/private/rules/imports.bzl | 4 +++ examples/import_nuget_package/BUILD | 7 +++++ .../lib/net11/SomePackage.dll | Bin 0 -> 3584 bytes 5 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 examples/import_nuget_package/ExamplePackageFolder/lib/net11/SomePackage.dll diff --git a/csharp/private/macros/setup_basic_nuget_package.bzl b/csharp/private/macros/setup_basic_nuget_package.bzl index 990dde3..3a7fdc2 100644 --- a/csharp/private/macros/setup_basic_nuget_package.bzl +++ b/csharp/private/macros/setup_basic_nuget_package.bzl @@ -73,8 +73,12 @@ def setup_basic_nuget_package(): netstandard1_6 = tfms.get("netstandard1.6"), netstandard2_0 = tfms.get("netstandard2.0"), netstandard2_1 = tfms.get("netstandard2.1"), + net11 = tfms.get("net11"), net20 = tfms.get("net20"), + net30 = tfms.get("net30"), + net35 = tfms.get("net35"), net40 = tfms.get("net40"), + net403 = tfms.get("net403"), net45 = tfms.get("net45"), net451 = tfms.get("net451"), net452 = tfms.get("net452"), diff --git a/csharp/private/providers.bzl b/csharp/private/providers.bzl index 14651d8..e1ee048 100644 --- a/csharp/private/providers.bzl +++ b/csharp/private/providers.bzl @@ -33,8 +33,12 @@ CSharpAssembly_netstandard15 = _make_csharp_provider("netstandard1.5") CSharpAssembly_netstandard16 = _make_csharp_provider("netstandard1.6") CSharpAssembly_netstandard20 = _make_csharp_provider("netstandard2.0") CSharpAssembly_netstandard21 = _make_csharp_provider("netstandard2.1") +CSharpAssembly_net11 = _make_csharp_provider("net11") CSharpAssembly_net20 = _make_csharp_provider("net20") +CSharpAssembly_net30 = _make_csharp_provider("net30") +CSharpAssembly_net35 = _make_csharp_provider("net35") CSharpAssembly_net40 = _make_csharp_provider("net40") +CSharpAssembly_net403 = _make_csharp_provider("net403") CSharpAssembly_net45 = _make_csharp_provider("net45") CSharpAssembly_net451 = _make_csharp_provider("net451") CSharpAssembly_net452 = _make_csharp_provider("net452") @@ -64,8 +68,12 @@ CSharpAssembly = { "netstandard1.6": CSharpAssembly_netstandard16, "netstandard2.0": CSharpAssembly_netstandard20, "netstandard2.1": CSharpAssembly_netstandard21, + "net11": CSharpAssembly_net11, "net20": CSharpAssembly_net20, + "net30": CSharpAssembly_net30, + "net35": CSharpAssembly_net35, "net40": CSharpAssembly_net40, + "net403": CSharpAssembly_net403, "net45": CSharpAssembly_net45, "net451": CSharpAssembly_net451, "net452": CSharpAssembly_net452, @@ -102,9 +110,13 @@ FrameworkCompatibility = { "netstandard2.1": ["netstandard2.0"], # .NET Framework - "net20": [], - "net40": ["net20"], - "net45": ["net40", "netstandard1.1"], + "net11": [], + "net20": ["net11"], + "net30": ["net20"], + "net35": ["net30"], + "net40": ["net35"], + "net403": ["net40"], + "net45": ["net403", "netstandard1.1"], "net451": ["net45", "netstandard1.2"], "net452": ["net451"], "net46": ["net452", "netstandard1.3"], @@ -135,8 +147,12 @@ SubsystemVersion = { "netstandard1.6": None, "netstandard2.0": None, "netstandard2.1": None, + "net11": None, "net20": None, + "net30": None, + "net35": None, "net40": None, + "net403": None, "net45": "6.00", "net451": "6.00", "net452": "6.00", @@ -166,8 +182,12 @@ DefaultLangVersion = { "netstandard1.6": "7.3", "netstandard2.0": "7.3", "netstandard2.1": "7.3", + "net11": "7.3", "net20": "7.3", + "net30": "7.3", + "net35": "7.3", "net40": "7.3", + "net403": "7.3", "net45": "7.3", "net451": "7.3", "net452": "7.3", diff --git a/csharp/private/rules/imports.bzl b/csharp/private/rules/imports.bzl index 6f804fc..d859703 100644 --- a/csharp/private/rules/imports.bzl +++ b/csharp/private/rules/imports.bzl @@ -89,8 +89,12 @@ def _import_multiframework_library_impl(ctx): "netstandard1.6": ctx.attr.netstandard1_6, "netstandard2.0": ctx.attr.netstandard2_0, "netstandard2.1": ctx.attr.netstandard2_1, + "net11": ctx.attr.net11, "net20": ctx.attr.net20, + "net30": ctx.attr.net30, + "net35": ctx.attr.net35, "net40": ctx.attr.net40, + "net403": ctx.attr.net403, "net45": ctx.attr.net45, "net451": ctx.attr.net451, "net452": ctx.attr.net452, diff --git a/examples/import_nuget_package/BUILD b/examples/import_nuget_package/BUILD index 6c96f3d..8377fad 100644 --- a/examples/import_nuget_package/BUILD +++ b/examples/import_nuget_package/BUILD @@ -9,3 +9,10 @@ csharp_library( "@ExamplePackageFolder//:SomePackage", ], ) + +csharp_library( + name = "OldThing", + srcs = ["Class.cs"], + target_frameworks = ["net11"], + deps = ["@ExamplePackageFolder//:SomePackage"], +) diff --git a/examples/import_nuget_package/ExamplePackageFolder/lib/net11/SomePackage.dll b/examples/import_nuget_package/ExamplePackageFolder/lib/net11/SomePackage.dll new file mode 100644 index 0000000000000000000000000000000000000000..28cdacad28ed49e4b90a626e7903052a9f2a664e GIT binary patch literal 3584 zcmeHJ-ES0C6#rfNK`DZ*AivB0t)~+p(UH$&Yprs55z{ag#G-0W)?Og=KOkwj2kNXsctg6zA+vdjSn4 zR?M)8FT=1;DaSH4$IX6+)RiQ$twIM17I2w$P$K*nG+cafSf#UN`ME(mYY$`x`uB^o z4tPY1&ih^i-eNDUuNa4}Uya0KGuM_B`;Hg!ILESeeTR;Z<=H#{HX@8DT%$CtmGhaX)=}uY*k6$iAy-CI-!){b{tX<;yhKI_z@XOE*cy+c*fv2 z2KN!gPvS*#U4tR|>?L;M5n?x)>>@sfgTy|bMH^3H zhB$y4@mZWFju`o2V*6rqWrkpg37gGMSv(BM-OzL6L8am8=i%!(iXFe=gcTHnnl3oy zvrbhbuS<<;)hT&;DCQoN8nMPu6zN*YTbOd=JBbgvo}SiWrl^=ORTregvc*g|#g?@$*+$%}Qz~(h1YgZ;?Ns zTcN`+X=K2;&)Y6QjTgk#D{Lot-zJYBQ+coO0w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