forked from yugabyte/yugabyte-db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
561 lines (479 loc) · 20.2 KB
/
build.sbt
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
import jline.console.ConsoleReader
import play.sbt.PlayImport.PlayKeys.{playInteractionMode, playMonitoredFiles}
import play.sbt.PlayInteractionMode
import sbt.Tests._
import scala.sys.process.Process
useCoursier := false
// ------------------------------------------------------------------------------------------------
// Constants
// ------------------------------------------------------------------------------------------------
// This is used to decide whether to clean/build the py2 or py3 venvs.
lazy val USE_PYTHON3 = strToBool(System.getenv("YB_MANAGED_DEVOPS_USE_PYTHON3"), default = true)
// Use this to enable debug logging in this script.
lazy val YB_DEBUG_ENABLED = strToBool(System.getenv("YB_BUILD_SBT_DEBUG"))
// ------------------------------------------------------------------------------------------------
// Functions
// ------------------------------------------------------------------------------------------------
def normalizeEnvVarValue(value: String): String = {
if (value == null) null else value.trim()
}
def strToBool(s: String, default: Boolean = false): Boolean = {
if (s == null) default
else {
val normalizedStr = normalizeEnvVarValue(s)
normalizedStr != null && (normalizedStr.toLowerCase() == "true" || normalizedStr == "1")
}
}
def ybLog(s: String): Unit = {
println("[Yugabyte sbt log] " + s)
}
def getEnvVar(envVarName: String): String = {
val envVarValue = System.getenv(envVarName)
val strValue = normalizeEnvVarValue(envVarValue)
if (YB_DEBUG_ENABLED) {
ybLog("getEnvVar: envVarName=" + envVarName + ", strValue=" + strValue)
}
strValue
}
def getBoolEnvVar(envVarName: String): Boolean = {
val strValue = getEnvVar(envVarName)
val boolValue = strToBool(strValue)
if (YB_DEBUG_ENABLED) {
ybLog("getBoolEnvVar: envVarName=" + envVarName + ", boolValue=" + boolValue)
}
boolValue
}
def isDefined(s: String): Boolean = {
s != null && normalizeEnvVarValue(s).nonEmpty
}
def validateResolver(
resolver: Seq[sbt.Resolver],
description: String): Seq[sbt.Resolver] = {
if (resolver == null) {
throw new AssertionError("Undefined resolver: " + description)
}
// We are logging this even in non-debug mode, because these log messages are very useful and
// only one message is logged per resolver.
ybLog("[Resolver] " + description + ": " + resolver)
resolver
}
// ------------------------------------------------------------------------------------------------
// Task Keys
// ------------------------------------------------------------------------------------------------
lazy val cleanPlatform = taskKey[Int]("Clean Yugabyte Platform")
lazy val compilePlatform = taskKey[Int]("Compile Yugabyte Platform")
lazy val runPlatformTask = taskKey[Unit]("Run Yugabyte Platform helper task")
lazy val runPlatform = inputKey[Unit]("Run Yugabyte Platform with UI")
lazy val consoleSetting = settingKey[PlayInteractionMode]("custom console setting")
lazy val versionGenerate = taskKey[Int]("Add version_metadata.json file")
lazy val buildVenv = taskKey[Int]("Build venv")
lazy val buildUI = taskKey[Int]("Build UI")
lazy val buildModules = taskKey[Int]("Build modules")
lazy val cleanUI = taskKey[Int]("Clean UI")
lazy val cleanVenv = taskKey[Int]("Clean venv")
lazy val cleanModules = taskKey[Int]("Clean modules")
lazy val compileJavaGenClient = taskKey[Int]("Compile generated Java code")
// ------------------------------------------------------------------------------------------------
// Main build.sbt script
// ------------------------------------------------------------------------------------------------
name := "yugaware"
lazy val root = (project in file("."))
.enablePlugins(PlayJava, PlayEbean, SbtWeb, JavaAppPackaging, JavaAgent)
.disablePlugins(PlayLayoutPlugin)
.settings(commands += Command.command("deflake") { state =>
"test" :: "deflake" :: state
})
.settings(commands += Command.args("deflakeOne", "<arg>") { (state, args) =>
"testOnly " + args.mkString(" ") :: "deflakeOne " + args.mkString(" "):: state
})
scalaVersion := "2.12.10"
version := sys.process.Process("cat version.txt").lineStream_!.head
Global / onChangedBuildSource := ReloadOnSourceChanges
libraryDependencies ++= Seq(
javaJdbc,
ehcache,
javaWs,
filters,
guice,
"com.google.inject.extensions" % "guice-multibindings" % "4.2.3",
"org.postgresql" % "postgresql" % "42.3.3",
"net.logstash.logback" % "logstash-logback-encoder" % "6.2",
"org.codehaus.janino" % "janino" % "3.1.6",
"org.apache.commons" % "commons-compress" % "1.21",
"org.apache.httpcomponents" % "httpcore" % "4.4.5",
"org.apache.httpcomponents" % "httpclient" % "4.5.13",
"org.flywaydb" %% "flyway-play" % "4.0.0",
// https://github.com/YugaByte/cassandra-java-driver/releases
"com.yugabyte" % "cassandra-driver-core" % "3.8.0-yb-7",
"org.yaml" % "snakeyaml" % "1.29",
"org.bouncycastle" % "bcpkix-jdk15on" % "1.61",
"org.springframework.security" % "spring-security-core" % "5.5.6",
"com.amazonaws" % "aws-java-sdk-ec2" % "1.12.129",
"com.amazonaws" % "aws-java-sdk-kms" % "1.12.129",
"com.amazonaws" % "aws-java-sdk-iam" % "1.12.129",
"com.amazonaws" % "aws-java-sdk-sts" % "1.12.129",
"com.amazonaws" % "aws-java-sdk-s3" % "1.12.129",
"com.cronutils" % "cron-utils" % "9.1.6",
// Be careful when changing azure library versions.
// Make sure all itests and existing functionality works as expected.
"com.azure" % "azure-core" % "1.13.0",
"com.azure" % "azure-identity" % "1.2.3",
"com.azure" % "azure-security-keyvault-keys" % "4.2.5",
"com.azure" % "azure-storage-blob" % "12.7.0",
"javax.mail" % "mail" % "1.4.7",
"io.prometheus" % "simpleclient" % "0.11.0",
"io.prometheus" % "simpleclient_hotspot" % "0.11.0",
"io.prometheus" % "simpleclient_servlet" % "0.11.0",
"org.glassfish.jaxb" % "jaxb-runtime" % "2.3.2",
"org.pac4j" %% "play-pac4j" % "7.0.1",
"org.pac4j" % "pac4j-oauth" % "3.7.0" exclude("commons-io" , "commons-io"),
"org.pac4j" % "pac4j-oidc" % "3.7.0" exclude("commons-io" , "commons-io"),
"com.typesafe.play" %% "play-json" % "2.6.14",
"org.asynchttpclient" % "async-http-client" % "2.2.1",
"commons-validator" % "commons-validator" % "1.7",
"org.apache.velocity" % "velocity" % "1.7",
"org.apache.velocity" % "velocity-engine-core" % "2.3",
"com.fasterxml.jackson.core" % "jackson-core" % "2.10.5",
"com.jayway.jsonpath" % "json-path" % "2.6.0",
"commons-io" % "commons-io" % "2.8.0",
"commons-codec" % "commons-codec" % "1.15",
"com.google.apis" % "google-api-services-compute" % "v1-rev20220506-1.32.1",
"com.google.apis" % "google-api-services-iam" % "v1-rev20211104-1.32.1",
"com.google.cloud" % "google-cloud-compute" % "1.9.1",
"com.google.cloud" % "google-cloud-storage" % "2.2.1",
"com.google.cloud" % "google-cloud-kms" % "2.4.4",
"com.google.cloud" % "google-cloud-resourcemanager" % "1.4.0",
"org.projectlombok" % "lombok" % "1.18.20",
"com.squareup.okhttp3" % "okhttp" % "4.9.2",
"io.kamon" %% "kamon-bundle" % "2.2.2",
"io.kamon" %% "kamon-prometheus" % "2.2.2",
"org.unix4j" % "unix4j-command" % "0.6",
"com.github.dikhan" % "pagerduty-client" % "3.1.2",
"com.bettercloud" % "vault-java-driver" % "5.1.0",
"org.apache.directory.api" % "api-all" % "2.1.0",
"io.fabric8" % "kubernetes-client" % "5.10.2",
"org.apache.commons" % "commons-text" % "1.9",
"io.jsonwebtoken" % "jjwt-api" % "0.11.5",
"io.jsonwebtoken" % "jjwt-impl" % "0.11.5",
"io.jsonwebtoken" % "jjwt-jackson" % "0.11.5",
"io.swagger" % "swagger-annotations" % "1.5.22", // needed for annotations in prod code
"de.dentrassi.crypto" % "pem-keystore" % "2.2.1",
// ---------------------------------------------------------------------------------------------//
// TEST DEPENDENCIES //
// ---------------------------------------------------------------------------------------------//
"org.mockito" % "mockito-core" % "2.13.0" % Test,
"org.mockito" % "mockito-inline" % "3.8.0" % Test,
"org.mindrot" % "jbcrypt" % "0.4" % Test,
"com.h2database" % "h2" % "2.1.212" % Test,
"org.hamcrest" % "hamcrest-core" % "2.2" % Test,
"pl.pragmatists" % "JUnitParams" % "1.1.1" % Test,
"com.icegreen" % "greenmail" % "1.6.1" % Test,
"com.icegreen" % "greenmail-junit4" % "1.6.1" % Test,
"com.squareup.okhttp3" % "mockwebserver" % "4.9.2" % Test,
)
// Clear default resolvers.
appResolvers := None
bootResolvers := None
otherResolvers := Seq()
// Whether to use local maven repo to retrieve artifacts (used for yb-client).
lazy val ybUseMavenLocalEnvVarName = "USE_MAVEN_LOCAL"
lazy val mavenLocal = getBoolEnvVar(ybUseMavenLocalEnvVarName)
lazy val ybMvnSnapshotUrlEnvVarName = "YB_MVN_SNAPSHOT_URL"
lazy val ybMvnLocalRepoEnvVarName = "YB_MVN_LOCAL_REPO"
lazy val ybLocalResolverDescription =
"Local resolver (enabled by " + ybUseMavenLocalEnvVarName + ", path can be customized with " +
ybMvnLocalRepoEnvVarName + ")"
lazy val ybLocalResolver = {
if (mavenLocal) {
val localMavenRepo = getEnvVar(ybMvnLocalRepoEnvVarName)
if (isDefined(localMavenRepo)) {
Seq("Local Maven Repository" at "file://" + localMavenRepo)
} else {
Seq(Resolver.mavenLocal)
}
} else {
Seq()
}
}
lazy val ybClientSnapshotResolverDescription =
"Snapshot resolver for yb-client jar (used when " + ybUseMavenLocalEnvVarName + " is not " +
"set, mostly during local development, configured with " + ybMvnSnapshotUrlEnvVarName + ")"
lazy val ybClientSnapshotResolver = {
if (mavenLocal) {
Seq()
} else {
val ybMavenSnapshotUrl = getEnvVar(ybMvnSnapshotUrlEnvVarName)
if (isDefined(ybMavenSnapshotUrl)) {
Seq("Yugabyte Maven Snapshots" at ybMavenSnapshotUrl)
} else {
Seq()
}
}
}
lazy val ybPublicSnapshotResolverDescription =
"Public snapshot resolver for yb-client jar"
lazy val ybPublicSnapshotResolver = {
val ybPublicSnapshotUrl = "https://repository.yugabyte.com/maven/"
Seq("Yugabyte Public Maven Snapshots" at ybPublicSnapshotUrl)
}
// Custom remote maven repository to retrieve library dependencies from.
lazy val ybMvnCacheUrlEnvVarName = "YB_MVN_CACHE_URL"
lazy val ybMvnCacheUrl = getEnvVar(ybMvnCacheUrlEnvVarName)
lazy val mavenCacheServerResolverDescription =
"Maven cache server (such as Nexus or Artifactory), specified by " + ybMvnCacheUrlEnvVarName
lazy val mavenCacheServerResolver = {
if (isDefined(ybMvnCacheUrl)) {
Seq("Yugabyte Maven Cache" at ybMvnCacheUrl)
} else {
Seq()
}
}
// Override default resolver order.
// We put the local resolver because of a weird issue that happens on Jenkins. We somehow end up
// with only the .pom file but not the .jar file downloaded to the local Maven repo for the
// com.fasterxml.jackson.core#jackson-core;2.9.9 artifact, and then sbt 0.13.15 fails with the
// error below. When this issue is resolved, we can put the local resolver first to use cached
// jars as much as possible.
// https://gist.githubusercontent.com/mbautin/61a505cc9d35833d37557c9762130fd0/raw
externalResolvers := {
validateResolver(mavenCacheServerResolver, mavenCacheServerResolverDescription) ++
validateResolver(ybLocalResolver, ybLocalResolverDescription) ++
validateResolver(externalResolvers.value, "Default resolver") ++
validateResolver(ybClientSnapshotResolver, ybClientSnapshotResolverDescription) ++
validateResolver(ybPublicSnapshotResolver, ybPublicSnapshotResolverDescription)
}
(Compile / compilePlatform) := {
((Compile / compile) dependsOn buildModules).value
buildVenv.value
buildUI.value
versionGenerate.value
}
cleanPlatform := {
clean.value
cleanVenv.value
cleanUI.value
cleanModules.value
}
versionGenerate := {
val buildType = sys.env.getOrElse("BUILD_TYPE", "release")
val status = Process("../build-support/gen_version_info.py --build-type=" + buildType + " " +
(Compile / resourceDirectory).value / "version_metadata.json").!
ybLog("version_metadata.json Generated")
Process("rm -f " + (Compile / resourceDirectory).value / "gen_version_info.log").!
Process("./download_ybc.sh -c " + (Compile / resourceDirectory).value / "reference.conf", baseDirectory.value).!
status
}
buildVenv := {
ybLog("Building virtual env...")
val status = Process("./bin/install_python_requirements.sh", baseDirectory.value / "devops").!
Process("./bin/install_ansible_requirements.sh --force", baseDirectory.value / "devops").!
status
}
buildUI := {
ybLog("Building UI...")
val status = Process("npm ci", baseDirectory.value / "ui").!
status
}
buildModules := {
ybLog("Building modules...")
val status = Process("mvn install -f parent.xml").!
status
}
compileJavaGenClient := {
val buildType = sys.env.getOrElse("BUILD_TYPE", "release")
val status = Process("mvn install", new File(baseDirectory.value + "/client/java/generated")).!
status
}
cleanUI := {
ybLog("Cleaning UI...")
val status = Process("rm -rf node_modules", baseDirectory.value / "ui").!
status
}
cleanModules := {
ybLog("Cleaning Node Agent...")
val status = Process("mvn clean -f parent.xml").!
status
}
def get_venv_dir(): String = {
if (USE_PYTHON3) "venv" else "python_virtual_env"
}
cleanVenv := {
ybLog("Cleaning virtual env...")
val venvDir: String = get_venv_dir()
val status = Process("rm -rf " + venvDir, baseDirectory.value / "devops").!
status
}
// Generate a Java API client.
lazy val javagen = project.in(file("client/java"))
.settings(
openApiInputSpec := "src/main/resources/swagger.json",
openApiGeneratorName := "java",
openApiOutputDir := "client/java/generated",
openApiValidateSpec := SettingDisabled,
openApiConfigFile := "client/java/openapi-java-config.json",
)
// Generate a Python API client.
lazy val pythongen = project.in(file("client/python"))
.settings(
openApiInputSpec := "src/main/resources/swagger.json",
openApiGeneratorName := "python",
openApiOutputDir := "client/python/generated",
openApiValidateSpec := SettingDisabled,
openApiConfigFile := "client/python/openapi-python-config.json"
)
// Generate a Go API client.
lazy val gogen = project.in(file("client/go"))
.settings(
openApiInputSpec := "src/main/resources/swagger.json",
openApiGeneratorName := "go",
openApiOutputDir := "client/go/generated",
openApiValidateSpec := SettingDisabled,
openApiConfigFile := "client/go/openapi-go-config.json"
)
packageZipTarball.in(Universal) := packageZipTarball.in(Universal).dependsOn(versionGenerate).value
runPlatformTask := {
(Compile / run).toTask("").value
}
/**
* Add UI Run hook to run UI alongside with API.
*/
runPlatform := {
val curState = state.value
val newState = Project.extract(curState).appendWithoutSession(
Vector(PlayKeys.playRunHooks += UIRunHook(baseDirectory.value / "ui")),
curState
)
Project.extract(newState).runTask(runPlatformTask, newState)
}
libraryDependencies += "org.yb" % "ybc-client" % "1.0.0-b4"
libraryDependencies += "org.yb" % "yb-client" % "0.8.28-SNAPSHOT"
libraryDependencies ++= Seq(
"io.netty" % "netty-tcnative-boringssl-static" % "2.0.54.Final",
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.9.10",
"org.slf4j" % "slf4j-ext" % "1.7.26",
"net.minidev" % "json-smart" % "2.4.8",
"com.nimbusds" % "nimbus-jose-jwt" % "7.9",
// TODO(Shashank): Remove this in Step 3:
// Overrides to address vulnerability in swagger-play2
"com.typesafe.akka" %% "akka-actor" % "2.5.16"
)
dependencyOverrides += "com.google.protobuf" % "protobuf-java" % "3.19.4"
dependencyOverrides += "com.google.guava" % "guava" % "23.0"
// TODO(Shashank): Remove these in Step 3:
dependencyOverrides += "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.9.10"
dependencyOverrides += "com.fasterxml.jackson.dataformat" % "jackson-dataformat-cbor" % "2.9.10"
dependencyOverrides += "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10"
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10.8"
concurrentRestrictions in Global := Seq(Tags.limitAll(16))
val testParallelForks = SettingKey[Int]("testParallelForks",
"Number of parallel forked JVMs, running tests")
testParallelForks := 4
val testShardSize = SettingKey[Int]("testShardSize",
"Number of test classes, executed by each forked JVM")
testShardSize := 30
concurrentRestrictions in Global += Tags.limit(Tags.ForkedTestGroup, testParallelForks.value)
def partitionTests(tests: Seq[TestDefinition], shardSize: Int) =
tests.sortWith(_.name < _.name).grouped(shardSize).zipWithIndex map {
case (tests, index) =>
val options = ForkOptions().withRunJVMOptions(Vector(
"-Xmx2g", "-XX:MaxMetaspaceSize=600m", "-XX:MetaspaceSize=200m",
"-Dconfig.resource=application.test.conf"
))
Group("testGroup" + index, tests, SubProcess(options))
} toSeq
Test / parallelExecution := true
Test / fork := true
Test / testGrouping := partitionTests( (Test / definedTests).value, testShardSize.value )
javaOptions in Test += "-Dconfig.resource=application.test.conf"
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-q", "-a")
// Skip packaging javadoc for now
sources in (Compile, doc) := Seq()
publishArtifact in (Compile, packageDoc) := false
topLevelDirectory := None
// Skip auto-recompile of code in dev mode if AUTO_RELOAD=false
lazy val autoReload = getBoolEnvVar("AUTO_RELOAD")
playMonitoredFiles := { if (autoReload) playMonitoredFiles.value: @sbtUnchecked else Seq() }
consoleSetting := {
object PlayConsoleInteractionModeNew extends PlayInteractionMode {
private def withConsoleReader[T](f: ConsoleReader => T): T = {
val consoleReader = new ConsoleReader
try f(consoleReader)
finally consoleReader.close()
}
private def waitForKey(): Unit = {
withConsoleReader { consoleReader =>
def waitEOF(): Unit = {
consoleReader.readCharacter() match {
case 4 | -1 =>
// Note: we have to listen to -1 for jline2, for some reason...
// STOP on Ctrl-D, EOF.
case 11 =>
consoleReader.clearScreen(); waitEOF()
case 10 | 13 =>
println(); waitEOF()
case _ => waitEOF()
}
}
doWithoutEcho(waitEOF())
}
}
def doWithoutEcho(f: => Unit): Unit = {
withConsoleReader { consoleReader =>
val terminal = consoleReader.getTerminal
terminal.setEchoEnabled(false)
try f
finally terminal.restore()
}
}
override def waitForCancel(): Unit = waitForKey()
override def toString = "Console Interaction Mode"
}
PlayConsoleInteractionModeNew
}
playInteractionMode := consoleSetting.value
val swaggerGen: TaskKey[Unit] = taskKey[Unit](
"generate swagger.json"
)
lazy val swagger = project
.dependsOn(root % "compile->compile;test->test")
.settings(
Test / fork := true,
javaOptions in Test += "-Dconfig.resource=application.test.conf",
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-q", "-a"),
libraryDependencies ++= Seq(
"io.swagger" %% "swagger-play2" % "1.6.1" % Test,
"io.swagger" %% "swagger-scala-module" % "1.0.5" % Test,
),
dependencyOverrides += "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.9.10",
dependencyOverrides += "com.fasterxml.jackson.dataformat" % "jackson-dataformat-cbor" % "2.9.10",
dependencyOverrides += "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10",
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10.8",
swaggerGen := Def.taskDyn {
// Consider generating this only in managedResources
val file = (resourceDirectory in Compile in root).value / "swagger.json"
Def.sequential(
(Test / runMain )
.toTask(s" com.yugabyte.yw.controllers.SwaggerGenTest $file"),
)
}.value
)
test in Test := (test in Test).dependsOn(swagger / Test / test).value
swaggerGen := Def.taskDyn {
Def.sequential(
swagger /swaggerGen,
javagen / openApiGenerate,
compileJavaGenClient,
pythongen / openApiGenerate,
gogen / openApiGenerate
)
}.value
val grafanaGen: TaskKey[Unit] = taskKey[Unit](
"generate dashboard.json"
)
grafanaGen := Def.taskDyn {
val file = (resourceDirectory in Compile).value / "metric" / "Dashboard.json"
Def.sequential(
(runMain in Test)
.toTask(s" com.yugabyte.yw.controllers.GrafanaGenTest $file")
)
}.value