Skip to content

Commit

Permalink
Updates for README (bazelbuild#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
j3parker authored and zaphar committed Mar 1, 2018
1 parent b12d9a7 commit 0ef9196
Showing 1 changed file with 35 additions and 16 deletions.
51 changes: 35 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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",
)
```

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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

<a name="csharp_library"></a>
## csharp_library
Expand Down

0 comments on commit 0ef9196

Please sign in to comment.