Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
[maintenance] add ability to run benchmark on specific targets instea…
Browse files Browse the repository at this point in the history
…d of running it on //...

Merge-request: BAZEL-MR-487
Merged-by: Danil Tereshchenko <[email protected]>
  • Loading branch information
hb-man authored and qodana-bot committed Sep 1, 2023
1 parent bc31085 commit 1716735
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions bspcli/src/java/org/jetbrains/bsp/cli/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,21 @@ interface Api: BuildServer, JvmBuildServer, ScalaBuildServer, JavaBuildServer, C

data class Args(
val workspace: Path,
val metricsFile: Path?
val metricsFile: Path?,
val target: String
)

fun parseArgs(args: Array<String>): Args {
if (args.size == 1) {
return Args(workspace = Paths.get(args[0]), metricsFile = null)
return Args(workspace = Paths.get(args[0]), metricsFile = null, target = "//...")
}
if (args.size == 2) {
return Args(workspace = Paths.get(args[0]), metricsFile = Paths.get(args[1]))
return Args(workspace = Paths.get(args[0]), metricsFile = Paths.get(args[1]), target = "//...")
}
if (args.size == 3) {
return Args(workspace = Paths.get(args[0]), metricsFile = Paths.get(args[1]), target = args[2])
}


println("Invalid number of arguments. Just pass path to your workspace as a CLI argument to this app")
exitProcess(1)
Expand All @@ -61,7 +66,7 @@ fun main(args0: Array<String>) {
Install.main(arrayOf(
"--bazel-workspace", args.workspace.toString(),
"--directory", installationDirectory.toString(),
"--targets", "//..."
"--targets", args.target
))

val serverOut = PipedInputStream()
Expand Down

0 comments on commit 1716735

Please sign in to comment.