Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated rules #3538

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ tasks:
- "-//tests/core/coverage:issue3017_test"
- "-//tests/core/cross:proto_test"
- "-//tests/core/go_binary:go_default_test"
- "-//tests/extras/go_embed_data:go_default_test"
- "-//tests/core/go_path:go_path"
- "-//tests/core/go_path:go_path_test"
- "-//tests/core/go_path/pkg/lib:embed_test"
Expand Down
3 changes: 0 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Go rules for Bazel_
.. _go_binary: docs/go/core/rules.md#go_binary
.. _go_context: go/toolchains.rst#go_context
.. _go_download_sdk: go/toolchains.rst#go_download_sdk
.. _go_embed_data: docs/go/extras/extras.md#go_embed_data
.. _go_host_sdk: go/toolchains.rst#go_host_sdk
.. _go_library: docs/go/core/rules.md#go_library
.. _go_local_sdk: go/toolchains.rst#go_local_sdk
Expand Down Expand Up @@ -174,8 +173,6 @@ Documentation

* `Extra rules <docs/go/extras/extras.md>`_

* `go_embed_data`_

* `nogo build-time static analysis`_
* `Build modes <go/modes.rst>`_

Expand Down
4 changes: 0 additions & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()

load("@io_bazel_rules_go//extras:embed_data_deps.bzl", "go_embed_data_dependencies")

go_embed_data_dependencies()

# Used by //tests:buildifier_test.
http_archive(
name = "com_github_bazelbuild_buildtools",
Expand Down
1 change: 0 additions & 1 deletion docs/go/extras/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ bzl_library(
srcs = ["extras.bzl"],
visibility = ["//visibility:public"],
deps = [
"//extras:embed_data",
"//extras:gomock",
],
)
4 changes: 0 additions & 4 deletions docs/go/extras/extras.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ to make life a little easier.
## Contents
- [gazelle](#gazelle)
- [gomock](#gomock)
- [go_embed_data](#go_embed_data)

## Additional resources
- [gazelle rule]
Expand All @@ -28,8 +27,5 @@ This rule has moved. See [gazelle rule] in the Gazelle repository.
"""

load("//extras:gomock.bzl", _gomock = "gomock")
load("//extras:embed_data.bzl", _go_embed_data = "go_embed_data")

gomock = _gomock

go_embed_data = _go_embed_data
45 changes: 0 additions & 45 deletions docs/go/extras/extras.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ to make life a little easier.
## Contents
- [gazelle](#gazelle)
- [gomock](#gomock)
- [go_embed_data](#go_embed_data)

## Additional resources
- [gazelle rule]
Expand All @@ -29,50 +28,6 @@ This rule has moved. See [gazelle rule] in the Gazelle repository.






<a id="#go_embed_data"></a>

## go_embed_data

<pre>
go_embed_data(<a href="#go_embed_data-name">name</a>, <a href="#go_embed_data-flatten">flatten</a>, <a href="#go_embed_data-package">package</a>, <a href="#go_embed_data-src">src</a>, <a href="#go_embed_data-srcs">srcs</a>, <a href="#go_embed_data-string">string</a>, <a href="#go_embed_data-unpack">unpack</a>, <a href="#go_embed_data-var">var</a>)
</pre>

**Deprecated**: Will be removed in rules_go 0.39.

`go_embed_data` generates a .go file that contains data from a file or a
list of files. It should be consumed in the srcs list of one of the
[core go rules].

Before using `go_embed_data`, you must add the following snippet to your
WORKSPACE:

``` bzl
load("@io_bazel_rules_go//extras:embed_data_deps.bzl", "go_embed_data_dependencies")

go_embed_data_dependencies()
```

`go_embed_data` accepts the attributes listed below.


### **Attributes**


| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="go_embed_data-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="go_embed_data-flatten"></a>flatten | If <code>True</code> and <code>srcs</code> is used, map keys are file base names instead of relative paths. | Boolean | optional | False |
| <a id="go_embed_data-package"></a>package | Go package name for the generated .go file. | String | optional | "" |
| <a id="go_embed_data-src"></a>src | A single file to embed. This cannot be used at the same time as <code>srcs</code>. The generated file will have a variable of type <code>[]byte</code> or <code>string</code> with the contents of this file. | <a href="https://bazel.build/concepts/labels">Label</a> | optional | None |
| <a id="go_embed_data-srcs"></a>srcs | A list of files to embed. This cannot be used at the same time as <code>src</code>. The generated file will have a variable of type <code>map[string][]byte</code> or <code>map[string]string</code> with the contents of each file. The map keys are relative paths of the files from the repository root. Keys for files in external repositories will be prefixed with <code>"external/repo/"</code> where "repo" is the name of the external repository. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
| <a id="go_embed_data-string"></a>string | If <code>True</code>, the embedded data will be stored as <code>string</code> instead of <code>[]byte</code>. | Boolean | optional | False |
| <a id="go_embed_data-unpack"></a>unpack | If <code>True</code>, sources are treated as archives and their contents will be stored. Supported formats are <code>.zip</code> and <code>.tar</code> | Boolean | optional | False |
| <a id="go_embed_data-var"></a>var | Name of the variable that will contain the embedded data. | String | optional | "Data" |


<a id="gomock"></a>

## gomock
Expand Down
25 changes: 0 additions & 25 deletions extras/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,6 @@ filegroup(
visibility = ["//visibility:public"],
)

bzl_library(
name = "bindata",
srcs = ["bindata.bzl"],
visibility = ["//visibility:public"],
deps = ["@io_bazel_rules_go//go:def"],
)

bzl_library(
name = "embed_data",
srcs = ["embed_data.bzl"],
visibility = ["//visibility:public"],
deps = [
"//go/private:context",
"//go/private:go_toolchain",
],
)

bzl_library(
name = "embed_data_deps",
srcs = ["embed_data_deps.bzl"],
visibility = ["//visibility:public"],
# Don't list dependency on @bazel_tools//tools/build_defs/repo.bzl
deps = [], # keep
)

bzl_library(
name = "gomock",
srcs = ["gomock.bzl"],
Expand Down
87 changes: 0 additions & 87 deletions extras/bindata.bzl

This file was deleted.

146 changes: 0 additions & 146 deletions extras/embed_data.bzl

This file was deleted.

Loading