-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
120 lines (113 loc) · 4 KB
/
build.sbt
File metadata and controls
120 lines (113 loc) · 4 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
113
114
115
116
117
118
119
120
lazy val commonSettings = Seq(
organization := "nl.codestar",
homepage := Some(url("https://github.com/code-star/sbt-azure-functions-plugin")),
// version is set by sbt-dynver plugin (included through sbt-ci-release)
description := "SBT Plugin to generate function.json artefacts needed to publish code as an Azure Function",
organization := "nl.codestar",
organizationName := "Codestar powered by Sopra Steria",
organizationHomepage := Some(url("https://codestar.nl")),
homepage := Some(url("https://codestar.nl/sbt-azure-functions-plugin")),
licenses += ("MIT", url("https://opensource.org/licenses/MIT")),
developers := List(
Developer(
"jeanmarc",
"Jean-Marc van Leerdam",
"jean-marc.vanleerdam@soprasteria.com",
url("https://soprasteria.com")
)
),
scmInfo := Some(
ScmInfo(
url("https://github.com/code-star/sbt-azure-functions-plugin"),"scm:git@github.com:code-star/sbt-azure-functions-plugin.git")
),
credentials ++= Seq(
Credentials(
"GnuPG Key ID",
"gpg",
System.getenv("PGP_ID"), // key identifier
"ignored" // this field is ignored; passwords are supplied by pinentry
),
Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
System.getenv("SONATYPE_USERNAME"),
System.getenv("SONATYPE_PASSWORD") // Use environment variable for security
),
Credentials(
"Sonatype Nexus Repository Manager",
"central.sonatype.com",
System.getenv("SONATYPE_USERNAME"),
System.getenv("SONATYPE_PASSWORD") // Use environment variable for security
),
Credentials(
"central-snapshots",
"central.sonatype.com",
System.getenv("SONATYPE_USERNAME"),
System.getenv("SONATYPE_PASSWORD") // Use environment variable for security
)
)
)
lazy val root = project.in(file("."))
.aggregate(plugin)
.settings(
name := "sbt-azure-functions-plugin",
commonSettings,
// the root project should not produce any artifacts
publishArtifact := false,
publish := {},
sonaDeploymentName := {
val o = organization.value
val n = "sbt-azure-functions"
val v = version.value
val dt = java.time.LocalDateTime.now.format(java.time.format.DateTimeFormatter.ofPattern("yyyyMMdd_HHmmss"))
s"$o:$n:$v:$dt"
},
)
lazy val plugin = project.in(file("plugin"))
.enablePlugins(SbtPlugin)
.settings(
name := "sbt-azure-functions",
commonSettings,
scalaVersion := "2.12.18",
pluginCrossBuild / sbtVersion := {
scalaBinaryVersion.value match {
case "2.12" => "1.11.4" // set minimum version
}
},
scalacOptions ++= Seq(
"-encoding",
"UTF8",
"-Xfatal-warnings",
"-deprecation",
"-feature",
"-unchecked",
"-Xlint",
"-Ywarn-dead-code",
"-Ywarn-adapted-args"
),
libraryDependencies ++= Seq(
"com.fasterxml.jackson.core" % "jackson-databind" % "2.19.2",
"com.microsoft.azure" % "azure-tools-common" % "0.14.0",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
"com.microsoft.azure.functions" % "azure-functions-java-library" % "3.1.0" % "test",
"org.scalatest" %% "scalatest" % "3.2.19" % "test",
"org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
),
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.1"),
scriptedLaunchOpts := {
scriptedLaunchOpts.value ++
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
},
scriptedBufferLog := false,
Test / logBuffered := false,
Test / publishArtifact := false
)
// workaround for interactive sessions that do not echo the user input (https://github.com/sbt/sbt-bintray/issues/177)
ThisBuild / useSuperShell := false
ThisBuild / pomIncludeRepository := { _ => false }
ThisBuild / publishMavenStyle := true
ThisBuild / publishTo := {
val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/"
if (isSnapshot.value) Some("central-snapshots" at centralSnapshots)
else localStaging.value
}