This is a minimal viable set of C# bindings for building csharp code with mono. It's still pretty rough but it works as a proof of concept that could grow into something more. If windows support ever happens for Bazel then this might become especially valuable.
Copy the contents of the dotnet.WORKSPACE file into your WORKSPACE file.
csharp_library
csharp_library( name="MyLib", srcs=["MyLib.cs"], deps=["//my/dependency:SomeLib"], )
csharp_binary
csharp_binary( name="MyApp", main="MyApp", # optional name of the main class. srcs=["MyApp.cs"], deps=["//my/dependency:MyLib"], )
csharp_nunit_test
csharp_nunit_test( name="MyApp", srcs=["MyApp.cs"], deps=["//my/dependency:MyLib"], )
csharp_library(name, srcs, deps, warn=4, csc)
Builds a C# .NET library and its corresponding documentation.
csharp_binary(name, srcs, deps, main_class, warn=4, csc)
Builds a C# .NET binary.
csharp_nunit_test(name, srcs, deps, warn=4, csc)
Builds a C# .NET test binary that uses the NUnit unit testing framework.