Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.24 KB

README.rst

File metadata and controls

34 lines (23 loc) · 1.24 KB

nuget2bazel

Introduction

Nuget packages often depend on other Nuget packages. By design, Bazel is not able to determine Nuget dependencies at run time. That's why a special tool is needed to extract those dependencies and list them directly.

Moreover, Nuget packages are often built using different versions of the framework. Please take into consideration runtime limitations.

The tool

The tool is used to generate rules_bazel compatible workspace rules for nuget packages: nuget_package. The tool maintains the list of installed packages in package.json and appropriate rules in WORKSPACE file. Sample usage:

bazel run //tools/nuget2bazel -- add -p c:/rules_dotnet ninject 3.3.0

bazel run //tools/nuget2bazel -- delete -p c:/rules_dotnet ninject

By default the tool modifies WORKSPACE file in the provided directory with proper directives.

However, typically it is more convenient to modify .bzl file to declare dependencies in a separate function called in WORKSPACE. See for example nuget.bzl.