tuplejump / play-yeoman

Play + Yeoman integration sbt and play plugins
Apache License 2.0
238 stars 57 forks source link

build.sbt setting for 0.7.1 #68

Closed hanfeisun closed 9 years ago

hanfeisun commented 9 years ago

In this page: https://github.com/tuplejump/play-yeoman, I found project/Build.scala setup instructions for 0.6.4 and 0.7.1

After that, I found build.sbt usage for 0.6.4, but there is no examples about how to config build.sbt in 0.7.1.. I was wondering whether there is a different setting for 0.7.1 with build.sbt or it should be the same with the 0.6.4 one..

Shiti commented 9 years ago

it is should be playScalaSettings ++ Yeoman.yeomanSettings. I will update the documentation

hanfeisun commented 9 years ago

@Shiti Thanks! Do you mean use playScalaSettings ++ Yeoman.yeomanSettings in 0.7.1 to replace all these lines below in 0.6.4?

import com.tuplejump.sbt.yeoman.Yeoman

name := "play-project"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq( javaJdbc, javaEbean, cache )

play.Project.playJavaSettings ++ Yeoman.yeomanSettings

hanfeisun commented 9 years ago

I see.. So you mean this in 0.7.1, right?

import com.tuplejump.sbt.yeoman.Yeoman

name := "play-project"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq( javaJdbc, javaEbean, cache )

playScalaSettings ++ Yeoman.yeomanSettings

hanfeisun commented 9 years ago
import PlayKeys._

name := """theTest"""

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.4"

libraryDependencies ++= Seq(
  jdbc,
  anorm,
  cache,
  ws,
  "com.typesafe.slick" %% "slick" % "2.1.0",
  "com.typesafe.play" %% "play-slick" % "0.8.1",
  "org.slf4j" % "slf4j-nop" % "1.6.4",
  "org.postgresql" % "postgresql" % "9.3-1102-jdbc4",
  "com.typesafe.play.plugins" %% "play-plugins-mailer" % "2.3.0",
  "com.mohiva" %% "play-silhouette" % "2.0-SNAPSHOT",
  //"ws.securesocial" %% "securesocial" % "master-SNAPSHOT",
//  "ws.securesocial" %% "securesocial" % "3.0-M2",
  "org.scalatestplus" %% "play" % "1.1.0" % "test",
  "org.scalacheck" %% "scalacheck" % "1.10.1" % "test",
  play.PlayImport.cache,
  "com.github.mumoshu" %% "play2-memcached" % "0.6.0"
)

resolvers += Resolver.sonatypeRepo("snapshots")

routesImport ++= Seq("scala.language.reflectiveCalls")

playScalaSettings ++ Yeoman.yeomanSettings

I config my project in build.sbt like this, but the compiler throws an error:

build.sbt:35: error: not found: value playScalaSettings
playScalaSettings ++ Yeoman.yeomanSettings
^
[error] Type error in expression
Project loading failed: (r)etry, (

would it be possible to reopen this issue until the README is modified for 0.7.1?

Shiti commented 9 years ago

According to the error message, there is something wrong with your Play project configuration. Please remove the Play-yeoman dependencies and check if the Play Project compiles.

Manc commented 9 years ago

Doesn't work for me either – same error. I thought there was no playScalaSettings anymore in Play 2.3.

hanfeisun commented 9 years ago

@Shiti is wrong..

@Manc using Yeoman.yeomanSettings instead of playScalaSettings ++ Yeoman.yeomanSettings solved the issue for me