Skip to content

Commit

Permalink
Correcting .NET Bazel build files for new version of .NET build rules
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Jan 23, 2020
1 parent 29a2ac6 commit ab31212
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 23 deletions.
49 changes: 39 additions & 10 deletions dotnet/src/support/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@d2l_rules_csharp//csharp:defs.bzl", "csharp_library")
load("//:copy_file.bzl", "copy_file")
load("//dotnet:nuget.bzl", "nuget_package")
load("//dotnet:assembly-info.bzl", "generated_assembly_info")
load(
Expand Down Expand Up @@ -32,7 +33,7 @@ generated_assembly_info(
"PageObjects/**/*.cs",
"UI/*.cs",
]) + [":assembly-info"],
out = "merged/{}/WebDriver.Support".format(framework),
out = "WebDriver.Support",
target_frameworks = [
"{}".format(framework),
],
Expand All @@ -43,7 +44,7 @@ generated_assembly_info(
"@net//:System.Data",
"@net//:System.Drawing",
"@net//:System.Xml",
"//dotnet/src/webdriver:{}assembly".format(framework),
"//dotnet/src/webdriver:{}".format(framework),
],
) for framework in SUPPORTED_NET_FRAMEWORKS]

Expand All @@ -56,7 +57,7 @@ csharp_library(
"PageObjects/**/*.cs",
"UI/*.cs",
]) + [":assembly-info"],
out = "merged/netstandard2.0/WebDriver.Support",
out = "WebDriver.Support",
target_frameworks = [
"netstandard2.0",
],
Expand All @@ -75,7 +76,7 @@ csharp_library(
"PageObjects/**/*.cs",
"UI/*.cs",
]) + [":assembly-info"],
out = "strongnamed/{}/WebDriver.Support".format(framework),
out = "strongnamed/WebDriver.Support",
keyfile = "//dotnet:WebDriver.snk",
target_frameworks = [
"{}".format(framework),
Expand All @@ -87,7 +88,7 @@ csharp_library(
"@net//:System.Data",
"@net//:System.Drawing",
"@net//:System.Xml",
"//dotnet/src/webdriver:{}assembly-strongnamed".format(framework),
"//dotnet/src/webdriver:{}-strongnamed".format(framework),
],
) for framework in SUPPORTED_NET_FRAMEWORKS]

Expand All @@ -100,7 +101,7 @@ csharp_library(
"PageObjects/**/*.cs",
"UI/*.cs",
]) + [":assembly-info"],
out = "strongnamed/netstandard2.0/WebDriver.Support",
out = "strongnamed/WebDriver.Support",
keyfile = "//dotnet:WebDriver.snk",
target_frameworks = [
"netstandard2.0",
Expand All @@ -124,15 +125,43 @@ nuget_package(
],
)

copy_file(
name = "copy-net45-strongnamed",
src = ":net45-strongnamed",
out = "strongnamed/net45/WebDriver.Support.dll",
visibility = ["//visibility:public"],
)

copy_file(
name = "copy-net46-strongnamed",
src = ":net46-strongnamed",
out = "strongnamed/net46/WebDriver.Support.dll",
visibility = ["//visibility:public"],
)

copy_file(
name = "copy-net47-strongnamed",
src = ":net47-strongnamed",
out = "strongnamed/net47/WebDriver.Support.dll",
visibility = ["//visibility:public"],
)

copy_file(
name = "copy-netstandard2.0-strongnamed",
src = ":netstandard2.0-strongnamed",
out = "strongnamed/netstandard2.0/WebDriver.Support.dll",
visibility = ["//visibility:public"],
)

nuget_package(
name = "package-strongnamed",
src = "WebDriver.Support.nuspec",
package_id = "Selenium.Support.StrongNamed",
package_version = "{}".format(SE_VERSION),
deps = [
":net45-strongnamed",
":net46-strongnamed",
":net47-strongnamed",
":netstandard2.0-strongnamed",
":copy-net45-strongnamed",
":copy-net46-strongnamed",
":copy-net47-strongnamed",
":copy-netstandard2.0-strongnamed",
],
)
4 changes: 2 additions & 2 deletions dotnet/src/webdriver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ csharp_library(
"@net//:System.Runtime.Serialization",
"@net//:System.Xml",
],
out = "WebDriver",
out = "strongnamed/WebDriver",
) for framework in SUPPORTED_NET_FRAMEWORKS]

