-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
145 lines (132 loc) · 3.86 KB
/
Copy pathbuild.sbt
File metadata and controls
145 lines (132 loc) · 3.86 KB
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
val Versions = new {
val Scala3 = "3.7.4"
val Scala213 = "2.13.18"
val Scala212 = "2.12.20"
val allScala = Seq(Scala3, Scala213, Scala212)
val onlyScala3 = Seq(Scala3)
val DeclineDerive = "0.3.3"
val Rendition = "0.0.4"
val OsLib = "0.11.6"
val MUnit = "1.2.1"
}
lazy val root = project
.aggregate(fxprofFormat.projectRefs *)
.aggregate(fxprofSample.projectRefs *)
.aggregate(fxprofTracer.projectRefs *)
.aggregate(fxprofCodegen)
.settings(noPublish)
lazy val fxprofFormat = projectMatrix
.in(file("mod/fxprof-format"))
.jvmPlatform(Versions.allScala)
.nativePlatform(Versions.allScala)
.jsPlatform(Versions.allScala)
.settings(
name := "fxprof-format",
libraryDependencies ++= Seq(
"com.github.plokhotnyuk.jsoniter-scala" %%% "jsoniter-scala-core" % "2.38.5",
"com.github.plokhotnyuk.jsoniter-scala" %%% "jsoniter-scala-macros" % "2.38.5" % "compile-internal"
)
)
lazy val fxprofTracer = projectMatrix
.in(file("mod/fxprof-tracer"))
.dependsOn(fxprofFormat)
.jvmPlatform(Versions.allScala)
.nativePlatform(Versions.allScala)
// TODO: re-enable when TracerTests.scala is adjusted to be runnable on Scala.js (Thread#join is a problem)
// .jsPlatform(Versions.allScala)
.settings(
name := "fxprof-tracer",
scalacOptions += "-Xsource:3"
)
.settings(
snapshotsPackageName := "fxprof_snapshots",
snapshotsIntegrations += SnapshotIntegration.MUnit, // if using MUnit
snapshotsForceOverwrite := !sys.env.contains("CI"),
libraryDependencies += "org.scalameta" %%% "munit" % Versions.MUnit % Test,
Test / scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule))
)
.enablePlugins(SnapshotsPlugin)
lazy val fxprofCodegen = project
.in(file("mod/fxprof-codegen"))
.settings(
scalaVersion := Versions.Scala3,
libraryDependencies ++= Seq(
"com.indoorvivants" %%% "decline-derive" % Versions.DeclineDerive,
"com.indoorvivants" %%% "rendition" % Versions.Rendition,
"com.lihaoyi" %%% "os-lib" % Versions.OsLib
),
run / fork := true,
noPublish
)
val codegen = inputKey[Unit]("")
Global / codegen := Def.inputTaskDyn {
val task = InputKey[Unit]("scalafmtAll")
val out =
(fxprofFormat.jvm(
Versions.Scala3
) / Compile / sourceDirectory).value / "scala" / "generated"
val in =
(ThisBuild / baseDirectory).value / "firefox-profiler"
Def
.sequential(
Def.taskDyn {
(fxprofCodegen / Compile / run)
.toTask(
s" --out $out --firefoxProfiler $in"
)
}
)
}.evaluated
lazy val fxprofSample = projectMatrix
.in(file("mod/fxprof-sample"))
.dependsOn(fxprofTracer)
.jvmPlatform(Versions.onlyScala3)
.settings(
noPublish,
libraryDependencies ++= Seq(
"com.indoorvivants" %%% "decline-derive" % Versions.DeclineDerive,
"com.lihaoyi" %%% "os-lib" % Versions.OsLib
)
)
val buildSample = inputKey[Unit]("")
Global / buildSample := Def.inputTaskDyn {
val out =
(ThisBuild / baseDirectory).value / "sample-profile.json"
Def
.sequential(
Def.taskDyn {
(fxprofSample.jvm(Versions.Scala3) / Compile / run)
.toTask(
s" --out $out"
)
},
Def.task {
sLog.value.info(s"Sample built successfully in $out")
}
)
}.evaluated
inThisBuild(
Seq(
organization := "com.indoorvivants",
organizationName := "Anton Sviridov",
homepage := Some(
url("https://github.com/indoorvivants/fxprof")
),
startYear := Some(2022),
licenses := List(
"Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")
),
developers := List(
Developer(
"keynmol",
"Anton Sviridov",
"velvetbaldmime@protonmail.com",
url("https://blog.indoorvivants.com")
)
)
)
)
lazy val noPublish = Seq(
publish / skip := true,
publishLocal / skip := true
)