Use new codegen config options in kazel and fix boilerplate check for generated bzl

pull/564/head
Jeff Grafton 2018-11-06 15:42:19 -08:00
parent 5d743157b6
commit 4503d573d3
3 changed files with 24 additions and 4 deletions

View File

@ -6,5 +6,9 @@
"^third_party/etcd.*"
],
"AddSourcesRules": true,
"K8sOpenAPIGen": true
"K8sCodegenBzlFile": "build/kazel_generated.bzl",
"K8sCodegenBoilerplateFile": "hack/boilerplate/boilerplate.generatebzl.txt",
"K8sCodegenTags": [
"openapi-gen"
]
}

View File

@ -0,0 +1,14 @@
# Copyright 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.

View File

@ -83,10 +83,12 @@ def file_passes(filename, refs, regexs):
generated = is_generated_file(filename, data, regexs)
basename = os.path.basename(filename)
extension = file_extension(filename)
if generated:
extension = "generatego"
else:
extension = file_extension(filename)
if extension == "go":
extension = "generatego"
elif extension == "bzl":
extension = "generatebzl"
if extension != "":
ref = refs[extension]