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. |