Skip to content

Commit

Permalink
Correcting creation of .NET Standard assemblies
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jimevans committed Aug 19, 2019
1 parent 2ff9638 commit 72f9d42
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ closure_repositories()

http_archive(
name = "io_bazel_rules_dotnet",
sha256 = "9ee5429417190f00b2c970ba628db833e7ce71323efb646b9ce6b3aaaf56f125",
strip_prefix = "rules_dotnet-e9537b4a545528b11b270dfa124f3193bdb2d78e",
sha256 = "6c5d7080c61abda66458b51167d20683de220bd486ab37bde5c470acea12de66",
strip_prefix = "rules_dotnet-66b235a05ff23c0c65967453e7722d6d7fa28b1c",
urls = [
"https://github.com/bazelbuild/rules_dotnet/archive/e9537b4a545528b11b270dfa124f3193bdb2d78e.tar.gz",
"https://github.com/jimevans/rules_dotnet/archive/66b235a05ff23c0c65967453e7722d6d7fa28b1c.tar.gz",
],
)

Expand Down
2 changes: 1 addition & 1 deletion dotnet/selenium-dotnet-version.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# BUILD FILE SYNTAX: SKYLARK

SE_VERSION = "4.0.0-alpha02"
SE_VERSION = "4.0.0-alpha03"
ASSEMBLY_VERSION = "4.0.0.0"
SUPPORTED_NET_FRAMEWORKS = ["net45", "net46", "net47"]
8 changes: 4 additions & 4 deletions dotnet/src/support/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "core_library", "core_resource", "net_library")
load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "netstandard_library", "net_library")
load("//dotnet:nuget.bzl", "nuget_package")
load(
"//dotnet:selenium-dotnet-version.bzl",
Expand Down Expand Up @@ -29,7 +29,7 @@ load(
],
) for framework in SUPPORTED_NET_FRAMEWORKS]

core_library(
netstandard_library(
name = "netstandard2.0",
srcs = glob([
"*.cs",
Expand All @@ -45,7 +45,7 @@ core_library(
visibility = ["//visibility:public"],
deps = [
"//dotnet/src/webdriver:netstandard2.0",
"@io_bazel_rules_dotnet//dotnet/stdlib.core:netstandard.dll",
"@io_bazel_rules_dotnet//dotnet/stdlib.netstandard:netstandard.dll",
],
)

Expand All @@ -72,7 +72,7 @@ core_library(
],
) for framework in SUPPORTED_NET_FRAMEWORKS]

core_library(
netstandard_library(
name = "netstandard2.0-strongnamed",
srcs = glob([
"*.cs",
Expand Down
10 changes: 5 additions & 5 deletions dotnet/src/webdriver/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "core_library", "core_resource", "net_library")
load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "netstandard_library", "core_resource", "net_library")
load("//dotnet:merge-assemblies.bzl", "merged_assembly")
load("//dotnet:nuget.bzl", "nuget_package")
load(
Expand Down Expand Up @@ -47,7 +47,7 @@ load(
],
) for framework in SUPPORTED_NET_FRAMEWORKS]

core_library(
netstandard_library(
name = "netstandard2.0",
srcs = glob([
"*.cs",
Expand Down Expand Up @@ -75,7 +75,7 @@ core_library(
],
visibility = ["//visibility:public"],
deps = [
"@io_bazel_rules_dotnet//dotnet/stdlib.core:netstandard.dll",
"@io_bazel_rules_dotnet//dotnet/stdlib.netstandard:netstandard.dll",
"@json.net//:netcore",
],
)
Expand Down Expand Up @@ -120,7 +120,7 @@ core_library(
],
) for framework in SUPPORTED_NET_FRAMEWORKS]

core_library(
netstandard_library(
name = "netstandard2.0-strongnamed",
srcs = glob([
"*.cs",
Expand Down Expand Up @@ -149,7 +149,7 @@ core_library(
],
visibility = ["//visibility:public"],
deps = [
"@io_bazel_rules_dotnet//dotnet/stdlib.core:netstandard.dll",
"@io_bazel_rules_dotnet//dotnet/stdlib.netstandard:netstandard.dll",
"@json.net//:netcore",
],
)
Expand Down
6 changes: 3 additions & 3 deletions dotnet/src/webdriverbackedselenium/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "core_library", "core_resource", "net_library")
load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "netstandard_library", "core_resource", "net_library")
load("//dotnet:nuget.bzl", "nuget_package")
load(
"//dotnet:selenium-dotnet-version.bzl",
Expand Down Expand Up @@ -41,7 +41,7 @@ load(
],
) for framework in SUPPORTED_NET_FRAMEWORKS]

core_library(
netstandard_library(
name = "netstandard2.0",
srcs = glob([
"*.cs",
Expand Down Expand Up @@ -108,7 +108,7 @@ core_library(
],
) for framework in SUPPORTED_NET_FRAMEWORKS]

core_library(
netstandard_library(
name = "netstandard2.0-strongnamed",
srcs = glob([
"*.cs",
Expand Down
4 changes: 4 additions & 0 deletions dotnet/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ load("@io_bazel_rules_dotnet//dotnet:defs.bzl",
"net_register_sdk",
"core_register_sdk",
"mono_register_sdk",
"netstandard_register_sdk",
"dotnet_repositories",
"dotnet_nuget_new",
"nuget_package",
Expand All @@ -29,6 +30,9 @@ def selenium_register_dotnet():
# Default net_sdk
net_register_sdk("net472", name = "net_sdk")

# Default netstandard_sdk
netstandard_register_sdk("2.0.3", name = "netstandard_sdk")

dotnet_nuget_new(
name = "json.net",
package = "newtonsoft.json",
Expand Down

0 comments on commit 72f9d42

Please sign in to comment.