-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
jdk: oraclejdk8 | ||
env: | ||
- SBT_VERSION=1.0.1 | ||
- scala: 2.10.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might need to be 2.12.3
because sbt version in build.properties is 1.0.1
, but we are compiling for 0.13.16 which requires 2.10.6
. It might be a trial/error to see if one is faster than the other.
@@ -25,6 +25,7 @@ import com.github.marklister.base64.Base64._ | |||
import github4s.Github | |||
import github4s.GithubResponses._ | |||
import github4s.free.domain._ | |||
// import sbt.io.IO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following
import sbt.io._
import sbt.io.syntax._
and the equivalent are the just "notes" and would be the imports if we were using purely sbt 1.0.
https://github.com/dwijnand/sbt-compat allows us to keep the equivalent sbt 0.13 imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I think we could starting using those soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of how sbt-compat
, it exposes the sbt 1.0 api through the sbt 0.13 import statements. It's either that or have scala version specific source files where the only difference is something like
47deg-suhas:main suhas$ diff scala-2.10/sbtorgpolicies/io/io.scala scala-2.12/sbtorgpolicies/io/io.scala
24c24,25
< import sbt.{file, File}
---
> import sbt.io._
> import sbt.io.syntax._
I think we'll need to keep this until we stop supporting sbt 0.13.
|
||
val crossScalaVersions: List[String] = List(`2.11`, `2.12`) | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better name for sbtV
? I originally had sbt
but that might inadvertently clash with the _root_.sbt
These will be removed once we have a snapshot published and use the corresponding sbtV
and scalac
in model.scala
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, can't think a better one now so I'm good keeping it as it is for now ;)
project/ProjectPlugin.scala
Outdated
sbtBinaryVersionValue, | ||
scalaBinaryVersionValue) | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/tpolecat/tut
0.6.x -> sbt 1.x
0.5.x -> sbt 0.13.x
sbt-scalafmt
-> I want to eventually switch to neo-sbt-scalafmt
but I didn't then understand why scala 2.12 dependencies were getting pulled in for scalafmt-core
. I currently kept different versions fot sbt-scalafmt
to simply keep status quo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, let's open an issue to address that migration later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch to neo-sbt-scalafmt
: #511
import sbt.Keys._ | ||
import sbt._ | ||
|
||
trait AllSettingsSpecific extends dependencies { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a naming convention for scala version specific files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming things is always the hardest part 😛 .
Maybe just ScalaSettings
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More naming questions :)
How about dependenciesSpecific.scala
? Or should I just merge both files under ScalaSettings
?
https://github.com/47deg/sbt-org-policies/pull/510/files#diff-c498862754c166dea83d0b202b567241
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juanpedromoreno bump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could merge it under ScalaSettings 👍
scalaOrganization.value % "scalap" % scalaVersion.value | ||
) | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dependencyOverrides ++= Set(
/ scala-2.10
vs
dependencyOverrides ++= Seq(
/ scala-2.12
(I need to look up how dependency precedence would work in this case)
@@ -1,4 +1,4 @@ | |||
import sbtorgpolicies.model._ | |||
import sbtorgpolicies.model.{ApacheLicense, GitHubSettings} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't completely understand why the wildcard import didn't work. It might be related to the original model.sbt
object in model.scala
I had.
https://github.com/47deg/sbt-org-policies/pull/510/files#diff-a84f91f20f040218bccd09fed4761fb3R5 and https://github.com/47deg/sbt-org-policies/pull/510/files#diff-4198f89a479a3a8c2b310affc814c14fR127 took me the longest time to figure out. First link: I didn't notice the difference of
How I found out the second link was possible sbt/sbt#3473 (comment). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, outstanding work!
Before merging, let's wait until @fedefernandez can take a look since there are some changes initially added by me.
@@ -25,6 +25,7 @@ import com.github.marklister.base64.Base64._ | |||
import github4s.Github | |||
import github4s.GithubResponses._ | |||
import github4s.free.domain._ | |||
// import sbt.io.IO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I think we could starting using those soon
@@ -44,7 +44,7 @@ object libraries { | |||
"cats-effect" -> "0.3", | |||
"circe" -> "0.8.0", | |||
"config" -> "1.3.1", | |||
"coursier" -> "1.0.0-RC9", | |||
"coursier" -> "1.0.0-RC10", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think RC11 was already released.
|
||
val crossScalaVersions: List[String] = List(`2.11`, `2.12`) | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, can't think a better one now so I'm good keeping it as it is for now ;)
project/ProjectPlugin.scala
Outdated
|
||
val scalaBinaryVersionValue = (scalaBinaryVersion in update).value | ||
|
||
sbtVersionValue match { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use this pattern match to only extract the tut and scalafmt deps, leaving just one Seq
of settings at the end. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean use the pattern match only and return ("0.5.3", "0.6.8")
or ("0.6.0", "1.2.0")
? DRY up the repeated group id and artifact id? If so, makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juanpedromoreno bump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's what I meant ;)
project/ProjectPlugin.scala
Outdated
sbtBinaryVersionValue, | ||
scalaBinaryVersionValue) | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, let's open an issue to address that migration later on.
sbt.version = 1.0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
import sbt.Keys._ | ||
import sbt._ | ||
|
||
trait AllSettingsSpecific extends dependencies { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming things is always the hardest part 😛 .
Maybe just ScalaSettings
?
@fedefernandez Can you look this PR over also? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
autocheck/project/plugins.sbt
Outdated
@@ -1,2 +1,2 @@ | |||
resolvers += Resolver.sonatypeRepo("snapshots") | |||
addSbtPlugin("com.47deg" % "sbt-org-policies" % sys.props("plugin.version")) | |||
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.6.0-SNAPSHOT") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep the environment variable
No description provided.