Skip to content

Commit

Permalink
Add limited net11/net30/net35/net403 support (mostly for NuGet packages)
Browse files Browse the repository at this point in the history
  • Loading branch information
j3parker committed Oct 9, 2019
1 parent 66c58e6 commit 758e7d1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 3 deletions.
4 changes: 4 additions & 0 deletions csharp/private/macros/setup_basic_nuget_package.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
26 changes: 23 additions & 3 deletions csharp/private/providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions csharp/private/rules/imports.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions examples/import_nuget_package/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ csharp_library(
"@ExamplePackageFolder//:SomePackage",
],
)

csharp_library(
name = "OldThing",
srcs = ["Class.cs"],
target_frameworks = ["net11"],
deps = ["@ExamplePackageFolder//:SomePackage"],
)
Binary file not shown.

0 comments on commit 758e7d1

Please sign in to comment.