Skip to content

Commit

Permalink
Various syncing and reconciling (bazel-contrib#4)
Browse files Browse the repository at this point in the history
* Sync with rules_go at ac35fb1
* Move //gazelle to //cmd/gazelle
* Minor adjustments to sync script and patch.
  • Loading branch information
jayconrod authored Dec 7, 2017
1 parent 8b500a0 commit 33dcea7
Show file tree
Hide file tree
Showing 27 changed files with 694 additions and 780 deletions.
4 changes: 1 addition & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
load("//:def.bzl", "gazelle")

gazelle(
# TODO(jayconrod): rename to "gazelle" after the //gazelle package is
# moved to //cmd/gazelle.
name = "gazelle_",
name = "gazelle",
prefix = "github.com/bazelbuild/bazel-gazelle",
)

Expand Down
11 changes: 6 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,12 @@ Gazelle supports several directives, written as comments in build files.

* ``# gazelle:ignore``: may be written at the top level of any build file.
Gazelle will not update files with this comment.
* ``# gazelle:exclude file-or-directory``: may be written at the top level of
any build file. Gazelle will ignore the named file in the build file's
directory. If it is a source file, Gazelle won't include it in any rules. If
it is a directory, Gazelle will not recurse into it. This directive may be
repeated to exclude multiple files, one per line.
* ``# gazelle:exclude path``: may be written at the top level of
any build file. If the path refers to a source file, Gazelle won't include
it in any rules. If the path refers to a directory, Gazelle won't recurse
into it. The path may refer to something in a subdirectory, for example,
a testdata directory somewhere in a vendor tree. This directive may be
repeated to exclude multiple paths, one per line.
* ``# gazelle:proto <mode>``: Tells Gazelle how to generate rules for .proto
files. Applies to the current directory and subdirectories. Valid values for
``mode`` are:
Expand Down
48 changes: 43 additions & 5 deletions cmd/gazelle/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,8 +1,46 @@
# TODO(jayconrod): move //gazelle to //cmd/gazelle after the Gazelle in rules_go
# is completely turned down. For now, the paths need to match for the import
# script to work.
alias(
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_binary", "go_test")

go_library(
name = "go_default_library",
srcs = [
"diff.go",
"fix.go",
"flags.go",
"main.go",
"print.go",
],
importpath = "github.com/bazelbuild/bazel-gazelle/cmd/gazelle",
visibility = ["//visibility:private"],
deps = [
"//config:go_default_library",
"//merger:go_default_library",
"//packages:go_default_library",
"//resolve:go_default_library",
"//rules:go_default_library",
"//wspace:go_default_library",
"@com_github_bazelbuild_buildtools//build:go_default_library",
],
)

go_binary(
name = "gazelle",
actual = "//gazelle:gazelle",
embed = [":go_default_library"],
importpath = "github.com/bazelbuild/bazel-gazelle/cmd/gazelle",
visibility = ["//visibility:public"],
)

go_test(
name = "go_default_test",
size = "small",
srcs = [
"fix_test.go",
"integration_test.go",
],
embed = [":go_default_library"],
importpath = "github.com/bazelbuild/bazel-gazelle/cmd/gazelle",
deps = [
"//config:go_default_library",
"//wspace:go_default_library",
"@com_github_bazelbuild_buildtools//build:go_default_library",
],
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 33dcea7

Please sign in to comment.