This repository was archived by the owner on Mar 27, 2021. It is now read-only.
forked from wavesplatform/Waves
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sbt
More file actions
128 lines (117 loc) · 4.26 KB
/
build.sbt
File metadata and controls
128 lines (117 loc) · 4.26 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
/* IDEA notes
* May require to delete .idea and re-import with all checkboxes
* Worksheets may not work: https://youtrack.jetbrains.com/issue/SCL-6726
* To work with worksheets, make sure:
1. You've selected the appropriate project
2. You've checked "Make project before run"
*/
import sbt.Keys._
import sbt._
import sbt.internal.inc.ReflectUtilities
import sbtcrossproject.CrossPlugin.autoImport.{CrossType, crossProject}
lazy val lang =
crossProject(JSPlatform, JVMPlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(CrossType.Full)
.settings(
coverageExcludedPackages := ".*",
test in assembly := {},
libraryDependencies ++= Dependencies.lang.value ++ Dependencies.test,
inConfig(Compile)(
Seq(
sourceGenerators += Tasks.docSource,
PB.targets += scalapb.gen(flatPackage = true) -> (sourceManaged in Compile).value,
PB.protoSources := Seq(baseDirectory.value.getParentFile / "shared" / "src" / "main" / "protobuf"),
PB.deleteTargetDirectory := false
)
)
)
lazy val langJVM = lang.jvm
.settings(
name := "RIDE Compiler",
normalizedName := "lang",
description := "The RIDE smart contract language compiler",
libraryDependencies += "org.scala-js" %% "scalajs-stubs" % "1.0.0" % Provided
)
lazy val `lang-testkit` = project
.dependsOn(langJVM)
.in(file("lang/testkit"))
.settings(
libraryDependencies ++= Dependencies.test.map(_.withConfigurations(Some("compile")))
)
lazy val node = project.dependsOn(langJVM, `lang-testkit` % "test")
lazy val `node-tools` = project.dependsOn(node % "compile;runtime->provided")
lazy val root = (project in file("."))
.aggregate(
langJVM,
node
)
inScope(Global)(
Seq(
scalaVersion := "2.12.9",
organization := "com.wavesplatform",
organizationName := "Waves Platform",
V.fallback := (1, 1, 8),
organizationHomepage := Some(url("https://wavesplatform.com")),
scmInfo := Some(ScmInfo(url("https://github.com/wavesplatform/Waves"), "git@github.com:wavesplatform/Waves.git", None)),
licenses := Seq(("MIT", url("https://github.com/wavesplatform/Waves/blob/master/LICENSE"))),
scalacOptions ++= Seq(
"-feature",
"-deprecation",
"-unchecked",
"-language:higherKinds",
"-language:implicitConversions",
"-language:postfixOps",
"-Ywarn-unused:-implicits",
"-Xlint",
"-Ypartial-unification",
"-opt:l:inline",
"-opt-inline-from:**"
),
crossPaths := false,
scalafmtOnCompile := false,
dependencyOverrides ++= Dependencies.enforcedVersions.value,
cancelable := true,
logBuffered := false,
coverageExcludedPackages := ".*",
parallelExecution := false,
testListeners := Seq.empty, // Fix for doubled test reports
/* http://www.scalatest.org/user_guide/using_the_runner
* o - select the standard output reporter
* I - show reminder of failed and canceled tests without stack traces
* D - show all durations
* O - drop InfoProvided events
* F - show full stack traces
* u - select the JUnit XML reporter with output directory
*/
testOptions += Tests.Argument("-oIDOF", "-u", "target/test-reports"),
testOptions += Tests.Setup(_ => sys.props("sbt-testing") = "true"),
concurrentRestrictions := {
val threadNumber = Option(System.getenv("SBT_THREAD_NUMBER")).fold(1)(_.toInt)
Seq(Tags.limit(Tags.ForkedTestGroup, threadNumber))
},
network := Network(sys.props.get("network"))
)
)
// ThisBuild options
git.useGitDescribe := true
git.uncommittedSignifier := Some("DIRTY")
// root project settings
// https://stackoverflow.com/a/48592704/4050580
def allProjects: List[ProjectReference] = ReflectUtilities.allVals[Project](this).values.toList map { p =>
p: ProjectReference
}
lazy val cleanAll = taskKey[Unit]("Clean all projects")
cleanAll := clean.all(ScopeFilter(inProjects(allProjects: _*), inConfigurations(Compile))).value
lazy val packageAll = taskKey[Unit]("Package all artifacts")
packageAll := Def
.sequential(
root / cleanAll,
Def.task {
(node / assembly).value
(node / Debian / packageBin).value
(`node-tools` / Universal / packageZipTarball).value
(`node-tools` / Debian / packageBin).value
}
)
.value