-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sbt
92 lines (89 loc) · 3.17 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
import sbt.Keys.{pomIncludeRepository, publishMavenStyle, publishTo}
lazy val root = (project in file("."))
.enablePlugins(SbtPlugin, SemVerPlugin)
.settings(
name := "shelm",
homepage := Some(url("https://github.com/kiemlicz/shelm")),
organization := "io.github.kiemlicz",
organizationHomepage := Some(url("https://github.com/kiemlicz")),
description := "Simple Helm plugin for creating Helm Charts",
licenses += "The MIT License" -> url("https://opensource.org/licenses/MIT"),
developers := List(
Developer(
id = "kiemlicz",
name = "Stanley",
email = "stanislaw.dev@gmail.com",
url = url("https://github.com/kiemlicz")
)
),
javacOptions ++= Seq("-source", "17"),
//don't specify scalaVersion for plugins (sbt is built for Scala 2.12 only)
scalacOptions ++= Seq(
"-encoding", "utf8",
"-deprecation",
"-unchecked",
"-Xlint",
"-feature",
"-language:postfixOps",
"-Xfatal-warnings",
"-Xsource:3"
),
resolvers += "Sonatype releases".at("https://oss.sonatype.org/content/repositories/releases/"),
libraryDependencies ++= Seq(
"io.circe" %% "circe-yaml" % "0.14.2",
"io.circe" %% "circe-parser" % "0.14.2",
"org.apache.commons" % "commons-compress" % "1.21",
"commons-io" % "commons-io" % "2.7",
"org.scalatest" %% "scalatest" % "3.2.10" % "test"
),
scriptedLaunchOpts := scriptedLaunchOpts.value ++ Seq("-Xmx1024M", "-Dplugin.version=" + version.value),
scriptedBufferLog := true,
scriptedBatchExecution := true,
scriptedParallelInstances := java.lang.Runtime.getRuntime.availableProcessors(),
// useCoursier:=false, //https://youtrack.jetbrains.com/issue/SCL-17825
)
.settings(mavenCentralSettings())
def mavenCentralSettings(): Seq[Def.Setting[_]] = {
val shelmRepoUrl = "https://github.com/kiemlicz/shelm"
val sonatypeHost = "s01.oss.sonatype.org"
Seq(
credentials += sys.env
.get("MVN_PASSWORD")
.map(password =>
Credentials(
"Sonatype Nexus Repository Manager",
sonatypeHost,
"kiemlicz",
password,
)
),
pgpSigningKey := sys.env.get("PGP_KEY_ID"),
publishTo := sonatypePublishTo.value,
sonatypeCredentialHost := sonatypeHost,
pomIncludeRepository := (_ => false),
publishMavenStyle := true,
scmInfo := Some(ScmInfo(url(shelmRepoUrl), s"scm:https://github.com/kiemlicz/${name.value}.git"))
)
}
def githubSettings(): Seq[Def.Setting[_]] = {
//Dedicated access token must be provided for every user of this package
val ghRepoUrl: String = s"https://maven.pkg.github.com/kiemlicz/shelm"
val ghRepo: MavenRepository = "GitHub Package Registry".at(ghRepoUrl)
Seq(
credentials += sys.env
.get("GITHUB_TOKEN")
.map(token =>
Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"_",
token,
)
),
publishTo := Some(ghRepo),
pomIncludeRepository := (_ => false),
publishMavenStyle := true,
resolvers ++= Seq(ghRepo),
scmInfo := Some(ScmInfo(url(ghRepoUrl), s"scm:git@github.com:kiemlicz/${name.value}.git"))
)
}