forked from Zetten/bazel-sonarqube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
50 lines (43 loc) · 1.41 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_sonarqube//:defs.bzl", "sonarqube_coverage_generator_binary")
bzl_library(
name = "bzl",
srcs = ["defs.bzl", "@bazel-version//:defs.bzl"],
visibility = ["//visibility:public"],
deps = [
"@bazel_skylib//lib:paths",
"@bazel_skylib//lib:versions",
],
)
exports_files([
"defs.bzl",
"sonar-project.properties.tpl",
])
sonarqube_coverage_generator_binary()
# This re-exports the java_binary, to ensure it gets built with runfiles for the host configuration
genrule(
name = "sonarqube_coverage_generator",
outs = ["coverage.launcher"],
cmd = "ln -snf $$(readlink $(location :SonarQubeCoverageGenerator)) $@",
executable = 1,
tags = ["no-cache"], # successful execution even when --remote_cache is involved
tools = [":SonarQubeCoverageGenerator"],
visibility = ["//visibility:public"],
)
alias(
name = "sonar_scanner",
actual = "@org_sonarsource_scanner_cli_sonar_scanner_cli//:sonar_scanner",
visibility = ["//visibility:public"],
)
filegroup(
name = "coverage_report",
srcs = ["bazel-out/_coverage/_coverage_report.dat"], # Created manually
tags = ["manual"],
visibility = ["//visibility:public"],
)
filegroup(
name = "test_reports",
srcs = glob(["bazel-testlogs/**/test.xml"]), # Created manually
tags = ["manual"],
visibility = ["//visibility:public"],
)