csharp_library(
Expand Down Expand Up @@ -174,7 +174,7 @@ csharp_library(
deps = [
"@json.net//:Newtonsoft.Json",
],
out = "WebDriver",
out = "strongnamed/WebDriver",
)

[merged_assembly(
Expand Down
50 changes: 39 additions & 11 deletions dotnet/src/webdriverbackedselenium/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ generated_assembly_info(
"*.cs",
"Internal/**/*.cs",
]) + [":assembly-info"],
out = "merged/{}/Selenium.WebDriverBackedSelenium".format(framework),
out = "Selenium.WebDriverBackedSelenium",
resources = [
"//java/client/src/com/thoughtworks/selenium/webdriven:htmlutils.js",
"//java/client/src/com/thoughtworks/selenium/webdriven:injectableSelenium.js",
Expand Down Expand Up @@ -59,7 +59,7 @@ generated_assembly_info(
"@net//:System.Net.Http",
"@net//:System.Runtime.Serialization",
"@net//:System.Xml",
"//dotnet/src/webdriver:{}assembly".format(framework),
"//dotnet/src/webdriver:{}".format(framework),
],
) for framework in SUPPORTED_NET_FRAMEWORKS]

Expand All @@ -69,7 +69,7 @@ csharp_library(
"*.cs",
"Internal/**/*.cs",
]) + [":assembly-info"],
out = "merged/netstandard2.0/Selenium.WebDriverBackedSelenium",
out = "Selenium.WebDriverBackedSelenium",
resources = [
"//java/client/src/com/thoughtworks/selenium/webdriven:htmlutils.js",
"//java/client/src/com/thoughtworks/selenium/webdriven:injectableSelenium.js",
Expand Down Expand Up @@ -100,7 +100,7 @@ csharp_library(
"*.cs",
"Internal/**/*.cs",
]) + [":assembly-info"],
out = "strongnamed/{}/Selenium.WebDriverBackedSelenium".format(framework),
out = "strongnamed/Selenium.WebDriverBackedSelenium",
keyfile = "//dotnet:WebDriver.snk",
resources = [
"//java/client/src/com/thoughtworks/selenium/webdriven:htmlutils.js",
Expand Down Expand Up @@ -131,7 +131,7 @@ csharp_library(
"@net//:System.Net.Http",
"@net//:System.Runtime.Serialization",
"@net//:System.Xml",
"//dotnet/src/webdriver:{}assembly-strongnamed".format(framework),
"//dotnet/src/webdriver:{}-strongnamed".format(framework),
],
) for framework in SUPPORTED_NET_FRAMEWORKS]

Expand All @@ -141,7 +141,7 @@ csharp_library(
"*.cs",
"Internal/**/*.cs",
]) + [":assembly-info"],
out = "strongnamed/netstandard2.0/Selenium.WebDriverBackedSelenium",
out = "strongnamed/Selenium.WebDriverBackedSelenium",
keyfile = "//dotnet:WebDriver.snk",
resources = [
"//java/client/src/com/thoughtworks/selenium/webdriven:htmlutils.js",
Expand All @@ -163,7 +163,7 @@ csharp_library(
],
visibility = ["//visibility:public"],
deps = [
"//dotnet/src/webdriver:netstandard2.0assembly-strongnamed",
"//dotnet/src/webdriver:netstandard2.0-strongnamed",
],
)

Expand All @@ -181,16 +181,44 @@ nuget_package(
],
)

copy_file(
name = "copy-net45-strongnamed",
src = ":net45-strongnamed",
out = "strongnamed/net45/Selenium.WebDriverBackedSelenium.dll",
visibility = ["//visibility:public"],
)

copy_file(
name = "copy-net46-strongnamed",
src = ":net46-strongnamed",
out = "strongnamed/net46/Selenium.WebDriverBackedSelenium.dll",
visibility = ["//visibility:public"],
)

copy_file(
name = "copy-net47-strongnamed",
src = ":net47-strongnamed",
out = "strongnamed/net47/Selenium.WebDriverBackedSelenium.dll",
visibility = ["//visibility:public"],
)

copy_file(
name = "copy-netstandard2.0-strongnamed",
src = ":netstandard2.0-strongnamed",
out = "strongnamed/netstandard2.0/Selenium.WebDriverBackedSelenium.dll",
visibility = ["//visibility:public"],
)

nuget_package(
name = "package-strongnamed",
src = "Selenium.WebDriverBackedSelenium.nuspec",
package_id = "Selenium.WebDriverBackedSelenium.StrongNamed",
package_version = "{}".format(SE_VERSION),
visibility = ["//visibility:public"],
deps = [
":net45-strongnamed",
":net46-strongnamed",
":net47-strongnamed",
":netstandard2.0-strongnamed",
":copy-net45-strongnamed",
":copy-net46-strongnamed",
":copy-net47-strongnamed",
":copy-netstandard2.0-strongnamed",
],
)

0 comments on commit ab31212

Please sign in to comment.