![]() ![]() For details, see the Google Developers Site Policies. ![]() The content for the WORKSPACE file for this repository.Įxcept as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. (Something like WORKSPACE.new-repo-name may work well forĭistinguishing it from the repository's actual WORKSPACE files.) This attribute is a label relative to the main workspace. The file to use as the WORKSPACE file for this repository.Įither workspace_file or workspace_file_content can be specified, but not both. Repository depends on (such as a dependency it should actually resolve that dependency within Workspace dependency resolution for dependencies of this repository.įor example, an entry declares that, for any time this The path can be either absolute or relative to the main repository'sĭictionary: String -> String default is Ī dictionary from local repository name to global repository name. This must be a path to the directory containing the repository's The path to the local repository's directory. Targets would specify as a dependency to depend on this The user can add a dependency on this target by adding the following lines to SSL library has a target //src:openssl-lib. Would like to use an SSL library which is defined in a different repository: ~/ssl. Suppose the current repository is a chat client, rooted at the directory ~/chat-app. Use targets defined in this other directory. This means that the current repository can View rule source open_in_new local_repository( name, path, repo_mapping)Īllows targets from a local directory to be bound. Note that this is different from omitting theīind rule completely: it is an error if an //external dependency Will simply not see this dependency edge. If this attribute is omitted, rules referring to this target in //external This target must exist, but can be any type of rule (including bind). ![]() Then sign_in.cc's includes might look like this: For example, if the rule definition for looks like external:openssl can be referred to using their path relative to their repository Within sign_in.cc and sign_in.h, the header files exposed by WORKSPACE file and it has a cc_library target //src:openssl-lib, you canĬreate an alias for this target using bind:Īctual = in a BUILD file in your workspace, the bound target can be used as follows: ![]() Updated and all of the BUILD files depending on //external:javacc-latest will nowĭepend on javacc-v3 without needing to be edited.īind can also be used to make targets in external repositories available to your workspace.įor example, if there is a remote repository named imported in the If javacc-v3 is released, the bind rule can be Now targets can depend on //external:javacc-latest instead of This can be aliased by adding the following to the Suppose there is a java_library target called To give a target an alias, bind it in the WORKSPACE file. So it can be thought of as a "virtual package" that contains all bound targets. The //external package is not a "normal" package: there is no external/ directory, Gives a target an alias in the //external package. Warning: select() cannot be used in bind(). See " Consider removing bind" for a longĭiscussion of its issues and alternatives. Warning: use of bind() is not recommended. View rule source open_in_new bind( name, actual, compatible_with, deprecation, distribs, features, licenses, restricted_to, tags, target_compatible_with, testonly, visibility) With git repositories or archives hosted on the web. Starlark workspace rules, in particular those to deal Note: besides the native workspace rules, Bazel also embeds various Source code located outside the main repository. Workspace rules are used to pull in external dependencies, typically ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |