Skip to content

Commit 72f9d42

Browse files
committed
Correcting creation of .NET Standard assemblies
In 4.0 alpha 2, the project moved to Bazel to build the .NET bindings. There is a subtle bug in the Bazel project's rules for building .NET Core/.NET Standard code that generates unusable assemblies. A PR has been submitted to the .NET rules for Bazel. In the meantime, this commit points to a fork containing the fix. Fixes issue #7436. Or it should. We hope. If not, it'll be back to the proverbial drawing board.
1 parent 2ff9638 commit 72f9d42

File tree

6 files changed

+20
-16
lines changed

6 files changed

+20
-16
lines changed

WORKSPACE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ closure_repositories()
2323

2424
http_archive(
2525
name = "io_bazel_rules_dotnet",
26-
sha256 = "9ee5429417190f00b2c970ba628db833e7ce71323efb646b9ce6b3aaaf56f125",
27-
strip_prefix = "rules_dotnet-e9537b4a545528b11b270dfa124f3193bdb2d78e",
26+
sha256 = "6c5d7080c61abda66458b51167d20683de220bd486ab37bde5c470acea12de66",
27+
strip_prefix = "rules_dotnet-66b235a05ff23c0c65967453e7722d6d7fa28b1c",
2828
urls = [
29-
"https://github.com/bazelbuild/rules_dotnet/archive/e9537b4a545528b11b270dfa124f3193bdb2d78e.tar.gz",
29+
"https://github.com/jimevans/rules_dotnet/archive/66b235a05ff23c0c65967453e7722d6d7fa28b1c.tar.gz",
3030
],
3131
)
3232

dotnet/selenium-dotnet-version.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# BUILD FILE SYNTAX: SKYLARK
22

3-
SE_VERSION = "4.0.0-alpha02"
3+
SE_VERSION = "4.0.0-alpha03"
44
ASSEMBLY_VERSION = "4.0.0.0"
55
SUPPORTED_NET_FRAMEWORKS = ["net45", "net46", "net47"]

dotnet/src/support/BUILD.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "core_library", "core_resource", "net_library")
1+
load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "netstandard_library", "net_library")
22
load("//dotnet:nuget.bzl", "nuget_package")
33
load(
44
"//dotnet:selenium-dotnet-version.bzl",
@@ -29,7 +29,7 @@ load(
2929
],
3030
) for framework in SUPPORTED_NET_FRAMEWORKS]
3131

32-
core_library(
32+
netstandard_library(
3333
name = "netstandard2.0",
3434
srcs = glob([
3535
"*.cs",
@@ -45,7 +45,7 @@ core_library(
4545
visibility = ["//visibility:public"],
4646
deps = [
4747
"//dotnet/src/webdriver:netstandard2.0",
48-
"@io_bazel_rules_dotnet//dotnet/stdlib.core:netstandard.dll",
48+
"@io_bazel_rules_dotnet//dotnet/stdlib.netstandard:netstandard.dll",
4949
],
5050
)
5151

@@ -72,7 +72,7 @@ core_library(
7272
],
7373
) for framework in SUPPORTED_NET_FRAMEWORKS]
7474

75-
core_library(
75+
netstandard_library(
7676
name = "netstandard2.0-strongnamed",
7777
srcs = glob([
7878
"*.cs",

dotnet/src/webdriver/BUILD.bazel

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "core_library", "core_resource", "net_library")
1+
load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "netstandard_library", "core_resource", "net_library")
22
load("//dotnet:merge-assemblies.bzl", "merged_assembly")
33
load("//dotnet:nuget.bzl", "nuget_package")
44
load(
@@ -47,7 +47,7 @@ load(
4747
],
4848
) for framework in SUPPORTED_NET_FRAMEWORKS]
4949

50-
core_library(
50+
netstandard_library(
5151
name = "netstandard2.0",
5252
srcs = glob([
5353
"*.cs",
@@ -75,7 +75,7 @@ core_library(
7575
],
7676
visibility = ["//visibility:public"],
7777
deps = [
78-
"@io_bazel_rules_dotnet//dotnet/stdlib.core:netstandard.dll",
78+
"@io_bazel_rules_dotnet//dotnet/stdlib.netstandard:netstandard.dll",
7979
"@json.net//:netcore",
8080
],
8181
)
@@ -120,7 +120,7 @@ core_library(
120120
],
121121
) for framework in SUPPORTED_NET_FRAMEWORKS]
122122

123-
core_library(
123+
netstandard_library(
124124
name = "netstandard2.0-strongnamed",
125125
srcs = glob([
126126
"*.cs",
@@ -149,7 +149,7 @@ core_library(
149149
],
150150
visibility = ["//visibility:public"],
151151
deps = [
152-
"@io_bazel_rules_dotnet//dotnet/stdlib.core:netstandard.dll",
152+
"@io_bazel_rules_dotnet//dotnet/stdlib.netstandard:netstandard.dll",
153153
"@json.net//:netcore",
154154
],
155155
)

dotnet/src/webdriverbackedselenium/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "core_library", "core_resource", "net_library")
1+
load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "netstandard_library", "core_resource", "net_library")
22
load("//dotnet:nuget.bzl", "nuget_package")
33
load(
44
"//dotnet:selenium-dotnet-version.bzl",
@@ -41,7 +41,7 @@ load(
4141
],
4242
) for framework in SUPPORTED_NET_FRAMEWORKS]
4343

44-
core_library(
44+
netstandard_library(
4545
name = "netstandard2.0",
4646
srcs = glob([
4747
"*.cs",
@@ -108,7 +108,7 @@ core_library(
108108
],
109109
) for framework in SUPPORTED_NET_FRAMEWORKS]
110110

111-
core_library(
111+
netstandard_library(
112112
name = "netstandard2.0-strongnamed",
113113
srcs = glob([
114114
"*.cs",

dotnet/workspace.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ load("@io_bazel_rules_dotnet//dotnet:defs.bzl",
33
"net_register_sdk",
44
"core_register_sdk",
55
"mono_register_sdk",
6+
"netstandard_register_sdk",
67
"dotnet_repositories",
78
"dotnet_nuget_new",
89
"nuget_package",
@@ -29,6 +30,9 @@ def selenium_register_dotnet():
2930
# Default net_sdk
3031
net_register_sdk("net472", name = "net_sdk")
3132

33+
# Default netstandard_sdk
34+
netstandard_register_sdk("2.0.3", name = "netstandard_sdk")
35+
3236
dotnet_nuget_new(
3337
name = "json.net",
3438
package = "newtonsoft.json",

0 commit comments

Comments
 (0)