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

Support Attributed #112

Closed
dwijnand opened this issue Jan 26, 2018 · 3 comments
Closed

Support Attributed #112

dwijnand opened this issue Jan 26, 2018 · 3 comments
Assignees

Comments

@dwijnand
Copy link
Member

Currently sbt's Attributed isn't handled, so it falls back to toString.

Notable because it's the type element of Keys.Classpath/Def.Classpath, which is the type of a few keys.

dwijnand added a commit to dwijnand/sbt-buildinfo that referenced this issue Feb 23, 2018
@dwijnand dwijnand self-assigned this Feb 23, 2018
dwijnand added a commit to dwijnand/sbt-buildinfo that referenced this issue Feb 23, 2018
@fikovnik
Copy link

I guess I do something wrong, but I still see it as Seq[String] with Attributed inside the string.

In my build.sbt I have:

buildInfoKeys := Seq[BuildInfoKey](
  ...
  externalDependencyClasspath.in(Test)
  ...
)

and then I get:

case object BuildInfo {
  ...
  /** The value is scala.collection.Seq("Attributed(/home/krikava/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.12.6.jar)", "Attributed(/home/krikava/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.12.6.jar)",  ... */
  val test_externalDependencyClasspath = scala.collection.Seq("Attributed(/home/krikava/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.12.6.jar)", "Attributed(/home/krikava/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.12.6.jar)", ...)

  ...
}

@dwijnand
Copy link
Member Author

@fikovnik what version are you using?

Here's my working minimal reproduction:

// build.sbt
enablePlugins(BuildInfoPlugin)

buildInfoKeys := Seq[BuildInfoKey](
  externalDependencyClasspath.in(Test)
)
// project/plugins.sbt
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")
# project/build.properties
sbt.version=1.2.1
13:44:17 $ sbt
[info] Loading settings for project global-plugins from idea.sbt,global-plugins.sbt ...
[info] Loading global plugins from /Users/dnw/.dotfiles/.sbt/1.0/plugins
[info] Loading settings for project t-attributed-info-build from plugins.sbt ...
[info] Loading project definition from /s/t-attributed-info/project
[info] Updating ProjectRef(uri("file:/s/t-attributed-info/project/"), "t-attributed-info-build")...
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies.
[warn] Run 'evicted' to see detailed eviction warnings
[info] Loading settings for project t from build.sbt ...
[info] Set current project to t (in build file:/s/t-attributed-info/)
[info] sbt server started at local:///Users/dnw/.sbt/1.0/server/f489aa31e2024b3e3880/sock
> buildInfo
[info] Updating ...
[info] Done updating.
[success] Total time: 0 s, completed 17-Aug-2018 13:45:25
> [info] shutting down server
13:47:42 $ m target/scala-2.12/src_managed/main/sbt-buildinfo/BuildInfo.scala
package buildinfo

import scala.Predef._

/** This object was generated by sbt-buildinfo. */
case object BuildInfo {
  /** The value is scala.collection.Seq(new java.io.File("/Users/dnw/.sbt/boot/scala-2.12.6/lib/scala-library.jar")). */
  val test_externalDependencyClasspath: scala.collection.Seq[java.io.File] = scala.collection.Seq(new java.io.File("/Users/dnw/.sbt/boot/scala-2.12.6/lib/scala-library.jar"))
  override val toString: String = {
    "test_externalDependencyClasspath: %s".format(
      test_externalDependencyClasspath
    )
  }
}

@fikovnik
Copy link

Ah, that will be it - sorry for the confusion I was using 0.7 instead of 0.9

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

2 participants