Skip to content

Commit 772d2b3

Browse files
committed
Merge remote-tracking branch 'origin/master' into mergeable-repo-configurations
2 parents e79b8bc + 12cad61 commit 772d2b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1023
-461
lines changed

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 2.5.3
1+
version = 2.6.4
22
assumeStandardLibraryStripMargin = true
33
align.openParenCallSite = false
44
align.openParenDefnSite = false

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dist: xenial
66

77
scala:
88
- 2.13.2
9+
- 2.12.10
910

1011
jdk:
1112
- openjdk8
@@ -26,7 +27,7 @@ jobs:
2627
include:
2728
- stage: release
2829
jdk: openjdk8
29-
script: docker login -u $DOCKER_USER -p $DOCKER_PASS && sbt docker:publish
30+
script: docker login -u $DOCKER_USER -p $DOCKER_PASS && sbt core/docker:publish
3031
name: docker
3132
- script: sbt ci-release
3233
name: jar
@@ -55,7 +56,7 @@ after_success:
5556
notifications:
5657
webhooks:
5758
urls:
58-
- https://webhooks.gitter.im/e/0c488817d5dc313a8cc7
59+
- https://webhooks.gitter.im/e/423a40e87e9aec4665dc
5960
on_success: change
6061
on_failure: always
6162
on_start: never

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
</p>
44

55
# Scala Steward
6-
[![Build Status](https://travis-ci.com/fthomas/scala-steward.svg?branch=master)](https://travis-ci.com/fthomas/scala-steward)
7-
[![codecov](https://codecov.io/gh/fthomas/scala-steward/branch/master/graph/badge.svg)](https://codecov.io/gh/fthomas/scala-steward)
8-
[![Join the chat at https://gitter.im/fthomas/scala-steward](https://badges.gitter.im/fthomas/scala-steward.svg)](https://gitter.im/fthomas/scala-steward?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6+
[![Build Status](https://travis-ci.com/scala-steward-org/scala-steward.svg?branch=master)](https://travis-ci.com/scala-steward-org/scala-steward)
7+
[![codecov](https://codecov.io/gh/scala-steward-org/scala-steward/branch/master/graph/badge.svg)](https://codecov.io/gh/scala-steward-org/scala-steward)
8+
[![Join the chat at https://gitter.im/scala-steward-org/scala-steward](https://badges.gitter.im/scala-steward-org/scala-steward.svg)](https://gitter.im/scala-steward-org/scala-steward?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
99
[![Follow @ScalaSteward on Twitter](https://img.shields.io/twitter/follow/ScalaSteward.svg?logo=twitter&style=flat&color=blue)](https://twitter.com/ScalaSteward)
1010
[![Typelevel project](https://img.shields.io/badge/typelevel-project-blue.svg)](https://typelevel.org/projects/#scala-steward)
1111
[![Scala Steward badge](https://img.shields.io/badge/Scala_Steward-helping-blue.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAMAAAARSr4IAAAAVFBMVEUAAACHjojlOy5NWlrKzcYRKjGFjIbp293YycuLa3pYY2LSqql4f3pCUFTgSjNodYRmcXUsPD/NTTbjRS+2jomhgnzNc223cGvZS0HaSD0XLjbaSjElhIr+AAAAAXRSTlMAQObYZgAAAHlJREFUCNdNyosOwyAIhWHAQS1Vt7a77/3fcxxdmv0xwmckutAR1nkm4ggbyEcg/wWmlGLDAA3oL50xi6fk5ffZ3E2E3QfZDCcCN2YtbEWZt+Drc6u6rlqv7Uk0LdKqqr5rk2UCRXOk0vmQKGfc94nOJyQjouF9H/wCc9gECEYfONoAAAAASUVORK5CYII=)](https://scala-steward.org)
@@ -70,15 +70,19 @@ Thanks goes to these wonderful people for contributing to Scala Steward:
7070
* [Anil Kumar Myla](https://github.com/anilkumarmyla)
7171
* [Arjun Dhawan](https://github.com/arjun-1)
7272
* [Arulselvan Madhavan](https://github.com/ArulselvanMadhavan)
73+
* [Barry O'Neill](https://github.com/barryoneill)
7374
* [Bayram Kiran](https://github.com/kiranbayram)
75+
* [Brice Jaglin](https://github.com/bjaglin)
7476
* [Cédric Chantepie](https://github.com/cchantep)
7577
* [Christopher Davenport](https://github.com/ChristopherDavenport)
7678
* [Dale Wijnand](https://github.com/dwijnand)
7779
* [Daniel Pfeiffer](https://github.com/dpfeiffer)
7880
* [David Francoeur](https://github.com/daddykotex)
81+
* [Doug Roper](https://github.com/htmldoug)
7982
* [Eldar Yusupov](https://github.com/eyusupov)
8083
* [Erik Erlandson](https://github.com/erikerlandson)
8184
* [Erlend Hamnaberg](https://github.com/hamnis)
85+
* [eugeniyk](https://github.com/eugeniyk)
8286
* [Fabian](https://github.com/fg-devs)
8387
* [Felix Dietze](https://github.com/fdietze)
8488
* [Filipe Regadas](https://github.com/regadas)
@@ -91,6 +95,7 @@ Thanks goes to these wonderful people for contributing to Scala Steward:
9195
* [JCollier](https://github.com/Slakah)
9296
* [Jeff Martin](https://github.com/custommonkey)
9397
* [Jichao Ouyang](https://github.com/jcouyang)
98+
* [Joan Goyeau](https://github.com/joan38)
9499
* [José Eduardo Montenegro Cavalcanti de Oliveira](https://github.com/edumco)
95100
* [kalejami](https://github.com/kalejami)
96101
* [KAWACHI Takashi](https://github.com/tkawachi)
@@ -127,13 +132,16 @@ Using Scala Steward in your company and don't see it listed here?
127132
Consider creating PR to add your company to the list and join the community.
128133

129134
* [Adform](https://site.adform.com/)
135+
* [Agoda](https://agoda.com/)
130136
* [AutoScout24](https://www.autoscout24.de/)
131137
* [Avast](https://avast.com)
138+
* [Babylon Health](https://www.babylonhealth.com/)
132139
* [Besedo](https://www.besedo.com/)
133140
* [Bitrock](http://www.bitrock.it/)
134141
* [Chartboost](https://www.chartboost.com/)
135142
* [Colisweb](https://www.colisweb.com/)
136143
* [commercetools](https://docs.commercetools.com/)
144+
* [Enliven Systems](https://enliven.systems)
137145
* [Evolution Gaming](https://www.evolutiongaming.com/)
138146
* [Firstbird](https://firstbird.com)
139147
* [Hellosoda](https://hellosoda.com/)

build.sbt

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@ import sbtcrossproject.{CrossProject, CrossType, Platform}
66
val groupId = "org.scala-steward"
77
val projectName = "scala-steward"
88
val rootPkg = groupId.replace("-", "")
9-
val gitHubOwner = "fthomas"
9+
val gitHubOwner = "scala-steward-org"
1010

1111
val moduleCrossPlatformMatrix: Map[String, List[Platform]] = Map(
1212
"core" -> List(JVMPlatform),
13-
"plugin" -> List(JVMPlatform)
13+
"sbt-plugin" -> List(JVMPlatform),
14+
"mill-plugin" -> List(JVMPlatform)
1415
)
1516

17+
val Scala212 = "2.12.10"
18+
val Scala213 = "2.13.2"
19+
1620
/// projects
1721

1822
lazy val root = project
1923
.in(file("."))
20-
.aggregate(core.jvm, plugin.jvm)
24+
.aggregate(core.jvm, `sbt-plugin`.jvm, `mill-plugin`.jvm)
2125
.settings(commonSettings)
2226
.settings(noPublishSettings)
2327

@@ -51,7 +55,7 @@ lazy val core = myCrossProject("core")
5155
Dependencies.scalacacheCaffeine,
5256
Dependencies.scalacacheCatsEffect,
5357
Dependencies.logbackClassic % Runtime,
54-
Dependencies.catsKernelLaws % Test,
58+
Dependencies.catsLaws % Test,
5559
Dependencies.circeLiteral % Test,
5660
Dependencies.disciplineScalatest % Test,
5761
Dependencies.http4sDsl % Test,
@@ -80,11 +84,21 @@ lazy val core = myCrossProject("core")
8084
}
8185
},
8286
buildInfoKeys := Seq[BuildInfoKey](
87+
organization,
8388
version,
8489
scalaVersion,
8590
scalaBinaryVersion,
8691
sbtVersion,
87-
BuildInfoKey.map(git.gitHeadCommit) { case (k, v) => k -> v.getOrElse("master") }
92+
BuildInfoKey.map(git.gitHeadCommit) { case (k, v) => k -> v.getOrElse("master") },
93+
BuildInfoKey.map(`sbt-plugin`.jvm / moduleRootPkg) {
94+
case (_, v) => "sbtPluginModuleRootPkg" -> v
95+
},
96+
BuildInfoKey.map(`mill-plugin`.jvm / moduleName) {
97+
case (_, v) => "millPluginModuleName" -> v
98+
},
99+
BuildInfoKey.map(`mill-plugin`.jvm / moduleRootPkg) {
100+
case (_, v) => "millPluginModuleRootPkg" -> v
101+
}
88102
),
89103
buildInfoPackage := moduleRootPkg.value,
90104
initialCommands += s"""
@@ -109,17 +123,23 @@ lazy val core = myCrossProject("core")
109123
""",
110124
fork in run := true,
111125
fork in Test := true,
112-
Compile / unmanagedResourceDirectories ++= (plugin.jvm / Compile / unmanagedSourceDirectories).value
126+
Compile / unmanagedResourceDirectories ++= (`sbt-plugin`.jvm / Compile / unmanagedSourceDirectories).value
113127
)
114128

115-
lazy val plugin = myCrossProject("plugin")
129+
lazy val `sbt-plugin` = myCrossProject("sbt-plugin")
116130
.settings(noPublishSettings)
117131
.settings(
118-
scalaVersion := "2.12.11",
132+
scalaVersion := Scala212,
119133
sbtPlugin := true,
120134
Compile / compile / wartremoverErrors -= Wart.Equals
121135
)
122136

137+
lazy val `mill-plugin` = myCrossProject("mill-plugin")
138+
.settings(
139+
crossScalaVersions := Seq(Scala213, Scala212),
140+
libraryDependencies += Dependencies.mill.value % Provided
141+
)
142+
123143
/// settings
124144

125145
def myCrossProject(name: String): CrossProject =
@@ -129,7 +149,7 @@ def myCrossProject(name: String): CrossProject =
129149
.in(file(s"modules/$name"))
130150
.settings(
131151
moduleName := s"$projectName-$name",
132-
moduleRootPkg := s"$rootPkg.$name"
152+
moduleRootPkg := s"$rootPkg.${name.replace('-', '.')}"
133153
)
134154
.settings(commonSettings)
135155
// workaround for https://github.com/portable-scala/sbt-crossproject/issues/74
@@ -151,6 +171,7 @@ lazy val commonSettings = Def.settings(
151171
)
152172

153173
lazy val compileSettings = Def.settings(
174+
scalaVersion := Scala213,
154175
doctestTestFramework := DoctestTestFramework.ScalaCheck,
155176
wartremoverErrors ++= Seq(Wart.TraversableOps),
156177
Compile / compile / wartremoverErrors ++= Seq(Wart.Equals)
@@ -177,20 +198,23 @@ lazy val metadataSettings = Def.settings(
177198
)
178199

179200
lazy val dockerSettings = Def.settings(
180-
dockerBaseImage := Option(System.getenv("DOCKER_BASE_IMAGE")).getOrElse("openjdk:8-jre-alpine"),
201+
dockerBaseImage := Option(System.getenv("DOCKER_BASE_IMAGE")).getOrElse("openjdk:8-jdk-alpine"),
181202
dockerCommands ++= {
182203
val getSbtVersion = sbtVersion.value
183204
val sbtTgz = s"sbt-$getSbtVersion.tgz"
184205
val sbtUrl = s"https://github.com/sbt/sbt/releases/download/v$getSbtVersion/$sbtTgz"
206+
val millVersion = Dependencies.mill.value.revision
185207
Seq(
186208
Cmd("USER", "root"),
209+
Cmd("RUN", "apk --no-cache add bash git ca-certificates curl maven"),
210+
Cmd("RUN", s"wget $sbtUrl && tar -xf $sbtTgz && rm -f $sbtTgz"),
187211
Cmd(
188212
"RUN",
189-
s"apk --no-cache add bash git ca-certificates maven && wget $sbtUrl && tar -xf $sbtTgz && rm -f $sbtTgz"
213+
s"curl -L https://github.com/lihaoyi/mill/releases/download/$millVersion/$millVersion > /usr/local/bin/mill && chmod +x /usr/local/bin/mill"
190214
)
191215
)
192216
},
193-
Docker / packageName := s"${gitHubOwner}/${name.value}",
217+
Docker / packageName := s"fthomas/${name.value}",
194218
dockerUpdateLatest := true,
195219
dockerEntrypoint += "--disable-sandbox",
196220
dockerEnvVars := Map("PATH" -> "/opt/docker/sbt/bin:${PATH}")
@@ -218,7 +242,7 @@ lazy val scaladocSettings = Def.settings(
218242
lazy val installPlugin = taskKey[Unit]("Copies StewardPlugin.scala into global plugins directory.")
219243
installPlugin := {
220244
val name = "StewardPlugin.scala"
221-
val source = (plugin.jvm / Compile / sources).value.find(_.name == name).get
245+
val source = (`sbt-plugin`.jvm / Compile / sources).value.find(_.name == name).get
222246
val target = file(System.getProperty("user.home")) / ".sbt" / "1.0" / "plugins" / name
223247
IO.copyFile(source, target)
224248
}
@@ -236,7 +260,7 @@ runSteward := Def.taskDyn {
236260
val args = Seq(
237261
Seq("--workspace", s"$projectDir/workspace"),
238262
Seq("--repos-file", s"$projectDir/repos.md"),
239-
Seq("--default-repo-config", s"$projectDir/default.scala-steward.conf"),
263+
Seq("--default-repo-conf", s"$projectDir/default.scala-steward.conf"),
240264
Seq("--git-author-email", s"me@$projectName.org"),
241265
Seq("--vcs-login", projectName),
242266
Seq("--git-ask-pass", s"$home/.github/askpass/$projectName.sh"),

docs/running.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ The [`git-ask-pass` option](https://git-scm.com/docs/gitcredentials) must specif
4545
You can also provide a `--scalafix-migrations` option with the path to a file containing scalafix migrations.
4646
More information can be found [here][migrations]
4747

48+
### Workspace
49+
50+
The workspace directory (specified with `--workspace`) provides a location for cache and temporary files.
51+
52+
It is important to persist this workspace between runs. Without this, Scala Steward will be unable to observe
53+
repo-specific preferences (such as [pullRequests.frequency](repo-specific-configuration.md)) correctly.
54+
4855
### Private repositories
4956

5057
If you run Scala Steward for your own private projects, the option `--do-not-fork` can be required, not to fork.
@@ -66,6 +73,15 @@ These variables will be accessible (in sbt) to all of the projects that Scala St
6673
If your projects require credentials, you can also provide global credentials in the `$HOME/.sbt/1.0/credentials.sbt` file.
6774
The file should contain a single line: `credentials += Credentials("Some Nexus Repository Manager", "my.artifact.repo.net", "admin", "admin123")`.
6875

76+
#### sbt 0.13 workaround
77+
For sbt 0.13 builds, scala-steward [may be unable](https://gitter.im/fthomas/scala-steward?at=5f0573dac7d15f7d0f7b15ac) to extract credentials for private resolvers. Instead, you can [configure coursier directly](https://get-coursier.io/docs/other-credentials) by adding `~/.config/coursier/credentials.properties`:
78+
```scala
79+
example1.username=username
80+
example1.password=password
81+
example1.host=artifacts.example.com
82+
example1.realm=Example Realm
83+
```
84+
6985
### Running locally from sbt
7086

7187
#### Sample run for Gitlab

modules/core/src/main/resources/scalafix-migrations.conf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,26 @@ migrations = [
2929
newVersion: "0.8.0",
3030
rewriteRules: ["github:spotify/scio/MigrateV0_8?sha=v0.8.0"]
3131
},
32+
{
33+
groupId: "com.twilio",
34+
artifactIds: ["sbt-guardrail"],
35+
newVersion: "0.59.0.1",
36+
rewriteRules: ["https://raw.githubusercontent.com/blast-hardcheese/guardrail-scalafix-rules/master/rules/src/main/scala/fix/GuardrailScalaResponseTypes.scala"],
37+
doc: "https://github.com/twilio/guardrail/blob/master/MIGRATING.md#0590-may-contain-type-and-package-naming-changes-that-will-require-changes-in-consuming-code"
38+
},
3239
{
3340
groupId: "dev.zio",
3441
artifactIds: ["zio-test"],
3542
newVersion: "1.0.0-RC18",
3643
rewriteRules: ["github:zio/zio/CurriedAssert"]
3744
},
45+
{
46+
groupId: "org.http4s",
47+
artifactIds: ["http4s-.*"],
48+
newVersion: "0.21.5",
49+
rewriteRules: ["dependency:[email protected]:http4s-scalafix:0.21.5"],
50+
doc: "https://github.com/http4s/http4s/releases/tag/v0.21.5"
51+
},
3852
{
3953
groupId: "org.http4s",
4054
artifactIds: ["http4s-.*"],
@@ -75,5 +89,12 @@ migrations = [
7589
newVersion: "0.11.0",
7690
rewriteRules: ["https://gist.githubusercontent.com/REDNBLACK/9bc56ad71e4b01a63001339fa61b4cfd/raw/5f1cd32713c3235a83fe2d1d182bd71a001ef464/derevo-v0.11.0.scala"],
7791
doc: "https://github.com/manatki/derevo/blob/0.11.3/README.md#breaking-changes-in-011"
92+
},
93+
{
94+
groupId: "com.typesafe.akka",
95+
artifactIds: ["akka-http.*"],
96+
newVersion: "10.2.0",
97+
rewriteRules: ["dependency:[email protected]:akka-http-scalafix-rules:10.2.0"],
98+
doc: "https://doc.akka.io/docs/akka-http/10.2/migration-guide/migration-guide-10.2.x.html#akka-http-10-1-x-10-2-0"
7899
}
79100
]

modules/core/src/main/scala/org/scalasteward/core/application/Cli.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ object Cli {
3737
final case class Args(
3838
workspace: String,
3939
reposFile: String,
40-
defaultRepoConf: String = "default.scala-steward.conf",
40+
defaultRepoConf: Option[String] = None,
4141
gitAuthorName: String = "Scala Steward",
4242
gitAuthorEmail: String,
4343
vcsType: SupportedVCS = SupportedVCS.GitHub,

modules/core/src/main/scala/org/scalasteward/core/application/Config.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import scala.sys.process.Process
5454
final case class Config(
5555
workspace: File,
5656
reposFile: File,
57-
defaultRepoConfigFile: File,
57+
defaultRepoConfigFile: Option[File],
5858
gitAuthor: Author,
5959
vcsType: SupportedVCS,
6060
vcsApiHost: Uri,
@@ -90,7 +90,7 @@ object Config {
9090
Config(
9191
workspace = args.workspace.toFile,
9292
reposFile = args.reposFile.toFile,
93-
defaultRepoConfigFile = args.defaultRepoConf.toFile,
93+
defaultRepoConfigFile = args.defaultRepoConf.map(_.toFile),
9494
gitAuthor = Author(args.gitAuthorName, args.gitAuthorEmail),
9595
vcsType = args.vcsType,
9696
vcsApiHost = args.vcsApiHost,

modules/core/src/main/scala/org/scalasteward/core/application/Context.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import org.http4s.client.Client
2424
import org.http4s.client.asynchttpclient.AsyncHttpClient
2525
import org.scalasteward.core.buildtool.BuildToolDispatcher
2626
import org.scalasteward.core.buildtool.maven.MavenAlg
27+
import org.scalasteward.core.buildtool.mill.MillAlg
2728
import org.scalasteward.core.buildtool.sbt.SbtAlg
2829
import org.scalasteward.core.coursier.{CoursierAlg, VersionsCache}
2930
import org.scalasteward.core.edit.EditAlg
@@ -83,6 +84,7 @@ object Context {
8384
implicit val updateAlg: UpdateAlg[F] = new UpdateAlg[F]
8485
implicit val mavenAlg: MavenAlg[F] = MavenAlg.create[F]
8586
implicit val sbtAlg: SbtAlg[F] = SbtAlg.create[F]
87+
implicit val millAlg: MillAlg[F] = MillAlg.create[F]
8688
implicit val buildToolDispatcher: BuildToolDispatcher[F] = BuildToolDispatcher.create[F]
8789
implicit val refreshErrorAlg: RefreshErrorAlg[F] =
8890
new RefreshErrorAlg[F](new JsonKeyValueStore("refresh_error", "1", kvsPrefix))

0 commit comments

Comments
 (0)