Skip to content

Commit

Permalink
Remove deprecated closure_repositories() macro
Browse files Browse the repository at this point in the history
This was deprecated in favor of `rules_closure_dependencies()` and
`rules_closure_toolchains()` to be more consistent with other rules.
See https://docs.bazel.build/versions/master/skylark/deploying.html#dependencies

Updates #421
  • Loading branch information
Yannic committed Mar 3, 2020
1 parent 0e18736 commit 1188f10
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 38 deletions.
31 changes: 14 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ notes.
First you must [install Bazel]. Then you add the following to your `WORKSPACE`
file:

```python
```starlark
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
Expand All @@ -90,9 +90,6 @@ rules_closure_toolchains()
You are not required to install the Closure Tools, PhantomJS, or anything else
for that matter; they will be fetched automatically by Bazel.

> :bangbang: Release 0.10.x will be the last to support loading dependencies though
> `closure_repositories()`.
### Overriding Dependency Versions

When you call `rules_closure_dependencies()` in your `WORKSPACE` file, it causes a
Expand All @@ -104,7 +101,7 @@ To override the version of any dependency, modify your `WORKSPACE` file to pass
custom dependency version. A full list of dependencies is available from
[repositories.bzl]. For example, to override the version of Guava:

```python
```starlark
load("@io_bazel_rules_closure//closure:repositories.bzl", "rules_closure_dependencies", "rules_closure_toolchains")
rules_closure_dependencies(
omit_com_google_guava=True,
Expand Down Expand Up @@ -144,7 +141,7 @@ Please see the test directories within this project for concrete examples of usa

## closure\_js\_library

```python
```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
closure_js_library(name, srcs, data, deps, exports, suppress, convention,
no_closure_library)
Expand Down Expand Up @@ -245,7 +242,7 @@ This rule can be referenced as though it were the following:

## closure\_js\_binary

```python
```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_binary")
closure_js_binary(name, deps, css, debug, language, entry_points,
dependency_mode, compilation_level, formatting,
Expand Down Expand Up @@ -367,7 +364,7 @@ When compiling AngularJS applications, you need to pass custom flags to the
Closure Compiler. This can be accomplished by adding the following to your
[closure_js_binary] rule:

```python
```starlark
closure_js_binary(
# ...
defs = [
Expand All @@ -379,7 +376,7 @@ closure_js_binary(

## closure\_js\_test

```python
```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_test")
closure_js_test(name, srcs, data, deps, css, html, language, suppress,
compilation_level, entry_points, defs)
Expand Down Expand Up @@ -452,7 +449,7 @@ This rule can be referenced as though it were the following:

## phantomjs\_test

```python
```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "phantomjs_test")
phantomjs_test(name, data, deps, html, harness, runner)
```
Expand Down Expand Up @@ -500,7 +497,7 @@ This rule can be referenced as though it were the following:

## closure\_js\_deps

```python
```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_deps")
closure_js_deps(name, deps)
```
Expand Down Expand Up @@ -547,7 +544,7 @@ This rule can be referenced as though it were the following:

## closure\_js\_template\_library

```python
```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_template_library")
closure_js_template_library(name, srcs, data, deps, globals, plugin_modules,
should_generate_js_doc,
Expand Down Expand Up @@ -634,7 +631,7 @@ This rule can be referenced as though it were the following:

## closure\_java\_template\_library

```python
```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_java_template_library")
closure_java_template_library(name, srcs, data, deps, java_package)
```
Expand Down Expand Up @@ -699,7 +696,7 @@ TODO

## closure\_css\_library

```python
```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_css_library")
closure_css_library(name, srcs, data, deps)
```
Expand Down Expand Up @@ -763,7 +760,7 @@ This rule can be referenced as though it were the following:

## closure\_css\_binary

```python
```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_css_binary")
closure_css_binary(name, deps, renaming, debug, defs)
```
Expand Down Expand Up @@ -872,7 +869,7 @@ This rule can be referenced as though it were the following:

## closure\_js\_proto\_library

```python
```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_proto_library")
closure_js_proto_library(name, srcs, add_require_for_enums, binary,
import_style)
Expand Down Expand Up @@ -929,7 +926,7 @@ This rule can be referenced as though it were the following:

## closure\_proto\_library

```python
```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_proto_library")
closure_proto_library(name, deps)
```
Expand Down
2 changes: 0 additions & 2 deletions closure/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ load("//closure/templates:closure_templates_plugin.bzl", _closure_templates_plug
load("//closure/testing:closure_js_test.bzl", _closure_js_test = "closure_js_test")
load("//closure/testing:phantomjs_test.bzl", _phantomjs_test = "phantomjs_test")
load("//closure:filegroup_external.bzl", _filegroup_external = "filegroup_external")
load("//closure:repositories.bzl", _closure_repositories = "closure_repositories")
load("//closure:webfiles/web_library.bzl", _web_library = "web_library")
load("//closure:webfiles/web_library_external.bzl", _web_library_external = "web_library_external")

Expand All @@ -49,6 +48,5 @@ closure_templates_plugin = _closure_templates_plugin
closure_js_test = _closure_js_test
phantomjs_test = _phantomjs_test
filegroup_external = _filegroup_external
closure_repositories = _closure_repositories # TODO(yannic): Remove on 2019-11-01.
web_library = _web_library
web_library_external = _web_library_external
19 changes: 0 additions & 19 deletions closure/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,6 @@ load("@bazel_tools//tools/build_defs/repo:java.bzl", "java_import_external")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
load("//closure/private:platform_http_file.bzl", "platform_http_file")

_ERROR_CLOSURE_REPOSITORIES_IS_DEPRECATED = """
closure_repositories() is deprecated.
Please add the following to your workspace instead:
load("@io_bazel_rules_closure//closure:repositories.bzl", "rules_closure_dependencies", "rules_closure_toolchains")
rules_closure_dependencies()
rules_closure_toolchains()
""".strip()

def closure_repositories(**kargs):
"""Legacy macro to import dependencies for Closure Rules."""

print(_ERROR_CLOSURE_REPOSITORIES_IS_DEPRECATED)
rules_closure_dependencies(**kargs)

def rules_closure_toolchains():
"""An utility method to load all Closure toolchains.
Expand Down Expand Up @@ -70,7 +54,6 @@ def rules_closure_dependencies(
omit_com_google_javascript_closure_library = False,
omit_com_google_jsinterop_annotations = False,
omit_com_google_protobuf = False,
omit_com_google_protobuf_java = False,
omit_com_google_protobuf_js = False,
omit_com_google_template_soy = False,
omit_com_google_template_soy_jssrc = False,
Expand Down Expand Up @@ -98,8 +81,6 @@ def rules_closure_dependencies(
omit_rules_python = False,
omit_zlib = False):
"""Imports dependencies for Closure Rules."""
if omit_com_google_protobuf_java:
fail("omit_com_google_protobuf_java no longer supported and must be not be passed to closure_repositories()")
if not omit_aopalliance:
aopalliance()
if not omit_args4j:
Expand Down

0 comments on commit 1188f10

Please sign in to comment.