-
Notifications
You must be signed in to change notification settings - Fork 26
/
build.sbt
executable file
·122 lines (94 loc) · 3.55 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
//
// Copyright 2014 Groupon.com
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import ReleaseTransformations._
import com.arpnetworking.sbt.typescript.Import.TypescriptKeys._
import com.typesafe.sbt.pgp.PgpKeys.useGpg
import com.typesafe.sbt.pgp.PgpKeys.pgpPassphrase
import sbt.Keys._
import sbt.ScriptedPlugin._
sbtPlugin := true
organization := "com.arpnetworking"
name := "sbt-typescript"
scalaVersion := "2.12.12"
lazy val root = (project in file(".")).enablePlugins(SbtWeb)
libraryDependencies ++= Seq(
"org.webjars.npm" % "typescript" % "4.0.5",
"com.typesafe" % "jstranspiler" % "1.0.1"
)
resolvers ++= Seq(
Resolver.mavenLocal,
"Typesafe Releases Repository" at "https://repo.typesafe.com/typesafe/releases/",
Resolver.url("sbt snapshot plugins", url("https://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns),
Resolver.sonatypeRepo("snapshots"),
"Typesafe Snapshots Repository" at "https://repo.typesafe.com/typesafe/snapshots/"
)
addSbtPlugin("com.typesafe.sbt" %% "sbt-js-engine" % "1.2.3")
scalacOptions += "-feature"
configFile := "tsconfig.json"
includeFilter in (Assets, typescript) := GlobFilter("*.js") | GlobFilter("*.ts")
publishMavenStyle := true
resourceDirectory in Compile := baseDirectory.value / "target" / "sbt-typescript"
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
pomIncludeRepository := { _ => false}
pomExtra := (
<url>https://github.com/ArpNetworking/sbt-typescript</url>
<licenses>
<license>
<name>Apache 2</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:ArpNetworking/sbt-typescript.git</url>
<connection>scm:git:[email protected]:ArpNetworking/sbt-typescript.git</connection>
</scm>
<developers>
<developer>
<id>barp</id>
<name>Brandon Arp</name>
<url>https://www.arpnetworking.com</url>
</developer>
</developers>)
enablePlugins(SbtPlugin)
scriptedLaunchOpts += { version apply { v => s"-Dproject.version=$v" } }.value
scriptedBufferLog := false
scriptedDependencies := scriptedDependencies.dependsOn(typescript in Assets).map((u) => u).value
publish := publish.dependsOn(typescript in Assets).map((u) => u).value
publishLocal := publishLocal.dependsOn(typescript in Assets).map((u) => u).value
credentials += Credentials("Sonatype Nexus Repository Manager",
"oss.sonatype.org",
System.getenv("OSSRH_USER"),
System.getenv("OSSRH_PASS"))
useGpg := true
pgpPassphrase in Global := Option(System.getenv("GPG_PASS")).map(_.toCharArray)
sonatypeProfileName := "com.arpnetworking"
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
setNextVersion,
commitNextVersion,
pushChanges)