diff --git a/.bazelrc b/.bazelrc index 82be45bc..558b781e 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,3 +1,4 @@ +build --enable_platform_specific_config # Options common for all EngFlow remote configurations. build:engflow_common --jobs=8 build:engflow_common --define=EXECUTOR=remote @@ -17,6 +18,11 @@ build:engflow_common --platforms=//remote_config/config:platform build:engflow_common --java_runtime_version=remotejdk_11 build:engflow_common --java_language_version=11 +build:macos --host_platform @io_bazel_rules_dotnet//dotnet/toolchain:darwin_amd64_3.1.100 +build:macos --platforms @io_bazel_rules_dotnet//dotnet/toolchain:darwin_amd64_3.1.100 +build:linux --host_platform @io_bazel_rules_dotnet//dotnet/toolchain:linux_amd64_3.1.100 +build:linux --platforms @io_bazel_rules_dotnet//dotnet/toolchain:linux_amd64_3.1.100 + build:without_bytes --experimental_remote_download_outputs=minimal # Options for a private EngFlow cluster. diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00c64e53..119ff14e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,3 +51,6 @@ jobs: run: | bazel build //typescript/... bazel test //typescript/... + + - name: Building //csharp directory + run: bazel build //csharp/... diff --git a/WORKSPACE b/WORKSPACE index 03305a90..016fb9b0 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -203,3 +203,20 @@ nodejs_register_toolchains( load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") bazel_skylib_workspace() + +http_archive( + name = "io_bazel_rules_dotnet", + sha256 = "400416de5d5d321fa7ca9e46110373cd39db7ed84ef3a61e1150c5813cb1c99e", + strip_prefix = "rules_dotnet-0.0.7", + urls = ["https://github.com/bazelbuild/rules_dotnet/archive/refs/tags/0.0.7.zip"], +) + +load("@io_bazel_rules_dotnet//dotnet:deps.bzl", "dotnet_repositories") + +dotnet_repositories() + +load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "dotnet_register_toolchains", "dotnet_repositories_nugets") + +dotnet_register_toolchains() + +dotnet_repositories_nugets() diff --git a/csharp/BUILD b/csharp/BUILD new file mode 100644 index 00000000..1a43aedd --- /dev/null +++ b/csharp/BUILD @@ -0,0 +1,11 @@ +load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "csharp_binary") + +csharp_binary( + name = "csharp.exe", + srcs = [ + "Main.cs", + ], + deps = [ + "@core_sdk_stdlib//:libraryset", + ], +) diff --git a/csharp/Main.cs b/csharp/Main.cs new file mode 100644 index 00000000..e581983e --- /dev/null +++ b/csharp/Main.cs @@ -0,0 +1,11 @@ +using System; + +namespace HelloWorld +{ + class Hello { + static void Main(string[] args) + { + System.Console.WriteLine("Hello World!"); + } + } +}