Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

Cross Compile sbt 1.0 and sbt 0.13.x #140

Merged
merged 2 commits into from
Oct 24, 2017
Merged

Conversation

MasseGuillaume
Copy link
Member

@MasseGuillaume MasseGuillaume commented Oct 16, 2017

  • c1 compiles in sbt 1.0.2 and c0 in sbt 0.13.16
  • scripted still works for sbt 0.13.16, this is wip until I get sbt 1.0 scripted to pass.

@MasseGuillaume MasseGuillaume mentioned this pull request Oct 16, 2017
@MasseGuillaume MasseGuillaume changed the title wip cross-compile sbt 1.0 and sbt 0.13.x Cross Compile sbt 1.0 and sbt 0.13.x Oct 17, 2017
@MasseGuillaume MasseGuillaume force-pushed the to-sbt-1.0 branch 2 times, most recently from d2090af to b458558 Compare October 17, 2017 13:38
1. ascii-graphs

We need a 2.12 version of ascii-graphs. The last commit to the project is in June 2013 (https://github.com/mdr/ascii-graphs/graphs/contributors). We are now in October 2017. I opened a PR (mdr/ascii-graphs#11) but I don't expect any progress on this front. We can maintain a fork or drop ascii-graphs.

2. ignoreMissingUpdate

ignoreMissingUpdate is a tricky one. Here is some explanation:

we need to duplicate the updateTask

in sbt it's define as:

```scala
def updateTask: Initialize[Task[UpdateReport]] = Def.task {
  // ...
  val uc0 = updateConfiguration.value
  // ...
}
```

since it's not scoped to our task (ex: `updateConfiguration in ignoreMissingUpdate`) we cannot just do

```scala
updateConfiguration in ignoreMissingUpdate := {
  updateConfiguration.value.withMissingOk(true)
}
```

For example, the following example yield `"u2: false"

```
val update2 = TaskKey[Unit]("update2", "...")
val update2Configuration = SettingKey[Boolean]("...")

update2 := Def.task {
  val u2 = (update2Configuration in update2).value
  println(s"u2: $u2")
}.value

update2Configuration := false
update2Configuration in update2 := true
```

3. cross publishing

We can use the ^ operator to publish. For example: `sbt "^ publish"` to publish for both sbt 0.13 and 1.0.
@MasseGuillaume MasseGuillaume force-pushed the to-sbt-1.0 branch 2 times, most recently from 10df26f to 66f801b Compare October 17, 2017 13:54
@jrudolph
Copy link
Member

Thanks a lot again, @MasseGuillaume and Scala Center.

I couldn't apply these changes directly because they conflicted a lot with my own attempts. I added many of your changes in a piecemeal fashion to #137 to keep track of what's going on. For reference, I merged in your PR in the last step without actually applying the remaining changes which I chose not to use for now.

@jrudolph jrudolph merged commit 66f801b into sbt:master Oct 24, 2017
@MasseGuillaume MasseGuillaume deleted the to-sbt-1.0 branch October 24, 2017 16:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants