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

Confilict with sbtscalariform #8

Closed
ysae opened this issue Aug 4, 2012 · 3 comments
Closed

Confilict with sbtscalariform #8

ysae opened this issue Aug 4, 2012 · 3 comments

Comments

@ysae
Copy link

ysae commented Aug 4, 2012

Using together sbt-native-packager used with scalariform in a build.sbt file lead to confilict:

build.sbt:5: error: reference to settings is ambiguous;
it is imported twice in the same scope by
import _root_.com.typesafe.packager.PackagerPlugin._
and import _root_.com.typesafe.sbtscalariform.ScalariformPlugin._
settings(com.typesafe.packager.PackagerPlugin.packagerSettings:_*)
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

build.sbt:

import scalariform.formatter.preferences._

seq(scalariformSettings: _*)

settings(com.typesafe.packager.PackagerPlugin.packagerSettings:_*)

name := "myapp"

version := "0.0.1"

scalaVersion := "2.9.2"

resolvers ++= Seq(
  DefaultMavenRepository,
  "sonatype.release" at "http://oss.sonatype.org/content/repositories/releases",
  "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
)

ScalariformKeys.preferences := FormattingPreferences().
  setPreference(FormatXml, false)

project/build.properties:

sbt.version=0.11.3

project/plugins.sbt

resolvers += Classpaths.typesafeResolver

resolvers += Classpaths.typesafeSnapshots

resolvers += Resolver.url("sbt-plugin-releases",
  new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)

addSbtPlugin("com.typesafe.sbtscalariform" % "sbtscalariform" % "0.4.0")

addSbtPlugin("com.typesafe" % "sbt-native-packager" % "0.4.3")
@jsuereth
Copy link
Member

Ok, this seems very very odd. I'll look into it, but it seems to be some kind of wonky issue elsewhere....

@jsuereth
Copy link
Member

Hey, sorry I just figured this out:

You want your build file to be:

import scalariform.formatter.preferences._

seq(scalariformSettings: _*)

seq(com.typesafe.packager.PackagerPlugin.packagerSettings:_*)

name := "myapp"

version := "0.0.1"

scalaVersion := "2.9.2"

resolvers ++= Seq(
  DefaultMavenRepository,
  "sonatype.release" at "http://oss.sonatype.org/content/repositories/releases",
  "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
)

ScalariformKeys.preferences := FormattingPreferences().
  setPreference(FormatXml, false)

Notice that settings(...) changed to seq(...) is the documentation somewhere bad?

@ysae
Copy link
Author

ysae commented Jan 28, 2013

Right. Now it works.

Thank you. I forgot to check seq(...). Sorry.

Documentation isn't bad. But the difference between seq(...) and settings(...) in the README.md file is not obvious.

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