Skip to content

Commit

Permalink
Create a CoverageOutputGenerator zip archive and upload it to GCS.
Browse files Browse the repository at this point in the history
Closes bazelbuild#7967.

PiperOrigin-RevId: 242444365
  • Loading branch information
iirina authored and copybara-github committed Apr 8, 2019
1 parent 0e882b6 commit 991979b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,36 @@ java_binary(
runtime_deps = [":lcov_merger_lib"],
)

genrule(
name = "rename_build_tools",
srcs = ["BUILD.tools"],
outs = ["coverage/BUILD"],
cmd = "cp $< $@",
)

genrule(
name = "create_empty_workspace",
outs = ["WORKSPACE"],
cmd = "touch $@",
)

genrule(
name = "coverage_output_generator_zip",
srcs = [
":all_lcov_merger_tools_deploy.jar",
"coverage/BUILD",
"WORKSPACE",
],
outs = ["coverage_output_generator.zip"],
cmd = "zip -q -j $@ $(SRCS)",
)

sh_binary(
name = "build_and_upload",
srcs = ["build_and_upload.sh"],
data = [":coverage_output_generator.zip"],
)

java_library(
name = "lcov_merger_lib",
srcs = glob(["*.java"]),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
#
# Copyright 2019 The Bazel Authors. All rights reserved.
#
# 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.

gsutil cp "tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator/coverage_output_generator.zip" \
gs://bazel-mirror/bazel_coverage_output_generator/coverage_output_generator-$(git rev-parse HEAD)-$(date +%s).zip

0 comments on commit 991979b

Please sign in to comment.