-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
99 lines (84 loc) · 3.42 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
import sbtghactions.GenerativePlugin.autoImport.WorkflowStep
val baseRepo = "ldeluigi/untitled-goose-framework"
inThisBuild(List(
name := "untitled-goose-framework",
organization := "com.github.ldeluigi",
homepage := Some(url("https://github.com/" + baseRepo)),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer(
"ldeluigi",
"Luca Deluigi",
url("https://github.com/ldeluigi")
)
),
githubWorkflowBuild := Seq(
WorkflowStep.Sbt(List("test"))
),
githubWorkflowPublishPreamble ++= Seq(
WorkflowStep.Run(List(
"""VERSION=`sbt -Dsbt.ci=true 'inspect actual version' | grep "Setting: java.lang.String" | cut -d '=' -f2 | tr -d ' '`""",
"""echo "VERSION=${VERSION}" >> $GITHUB_ENV""",
"""IS_SNAPSHOT=`if [[ "${VERSION}" =~ "-" ]] ; then echo "true" ; else echo "false" ; fi`""",
"""echo "IS_SNAPSHOT=${IS_SNAPSHOT}" >> $GITHUB_ENV""",
),
name = Some("Setup environment variables")),
WorkflowStep.Use("olafurpg", "setup-gpg", "v2"),
),
githubWorkflowPublish := Seq(
WorkflowStep.Sbt(
List("ci-release"),
name = Some("Release to Sonatype"),
env = Map(
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}",
"CI_CLEAN" -> "sonatypeBundleClean"
)
),
WorkflowStep.Use(
"marvinpinto", "action-automatic-releases", "latest",
name = Some("Release to Github Releases"),
params = Map(
"repo_token" -> "${{ secrets.GITHUB_TOKEN }}",
"prerelease" -> "${{ env.IS_SNAPSHOT }}",
"title" -> """Release - Version ${{ env.VERSION }}""",
"files" -> "target/scala-2.12/*.jar\ntarget/scala-2.12/*.pom"
)
),
),
githubWorkflowTargetTags ++= Seq("v*"),
githubWorkflowPublishTargetBranches :=
Seq(RefPredicate.StartsWith(Ref.Tag("v"))),
githubWorkflowPublishCond := Some("github.repository == '" + baseRepo + "'")
))
ThisBuild / scalaVersion := "2.12.10"
//ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest", "macos-latest", "windows-latest")
ThisBuild / resolvers += "Local Ivy Repository" at "file:///" + Path.userHome.absolutePath + "/.ivy2/local"
// Add dependency on ScalaFX library
ThisBuild / libraryDependencies += "org.scalafx" %% "scalafx" % "14-R19"
// Add dependency on Vert.x library
ThisBuild / libraryDependencies += "io.vertx" %% "vertx-lang-scala" % "3.9.1"
// Test dependencies
ThisBuild / libraryDependencies += "org.scalactic" %% "scalactic" % "3.2.0"
ThisBuild / libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.0" % "test"
ThisBuild / scalacOptions ++= {
Seq(
"-language:postfixOps",
"-language:implicitConversions"
)
}
// Determine OS version of JavaFX binaries
lazy val osName = System.getProperty("os.name") match {
case n if n.startsWith("Linux") => "linux"
case n if n.startsWith("Mac") => "mac"
case n if n.startsWith("Windows") => "win"
case _ => throw new Exception("Unknown platform!")
}
// Add dependency on JavaFX libraries, OS dependent
lazy val javaFXModules = Seq("base", "controls", "fxml", "graphics", "media", "swing", "web")
ThisBuild / libraryDependencies ++= javaFXModules.map(m =>
"org.openjfx" % s"javafx-$m" % "14.0.1" classifier osName
)