Skip to content

Commit

Permalink
Hive .Net config into its own setup
Browse files Browse the repository at this point in the history
This way, the top level WORKSPACE remains easy to navigate
yet it's still easy to modify our .Net config. The same
pattern should be followed for the other languages as it
makes sense.
  • Loading branch information
shs96c committed Jul 3, 2019
1 parent e5a00de commit 80eb45e
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 71 deletions.
73 changes: 2 additions & 71 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,77 +30,8 @@ http_archive(
]
)

load("@io_bazel_rules_dotnet//dotnet:defs.bzl",
"dotnet_register_toolchains",
"net_register_sdk",
"core_register_sdk",
"mono_register_sdk",
"dotnet_repositories",
"dotnet_nuget_new",
"nuget_package",
"DOTNET_NET_FRAMEWORKS",
"DOTNET_CORE_FRAMEWORKS")

dotnet_register_toolchains()
dotnet_repositories()

mono_register_sdk()

[net_register_sdk(
framework
) for framework in DOTNET_NET_FRAMEWORKS]

[core_register_sdk(
framework
) for framework in DOTNET_CORE_FRAMEWORKS]

# Default core_sdk
core_register_sdk("v2.1.502", name = "core_sdk")

# Default net_sdk
net_register_sdk("net472", name = "net_sdk")

dotnet_nuget_new(
name = "json.net",
package = "newtonsoft.json",
version = "12.0.2",
build_file = "//third_party/dotnet/nuget/packages:newtonsoft.json.bzl"
)

dotnet_nuget_new(
name = "moq",
package = "moq",
version = "4.12.0",
build_file = "//third_party/dotnet/nuget/packages:moq.bzl"
)

dotnet_nuget_new(
name = "benderproxy",
package = "benderproxy",
version = "1.0.0",
build_file = "//third_party/dotnet/nuget/packages:benderproxy.bzl"
)

dotnet_nuget_new(
name = "castle.core",
package = "castle.core",
version = "4.4.0",
build_file = "//third_party/dotnet/nuget/packages:castle.core.bzl"
)

dotnet_nuget_new(
name = "system.threading.tasks.extensions",
package = "system.threading.tasks.extensions",
version = "4.5.1",
build_file = "//third_party/dotnet/nuget/packages:system.threading.tasks.extensions.bzl"
)

dotnet_nuget_new(
name = "nunit",
package = "nunit",
version = "3.12.0",
build_file = "//third_party/dotnet/nuget/packages:nunit.bzl"
)
load("//dotnet:workspace.bzl", "selenium_register_dotnet")
selenium_register_dotnet()

http_archive(
name = "build_bazel_rules_nodejs",
Expand Down
72 changes: 72 additions & 0 deletions dotnet/workspace.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
load("@io_bazel_rules_dotnet//dotnet:defs.bzl",
"dotnet_register_toolchains",
"net_register_sdk",
"core_register_sdk",
"mono_register_sdk",
"dotnet_repositories",
"dotnet_nuget_new",
"nuget_package",
"DOTNET_NET_FRAMEWORKS",
"DOTNET_CORE_FRAMEWORKS")

def selenium_register_dotnet():
dotnet_register_toolchains()
dotnet_repositories()

mono_register_sdk()

[net_register_sdk(
framework
) for framework in DOTNET_NET_FRAMEWORKS]

[core_register_sdk(
framework
) for framework in DOTNET_CORE_FRAMEWORKS]

# Default core_sdk
core_register_sdk("v2.1.502", name = "core_sdk")

# Default net_sdk
net_register_sdk("net472", name = "net_sdk")

dotnet_nuget_new(
name = "json.net",
package = "newtonsoft.json",
version = "12.0.2",
build_file = "//third_party/dotnet/nuget/packages:newtonsoft.json.bzl",
)

dotnet_nuget_new(
name = "moq",
package = "moq",
version = "4.12.0",
build_file = "//third_party/dotnet/nuget/packages:moq.bzl",
)

dotnet_nuget_new(
name = "benderproxy",
package = "benderproxy",
version = "1.0.0",
build_file = "//third_party/dotnet/nuget/packages:benderproxy.bzl",
)

dotnet_nuget_new(
name = "castle.core",
package = "castle.core",
version = "4.4.0",
build_file = "//third_party/dotnet/nuget/packages:castle.core.bzl",
)

dotnet_nuget_new(
name = "system.threading.tasks.extensions",
package = "system.threading.tasks.extensions",
version = "4.5.1",
build_file = "//third_party/dotnet/nuget/packages:system.threading.tasks.extensions.bzl",
)

dotnet_nuget_new(
name = "nunit",
package = "nunit",
version = "3.12.0",
build_file = "//third_party/dotnet/nuget/packages:nunit.bzl",
)

0 comments on commit 80eb45e

Please sign in to comment.