Merge pull request #38990 from mikedanese/go-genrule-sets

Automatic merge from submit-queue (batch tested with PRs 38990, 45781, 46225, 44899, 43663)

migrate set generation to go_genrule

Depends on https://github.com/kubernetes/release/pull/238
pull/6/head
Kubernetes Submit Queue 2017-05-22 19:06:58 -07:00 committed by GitHub
commit 503a8421fb
6 changed files with 73 additions and 8 deletions

View File

@ -257,6 +257,7 @@ pkg/util/netsh
pkg/util/rand
pkg/util/runtime
pkg/util/sets
pkg/util/sets/types
pkg/util/tail
pkg/util/validation
pkg/util/validation/field

View File

@ -9,7 +9,7 @@ load(
go_library(
name = "go_default_library",
srcs = ["types.go"],
srcs = ["doc.go"],
tags = ["automanaged"],
)

View File

@ -0,0 +1,21 @@
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package sets only exists until heapster rebases
// TODO genericapiserver remove this empty package. Godep fails without this because heapster relies
// on this package. This will allow us to start splitting packages, but will force
// heapster to update on their next kube rebase.
package sets

View File

@ -2,19 +2,13 @@ package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load("@io_kubernetes_build//defs:go.bzl", "go_genrule")
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
"go_test",
)
go_test(
name = "go_default_test",
srcs = ["set_test.go"],
library = ":go_default_library",
tags = ["automanaged"],
)
go_library(
name = "go_default_library",
srcs = [
@ -27,3 +21,38 @@ go_library(
],
tags = ["automanaged"],
)
go_genrule(
name = "set-gen",
srcs = [
"//hack/boilerplate:boilerplate.go.txt",
],
outs = [
"byte.go",
"doc.go",
"empty.go",
"int.go",
"int64.go",
"string.go",
],
cmd = """
$(location //cmd/libs/go2idl/set-gen) \
--input-dirs ./vendor/k8s.io/apimachinery/pkg/util/sets/types \
--output-base $(GENDIR)/vendor/k8s.io/apimachinery/pkg/util \
--go-header-file $(location //hack/boilerplate:boilerplate.go.txt) \
--output-package sets
""",
go_deps = [
"//vendor/k8s.io/apimachinery/pkg/util/sets/types:go_default_library",
],
tools = [
"//cmd/libs/go2idl/set-gen",
],
)
go_test(
name = "go_default_test",
srcs = ["set_test.go"],
library = ":go_default_library",
tags = ["automanaged"],
)

View File

@ -0,0 +1,14 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["types.go"],
tags = ["automanaged"],
)