-
Notifications
You must be signed in to change notification settings - Fork 52
/
build.sbt
127 lines (111 loc) · 4.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
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
import sbt.Keys.{homepage, scalaVersion}
name := "scrypto"
description := "Cryptographic primitives for Scala"
organization := "org.scorexfoundation"
lazy val scala213 = "2.13.11"
lazy val scala212 = "2.12.18"
lazy val scala211 = "2.11.12"
javacOptions ++=
"-source" :: "1.8" ::
"-target" :: "1.8" ::
Nil
lazy val commonSettings = Seq(
organization := "org.scorexfoundation",
resolvers ++= Resolver.sonatypeOssRepos("public"),
licenses := Seq("CC0" -> url("https://creativecommons.org/publicdomain/zero/1.0/legalcode")),
homepage := Some(url("https://github.com/input-output-hk/scrypto")),
pomExtra :=
<developers>
<developer>
<id>kushti</id>
<name>Alexander Chepurnoy</name>
<url>http://chepurnoy.org/</url>
</developer>
</developers>,
scmInfo := Some(
ScmInfo(
url("https://github.com/input-output-hk/scrypto"),
"scm:[email protected]:input-output-hk/scrypto.git"
)
),
libraryDependencies ++= Seq(
"org.rudogma" %%% "supertagged" % "2.0-RC2",
"org.scorexfoundation" %%% "scorex-util" % "0.2.1",
"org.scalatest" %%% "scalatest" % "3.3.0-SNAP3" % Test,
"org.scalatest" %%% "scalatest-propspec" % "3.3.0-SNAP3" % Test,
"org.scalatest" %%% "scalatest-shouldmatchers" % "3.3.0-SNAP3" % Test,
"org.scalatestplus" %%% "scalacheck-1-15" % "3.3.0.0-SNAP3" % Test,
"org.scalacheck" %%% "scalacheck" % "1.15.2" % Test
),
javacOptions ++= javacReleaseOption,
publishMavenStyle := true,
publishTo := sonatypePublishToBundle.value
)
Test / publishArtifact := false
pomIncludeRepository := { _ => false }
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
lazy val scrypto = crossProject(JVMPlatform, JSPlatform)
.in(file("."))
.settings(commonSettings)
.jvmSettings(
libraryDependencies ++= Seq(
"org.bouncycastle" % "bcprov-jdk15to18" % "1.66"
),
scalaVersion := scala213,
crossScalaVersions := Seq(scala211, scala212, scala213)
)
lazy val scryptoJS = scrypto.js
.enablePlugins(ScalaJSBundlerPlugin)
.enablePlugins(ScalablyTypedConverterGenSourcePlugin)
.settings(
scalaVersion := scala213,
crossScalaVersions := Seq(scala213),
libraryDependencies ++= Seq(
"org.scala-js" %%% "scala-js-macrotask-executor" % "1.0.0",
("org.scala-js" %%% "scalajs-java-securerandom" % "1.0.0").cross(CrossVersion.for3Use2_13)
),
Test / parallelExecution := false,
// how to setup ScalablyTyped https://scalablytyped.org/docs/library-developer
stOutputPackage := "scorex",
Compile / npmDependencies ++= Seq(
"@noble/hashes" -> "1.1.4"
),
useYarn := false
)
lazy val benchmarks = project
.in(file("benchmarks"))
.dependsOn(scrypto.jvm)
.settings(
moduleName := "scrypto-benchmarks",
crossScalaVersions := Seq(scala211, scala212, scala213),
scalaVersion := scala213,
)
.enablePlugins(JmhPlugin)
.settings(noPublishSettings)
def javacReleaseOption = {
if (System.getProperty("java.version").startsWith("1."))
// java <9 "--release" is not supported
Seq()
else
Seq("--release", "8")
}
credentials ++= (for {
username <- Option(System.getenv().get("SONATYPE_USERNAME"))
password <- Option(System.getenv().get("SONATYPE_PASSWORD"))
} yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", username, password)).toSeq
// prefix version with "-SNAPSHOT" for builds without a git tag
ThisBuild / dynverSonatypeSnapshots := true
// use "-" instead of default "+"
ThisBuild / dynverSeparator := "-"
// PGP key for signing a release build published to sonatype
// signing is done by sbt-pgp plugin
// how to generate a key - https://central.sonatype.org/pages/working-with-pgp-signatures.html
// how to export a key see ci/import_gpg.sh
pgpPublicRing := file("ci/pubring.asc")
pgpSecretRing := file("ci/secring.asc")
pgpPassphrase := sys.env.get("PGP_PASSPHRASE").map(_.toArray)
usePgpKeyHex("AA4F785C04B9DCCDD5332FB1329014D11A57FA1A")