Skip to content

Commit 5bc44e0

Browse files
authored
Merge branch '2.x' into provide-keys-though-autoimport
2 parents 33831d1 + 589743b commit 5bc44e0

File tree

4 files changed

+26
-33
lines changed

4 files changed

+26
-33
lines changed

CODE_OF_CONDUCT.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
all repositories in these organizations:
2+
3+
* [scala](https://github.com/scala)
4+
* [scalacenter](https://github.com/scalacenter)
5+
* [lampepfl](https://github.com/lampepfl)
6+
7+
are covered by the Scala Code of Conduct: https://scala-lang.org/conduct/

README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Scala modules sbt plugin
22

3-
This is an sbt plugin for building Scala modules.
3+
This is an sbt 1.x plugin for building Scala modules.
44

55
## What modules use it?
66

@@ -24,15 +24,6 @@ release is made by pushing a tag to GitHub. Travis-CI then stages
2424
artifacts on Sonatype. Pressing "Close" and "Release" in the Sonatype
2525
web UI will then send the artifacts to Maven Central.
2626

27-
## Branches and versions
28-
29-
The main development branch is 2.x; only sbt 1 is supported there.
30-
31-
sbt 0.13 support is on the legacy 1.x branch.
32-
33-
Scala modules are encouraged to move to sbt 1 on their primary
34-
development branches as soon as reasonably possible.
35-
3627
## Usage
3728

3829
Add the plugin to the `project/plugins.sbt` file:
@@ -59,7 +50,7 @@ version := "<module version>"
5950
scalaVersionsByJvm in ThisBuild := {
6051
val v211 = "2.11.12"
6152
val v212 = "2.12.8"
62-
val v213 = "2.13.0-M5"
53+
val v213 = "2.13.0-RC1"
6354
// Map[JvmMajorVersion, List[(ScalaVersion, UseForPublishing)]]
6455
Map(
6556
8 -> List(v211 -> true, v212 -> true, v213 -> true),
@@ -98,7 +89,7 @@ Tag the release and add release notes to https://github.com/scala/sbt-scala-modu
9889
- Make sure the current `HEAD` is a tagged revision. In sbt, `version` (set by sbt-git) should be according to a tag.
9990

10091
> version
101-
[info] 1.0.13
92+
[info] 2.3.4
10293

10394
- Run `publish` in sbt. If you don't have a `~/.bintray/.credentials` file, the sbt-bintray plugin will ask you for your
10495
username and API key. The API key can be obtained under "Edit Profile" (https://bintray.com/profile/edit). The sbt-bintray
@@ -110,4 +101,4 @@ Tag the release and add release notes to https://github.com/scala/sbt-scala-modu
110101
- Search for your plugin (`sbt-scala-module`)
111102
- Click "Send" to send the request
112103

113-
The above instructions are a short version of http://www.scala-sbt.org/0.13/docs/Bintray-For-Plugins.html.
104+
The above instructions are a short version of https://www.scala-sbt.org/1.x/docs/Bintray-For-Plugins.html.

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")
2-
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4")
2+
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.5")

src/main/scala/ScalaModulePlugin.scala

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,8 @@ object ScalaModulePlugin extends AutoPlugin {
162162
val moduleId = ModuleID(organization, s"${name}_$scalaBinaryVersion", version)
163163
val depRes = IvyDependencyResolution(ivy.configuration)
164164
val module = depRes.wrapDependencyInModule(moduleId)
165-
val reportEither = depRes.update(
166-
module,
167-
UpdateConfiguration() withLogging UpdateLogging.DownloadOnly,
168-
UnresolvedWarningConfiguration(),
169-
s.log
170-
)
165+
val updateConf = UpdateConfiguration() withLogging UpdateLogging.DownloadOnly
166+
val reportEither = depRes.update(module, updateConf, UnresolvedWarningConfiguration(), s.log)
171167
reportEither.fold(_ => false, _ => true)
172168
}
173169

@@ -179,25 +175,24 @@ object ScalaModulePlugin extends AutoPlugin {
179175
scalaModuleMimaPreviousVersion := None,
180176

181177
// We're not using `%%` here in order to support both jvm and js projects (cross version `_2.12` / `_sjs0.6_2.12`)
182-
mimaPreviousArtifacts := Set(organization.value % moduleName.value % scalaModuleMimaPreviousVersion.value.getOrElse("dummy") cross crossVersion.value),
178+
mimaPreviousArtifacts := mimaPreviousVersion.value.map(v => organization.value % moduleName.value % v cross crossVersion.value).toSet,
183179

184180
canRunMima := {
185-
val mimaVer = scalaModuleMimaPreviousVersion.value
186-
val s = streams.value
187-
val ivySbt = Keys.ivySbt.value
188-
if (mimaVer.isEmpty) {
189-
s.log.warn("MiMa will NOT run because no mimaPreviousVersion is provided.")
190-
false
191-
} else if (!artifactExists(organization.value, name.value, scalaBinaryVersion.value, mimaVer.get, ivySbt, s)) {
192-
s.log.warn(s"""MiMa will NOT run because the previous artifact "${organization.value}" % "${name.value}_${scalaBinaryVersion.value}" % "${mimaVer.get}" could not be resolved (note the binary Scala version).""")
193-
false
194-
} else {
195-
true
181+
val log = streams.value.log
182+
mimaPreviousVersion.value match {
183+
case None =>
184+
log.warn("MiMa will NOT run because no mimaPreviousVersion is provided.")
185+
false
186+
case Some(mimaVer) =>
187+
val exists = artifactExists(organization.value, name.value, scalaBinaryVersion.value, mimaVer, ivySbt.value, streams.value)
188+
if (!exists)
189+
log.warn(s"""MiMa will NOT run because the previous artifact "${organization.value}" % "${name.value}_${scalaBinaryVersion.value}" % "$mimaVer" could not be resolved (note the binary Scala version).""")
190+
exists
196191
}
197192
},
198193

199194
runMimaIfEnabled := Def.taskDyn({
200-
if(canRunMima.value) Def.task { mimaReportBinaryIssues.value }
195+
if (canRunMima.value) Def.task { mimaReportBinaryIssues.value }
201196
else Def.task { () }
202197
}).value,
203198

0 commit comments

Comments
 (0)