This repository was archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbuild.sbt
75 lines (51 loc) · 2.04 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
// Copyright (c) Microsoft. All rights reserved.
import sbt.project
organization := "com.microsoft.azure.iotsolutions"
scalaVersion := "2.12.4"
lazy val telemetry = (project in file("device-telemetry"))
lazy val iothubmanager = (project in file("iothub-manager"))
val pcsconfig = (project in file("config"))
lazy val pcsstorageadapter = (project in file("storage-adapter"))
val sourceEnvVars = taskKey[Unit]("Source environment variables")
val startDonNetOnlyServices = taskKey[Unit]("Start .Net only Services")
sourceEnvVars := {
import sys.process._
println("Sourcing all env variables")
lazy val projDir = baseDirectory.in(remoteMonitoring).value.getAbsolutePath
val win = sys.props.get("os.name").get.contains("Windows")
//TO separate running scripts on Windows and other Linux based systems (including Mac OS)
//TODO: Revisit to combine two if statements
if (win) {
Seq(projDir + "\\scripts\\local\\launch\\.env.cmd")!
} else {
Seq("source", projDir + "/scripts/local/launch/set_env.sh")!
}
if (win) {
Seq( projDir + "\\scripts\\local\\launch\\.env_uris.cmd")!
} else {
Seq("source", projDir + "/scripts/local/launch/.env_uris.sh")!
}
println("Completed setting all env variables")
}
startDonNetOnlyServices := {
import sys.process._
println("Starting all .Net only Services")
lazy val projDir = baseDirectory.in(remoteMonitoring).value.getAbsolutePath
val win = sys.props.get("os.name").get.contains("Windows")
if (win) {
Seq( projDir + "\\scripts\\local\\launch\\start-dotnet-only-services.cmd")!
} else {
Seq("sh", projDir + "/scripts/local/launch/start-dotnet-only-services.sh")!
}
println("Completed all .Net only Services")
}
lazy val remoteMonitoring = (project in file(".")).
settings(
run := {
((run in Runtime) dependsOn startDonNetOnlyServices).evaluated
(run in `iothubmanager` in Compile).evaluated
(run in `telemetry` in Compile).evaluated
(run in `pcsconfig` in Compile).evaluated
(run in `pcsstorageadapter` in Compile).evaluated
}
)