forked from ArgonDesign/alogic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
112 lines (79 loc) · 3.58 KB
/
build.sbt
File metadata and controls
112 lines (79 loc) · 3.58 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
////////////////////////////////////////////////////////////////////////////////
// Argon Design Ltd. Project P8009 Alogic
// Copyright (c) 2017 Argon Design Ltd. All rights reserved.
//
// Module : Scala Alogic Compiler
// Author : Peter de Rivaz/Geza Lore
//
// DESCRIPTION:
//
//
// This file is covered by the BSD (with attribution) license.
// See the LICENSE file for the precise wording of the license.
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// About the project
////////////////////////////////////////////////////////////////////////////////
name := "alogic"
organization := "com.argondesign"
////////////////////////////////////////////////////////////////////////////////
// Scala compiler
////////////////////////////////////////////////////////////////////////////////
scalaVersion := "2.13.0"
scalacOptions ++= Seq("-feature",
"-explaintypes",
"-unchecked",
"-Xlint:_")
////////////////////////////////////////////////////////////////////////////////
// Library dependencies
////////////////////////////////////////////////////////////////////////////////
libraryDependencies += "org.rogach" %% "scallop" % "3.3.1"
libraryDependencies +=
"org.scala-lang.modules" %% "scala-parallel-collections" % "0.2.0"
////////////////////////////////////////////////////////////////////////////////
// Testing dependencies
////////////////////////////////////////////////////////////////////////////////
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8" % "test"
logBuffered in Test := false
testOptions in Test += Tests.Argument("-oD") // Add F for full stack traces
////////////////////////////////////////////////////////////////////////////////
// Style check
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Antlr4 plugin
////////////////////////////////////////////////////////////////////////////////
enablePlugins(Antlr4Plugin)
antlr4Version in Antlr4 := "4.7.1"
antlr4PackageName in Antlr4 := Some("com.argondesign.alogic.antlr")
antlr4GenListener in Antlr4 := false
antlr4GenVisitor in Antlr4 := true
////////////////////////////////////////////////////////////////////////////////
// SBT native packager
////////////////////////////////////////////////////////////////////////////////
enablePlugins(JavaAppPackaging)
// stage := (stage dependsOn (test in Test)).value
bashScriptExtraDefines += """
# Pass a secret option if stderr is tty, but only if not asking for --help
if [[ "$*" != "-h" && "$*" != "--help" && -t 2 ]]; then
stderrisatty="--stderrisatty"
fi
if [[ "$*" == "--compiler-deps" ]]; then
readlink -f "$0"
echo "$app_classpath" | tr ":" "\n"
exit 0
fi
# Prepend '--' to the command line arguments. This in fact causes the wrapper
# to not consume any arguments, in particular -D options
set -- -- ${stderrisatty} "$@"
"""
////////////////////////////////////////////////////////////////////////////////
// SBT git
////////////////////////////////////////////////////////////////////////////////
enablePlugins(GitVersioning)
git.useGitDescribe := true
////////////////////////////////////////////////////////////////////////////////
// SBT buildinfo
////////////////////////////////////////////////////////////////////////////////
enablePlugins(BuildInfoPlugin)
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion)
buildInfoPackage := "com.argondesign.alogic"