-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sbt
88 lines (79 loc) · 2.64 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
import sbtcrossproject.CrossPlugin.autoImport.crossProject
lazy val scala210 = "2.10.7"
lazy val scala211 = "2.11.12"
lazy val scala212 = "2.12.20"
lazy val scala213 = "2.13.15"
lazy val scala3 = "3.6.2"
lazy val scalatestVersion = "3.2.19"
lazy val jmhVersion = "1.37"
name := "biginteger"
ThisBuild / organization := "pt.kcry"
ThisBuild / dynverSeparator := "-"
ThisBuild / scalaVersion := scala3
ThisBuild / crossScalaVersions := Seq()
ThisBuild / scalacOptions ++= Seq(
"-target:jvm-1.8",
"-unchecked",
"-deprecation"
)
licenses := LicenseDefinition.licenses
headerLicense := LicenseDefinition.template
ThisBuild / publishTo := sonatypePublishToBundle.value
lazy val biginteger = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Full)
.in(file("."))
.enablePlugins(BuildInfoPlugin)
.enablePlugins(AutomateHeaderPlugin)
.settings(
Test / publishArtifact := false,
buildInfoKeys := Seq(
BuildInfoKey.action("commit") {
scala.sys.process.Process("git rev-parse HEAD").!!.trim
}
),
buildInfoPackage := "pt.kcry.biginteger",
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % scalatestVersion % Test,
),
licenses := LicenseDefinition.licenses,
headerLicense := LicenseDefinition.template
)
.jvmSettings(
crossScalaVersions := Seq(scala210, scala212, scala211, scala213, scala3)
)
.jsSettings(
crossScalaVersions := Seq(scala212, scala213, scala3),
Test / scalaJSStage := FullOptStage
)
.nativeSettings(
crossScalaVersions := Seq(scala212, scala213, scala3))
lazy val bench = project.in(file("bench"))
.enablePlugins(JavaAppPackaging)
.enablePlugins(JmhPlugin)
.dependsOn(biginteger.jvm)
.settings(
libraryDependencies ++= Seq(
"org.openjdk.jmh" % "jmh-core" % jmhVersion,
"org.openjdk.jmh" % "jmh-generator-annprocess" % jmhVersion,
),
publish / skip := true,
scalaVersion := scala213,
crossScalaVersions := Seq(scala213),
assembly / assemblyJarName := "bench.jar",
assembly / mainClass := Some("org.openjdk.jmh.Main"),
assembly / test := {},
scalacOptions ++= Seq(
"-opt:_",
"-Xlint:_,-nonlocal-return,-unit-special",
),
licenses := LicenseDefinition.licenses,
headerLicense := LicenseDefinition.template,
headerSources / excludeFilter := HiddenFileFilter || {
new SimpleFileFilter(_.getCanonicalPath contains "/original/")
},
assembly / assemblyMergeStrategy := {
case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
case _ => MergeStrategy.first
},
Jmh / assembly := (Jmh / assembly).dependsOn(Jmh / Keys.compile).value
)