Skip to content

Commit

Permalink
Introduce RunCoverageForTestTarget script
Browse files Browse the repository at this point in the history
  • Loading branch information
Rd4dev committed Jun 4, 2024
1 parent 16af8e1 commit e90def4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,15 @@ kt_jvm_binary(
],
)

kt_jvm_binary(
name = "run_coverage_for_test_target",
testonly = True,
main_class = "org.oppia.android.scripts.coverage.RunCoverageForTestTargetKt",
runtime_deps = [
"//scripts/src/java/org/oppia/android/scripts/coverage:run_coverage_for_test_target_lib",
],
)

# Note that this is intentionally not test-only since it's used by the app build pipeline. Also,
# this apparently needs to be a java_binary to set up runfiles correctly when executed within a
# Starlark rule as a tool.
Expand Down
14 changes: 14 additions & 0 deletions scripts/src/java/org/oppia/android/scripts/coverage/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library")

kt_jvm_library(
name = "run_coverage_for_test_target_lib",
testonly = True,
srcs = [
"RunCoverageForTestTarget.kt",
],
visibility = ["//scripts:oppia_script_binary_visibility"],
deps = [
"//scripts/src/java/org/oppia/android/scripts/common:bazel_client",
"//scripts/src/java/org/oppia/android/scripts/common:git_client",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.oppia.android.scripts.coverage

fun main(vararg args: String) {
println("Running coverage for test target: ${args[0]}")
}

0 comments on commit e90def4

Please sign in to comment.