![]() ![]() To override a declared repository with a local repository from the command line,įlag. Overriding repositories from the command line Had the same dependency but call it by different names, those dependencies canīe joined in myproject/WORKSPACE. This mechanism can also be used to join diamonds. Workspace ( name = "myproject" ) load (, "http_archive" ) http_archive ( name = "testrunner-v1", urls =, sha256 = "." ) http_archive ( name = "testrunner-v2", urls =, sha256 = "." ) local_repository ( name = "A", path = "./A", repo_mapping = ) But for cases where this isn’t true, it is possible to This is required for dependencies that you compile against and end up Whenever possible, it is recommended to have a single version policy in your To unconditionally fetch all external dependencies, useĪs fetched repositories are stored in the output base, fetching You would like to prefetch the dependencies needed for a specific set of targets, use To download artifacts from Maven repositories and make them available as Javaīy default, external dependencies are fetched as needed during bazel build. You can then depend on from your project’s You would add the following to my_project/WORKSPACE:Ĭc_library ( name = "some-lib", srcs = glob (), visibility =, ) Projects use Bazel, so you can add your coworker’s project as an externalĭependency and then use any targets your coworker has defined from your ownīUILD files. To depend on targets from your coworker’s project, coworkers-project/. To symlink it from the local filesystem, reference a git repository or downloadįor example, suppose you are working on a project, my-project/, and you want ![]() If you want to use targets from a second Bazel project, you can Users can also write custom repositoryĪ few basic types of external dependencies can be used: Rules and a set of embedded Starlark repository Bazel comes with a few built-in repository ![]() It uses the same syntax as BUILDįiles, but allows a different set of rules called repository rules (sometimesĪlso known as workspace rules). home/user/project1/BUILD could depend on WORKSPACE file allows users to depend on targets from other parts of theįilesystem or downloaded from the internet. Project2 could be found at /home/user/project2. home/user/project2/BUILD, it could specify that a repository named If project1 wanted to depend on a target, :foo, defined in ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |