Replace coursier-small with coursier-interface to use the prope…#1030
Replace coursier-small with coursier-interface to use the prope…#1030olafurpg merged 7 commits intoscalameta:masterfrom
Conversation
olafurpg
left a comment
There was a problem hiding this comment.
Looks great! One small question
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
|
The test failure looks relevant We should remove all usage of coursier-small, including |
1945b34 to
8f53fe5
Compare
|
Ok, I've removed all references to coursier-small, but now there are some seemingly unrelated problems, I'm trying to work them out. |
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
| envRepos | ||
| .split("""|""") | ||
| .map(MavenRepository.of) | ||
| .toList: _* |
There was a problem hiding this comment.
This is a Java vararg method. toList:_* is fine, we can deal with 2.13 deprecations another time
79ef062 to
ed24be1
Compare
ed24be1 to
a1c7b10
Compare
tgodzik
left a comment
There was a problem hiding this comment.
Just 2 small things to fix, otherwise LGTM
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
a1c7b10 to
81a304d
Compare
|
Ok, all previous comments should be resolved, sorry for lack of responses. |
f2faccb to
83ffe1b
Compare
83ffe1b to
593a3a7
Compare
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
2e94185 to
567b7f7
Compare
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
| val regex = """([^:]+):([^:]+):([^:]+)""".r | ||
|
|
||
| dep match { | ||
| case regex(org, name, version) => |
There was a problem hiding this comment.
what if the regex doesn't match?
There was a problem hiding this comment.
It's just a test, so I wouldn't bother validating this. You can optionally log the unexpected case when the regex doesn't match
There was a problem hiding this comment.
Ok, this is not a test. Doing regex without the actual need for them is bad. Let's revert.
There was a problem hiding this comment.
Let's keep the dependencies in one like Dependency.of("foo", "bar", "baz") and either keep the regex only in the test scope or drop them altogether
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
tgodzik
left a comment
There was a problem hiding this comment.
In addition to Marek's review just a tiny additional thing.
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
| val regex = """([^:]+):([^:]+):([^:]+)""".r | ||
|
|
||
| dep match { | ||
| case regex(org, name, version) => |
There was a problem hiding this comment.
It's just a test, so I wouldn't bother validating this. You can optionally log the unexpected case when the regex doesn't match
567b7f7 to
d0dafcb
Compare
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/Embedded.scala
Outdated
Show resolved
Hide resolved
| .dropVendorSuffix(info.getScalaVersion) | ||
| val pc = Dependency.of( | ||
| s"org.scalameta", | ||
| s"mtags_$scala_version", |
There was a problem hiding this comment.
extract to mtagsVersion
There was a problem hiding this comment.
I think this is fine, we don't use it more than once and mtagsVersion would really be less clear here. It's not really mtags version, just mtags + scala version.
There was a problem hiding this comment.
It's fine to keep this as is. This is BTW the "mtags artifact name", not "mtags version"
| s"mtags_${ScalaVersions.dropVendorSuffix(info.getScalaVersion)}", | ||
| val scala_version = ScalaVersions | ||
| .dropVendorSuffix(info.getScalaVersion) | ||
| val pc = Dependency.of( |
There was a problem hiding this comment.
can we keep the call in one line like Dependency.of(a, b, c) ?
There was a problem hiding this comment.
Scalafmt keeps breaking this line.
There was a problem hiding this comment.
It's because it's too long, you would need to extract it to val compilerVersion = mtags.BuildInfo.scalaCompilerVersion. But honestly, I wouldn't bother.
There was a problem hiding this comment.
Or this is a different line - got a bit confused
tgodzik
left a comment
There was a problem hiding this comment.
Let's fix some of the things @marek1840 suggested, but other than that it should be good to merge.
1332dea to
b273c63
Compare
b273c63 to
242eeb6
Compare
olafurpg
left a comment
There was a problem hiding this comment.
A few minor comments, otherwise this PR is ready to go!
| scalac: ScalacOptionsItem | ||
| ): URLClassLoader = { | ||
| val pc = new Dependency( | ||
| val scala_version = ScalaVersions |
There was a problem hiding this comment.
nit: in Scala we use camel case instead of snake case
| val scala_version = ScalaVersions | |
| val scalaVersion = ScalaVersions |
| .dropVendorSuffix(info.getScalaVersion) | ||
| val pc = Dependency.of( | ||
| s"org.scalameta", | ||
| s"mtags_$scala_version", |
There was a problem hiding this comment.
It's fine to keep this as is. This is BTW the "mtags artifact name", not "mtags version"
| Dependency.of("com.lihaoyi", "acyclic_2.12", "0.1.8"), | ||
| Dependency.of("com.lihaoyi", "scalaparse_2.12", "2.1.0"), | ||
| Dependency | ||
| .of("com.typesafe.akka", "akka-cluster_2.12", "2.5.19"), |
There was a problem hiding this comment.
Pro tip: if you want to avoid the line break here then you can extract the list into a variable in a higher scope like
val dependencies = List(
...
)Scalafmt will always preserve the line break before dot .of(_) so you need to remove that manually if you want to put it back on a single line
10f4053 to
4e069bb
Compare
| ("com.typesafe.akka", "akka-cluster_2.12", "2.5.19"), | ||
| ("com.typesafe.akka", "akka-stream_2.12", "2.5.19"), | ||
| ("com.typesafe.akka", "akka-testkit_2.12", "2.5.19"), | ||
| ("io.buoyant", s"linkerd-core_2.12", "1.4.3"), |
There was a problem hiding this comment.
| ("io.buoyant", s"linkerd-core_2.12", "1.4.3"), | |
| ("io.buoyant", "linkerd-core_2.12", "1.4.3"), |
d373534 to
7e0b4f3
Compare
olafurpg
left a comment
There was a problem hiding this comment.
LGTM 👍 Thank you @sswistun-vl ! Nice work, I'm glad to finally get rid of coursier-small ^^
Replaced coursier-small with coursier-interface and added support for supplying custom repositories via environment variable