Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source is internal and has private methods #67

Closed
larsrh opened this issue Jul 30, 2017 · 4 comments
Closed

Source is internal and has private methods #67

larsrh opened this issue Jul 30, 2017 · 4 comments

Comments

@larsrh
Copy link

larsrh commented Jul 30, 2017

The Source type, which is used for watchSources, is "internal" (why?) and only has private methods. When testing that the files included by watchSources are correct, this is very inconvenient.

@olafurpg
Copy link
Member

olafurpg commented Aug 13, 2017

While porting sbt-scalatex to sbt 1.0 I hit on this error

[error] /Users/ollie/dev/Scalatex/scalatexSbtPlugin/src/main/scala/scalatex/SbtPlugin.scala:52:18: No implicit for Append.Values[Seq[sbt.internal.io.Source], Seq[sbt.io.syntax.File]] found,
[error]   so Seq[sbt.io.syntax.File] cannot be appended to Seq[sbt.internal.io.Source]
[error]     watchSources ++= {
[error]                  ^
[error] one error found

I could not find references to watchSources in http://www.scala-sbt.org/1.x/docs/Migrating-from-sbt-013x.html Would it be possible to provide an implicit Append for File to Source to ease cross-building?

@olafurpg
Copy link
Member

olafurpg commented Aug 13, 2017

FWIW, my workaround is to provide an implicit conversion in a PluginCompat object

// src/main/scala-sbt-1.0/scalatex/PluginCompat.scala
package scalatex

import sbt._
import sbt.internal.io.Source
object PluginCompat {
  implicit def fileToInternalSource(file: File): Source =
    new Source(file, AllPassFilter, NothingFilter)
}

@dwijnand
Copy link
Member

dwijnand commented Sep 4, 2017

@dwijnand dwijnand closed this as completed Sep 4, 2017
@larsrh
Copy link
Author

larsrh commented Sep 4, 2017

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants