From 0ef9196d55784d5a6e3630ac9516bea2638fc075 Mon Sep 17 00:00:00 2001 From: Jacob Parker Date: Wed, 28 Feb 2018 21:49:48 -0500 Subject: [PATCH] Updates for README (#55) --- README.md | 51 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 5f4af7d404a20b..e7eb0081edf11f 100644 --- a/README.md +++ b/README.md @@ -13,16 +13,24 @@ * [new_nuget_package](#new_nuget_package) * [dll_import](#dll_import) -__WARNING:__ Theses rules are not compatible with -[sandboxing](https://bazel.io/blog/2015/09/11/sandboxing.html). +## Overview +This is a minimal viable set of C# bindings for building C# code with +[Mono](http://www.mono-project.com/). It's still pretty rough but it +works as a proof of concept that could grow into something more. -## Overview +## Caveats + +These rules are not compatible with +[sandboxing](https://bazel.io/blog/2015/09/11/sandboxing.html). + +These rules do not currently support Windows and the.NET Framework. +Issue [#54](https://github.com/bazelbuild/rules_dotnet/issues/54) +tracks the necessary work. Bazel support for Windows is currently in +[beta](https://blog.bazel.build/2017/10/16/windows-retrospect.html). -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. +These rules do not currently support .NET Core/Standard built with +the official compiler on any platform. ## Setup @@ -52,9 +60,9 @@ load( csharp_repositories(use_local_mono = True) nuget_package( - name = "some_name", - package = "Some.Package", - version = "0.1.2", + name = "Netwonsoft.Json", + package = "Newtonsoft.Json", + version = "10.0.3", ) ``` @@ -103,18 +111,30 @@ csharp_nunit_test( ### nuget\_package -In the WORKSPACE file for your project record a nuget dependency like so. +In the `WORKSPACE` file for your project record a nuget dependency like so. This is a repository rule so it will not work unless it is in a workspace file. ```python nuget_package( - name="ndesk_options", # referenced via path @ndesk_options//:dylibs - package="NDesk.Options", - version="0.2.1", + name = "ndesk_options", + package = "NDesk.Options", + version = "0.2.1", +) +``` + +Now, in a `BUILD` file, you can add the package to your `deps`: + +``` +csharp_binary( + name = "MyApp", + srcs = ["MyApp.cs"], + deps = ["@ndesk_options//:dylibs"], ) ``` + + ### new\_nuget\_package This repository rule accepts either a `BUILD` file label or @@ -165,7 +185,7 @@ dll_import( ## Things still missing: -- Handle .resx files correctly. +- Handle .resx files correctly. See issue [#51](https://github.com/bazelbuild/rules_dotnet/issues/51). - .Net Modules - Conditionally building documentation. - Pulling Mono in through a mono.WORKSPACE file. @@ -176,7 +196,6 @@ dll_import( - nuget_packages repository rule that will handle multiple different nuget packages in one rule. - Building csproj and sln files for VS and MonoDevelop. -- Windows .NET framwork support ## csharp_library