hakandilek / play2-crud

Simple CRUD & DAO implementation for play2
Other
142 stars 52 forks source link

Migration to Play 2.3 #44

Closed pilou- closed 10 years ago

pilou- commented 10 years ago

Hi,

Here is a patch set which allows to build play2-crud using play 2.3.2 (#38).

Using this patch set and a local build created with publishLocal, I am able to build play2-crud-activator using the patch below.

I don't know why these modifications are needed:

While testing the patch set with play2-crud-activator, I was not able to use assets defined in play2-crud. The stage command generate a jar (play2-crud-0.7.4-SNAPSHOT-assets.jar) specific to assets, but assets are not accessible in play2-crud-activator project. publishLocal command didn't copy play2-crud-0.7.4-SNAPSHOT-assets.jar to ~/.ivy2/local/play2-crud/play2-crud_2.11/0.7.4-SNAPSHOT/jars/.

Patch applied to play2-crud-activator:

diff --git a/build.sbt b/build.sbt
index 356ba6a..5dc32df 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,14 +1,20 @@
 name := "play2-crud-activator"

-version := "0.7.3-SNAPSHOT"
+version := "0.7.4-SNAPSHOT"
+
+scalaVersion := "2.11.1"

 libraryDependencies ++= Seq(
   javaCore, javaJdbc, javaEbean,
-  "play2-crud" % "play2-crud_2.10" % "0.7.3-SNAPSHOT"
+  "play2-crud" % "play2-crud_2.11" % "0.7.4-SNAPSHOT"
 )

-play.Project.playJavaSettings
+scalacOptions ++= Seq("-feature", "-language:reflectiveCalls")
+
+lazy val root = (project in file(".")).enablePlugins(PlayJava)

 resolvers += "release repository" at  "http://hakandilek.github.com/maven-repo/releases/"

 resolvers += "snapshot repository" at "http://hakandilek.github.com/maven-repo/snapshots/"
+
+resolvers += Resolver.file("Local", file( Path.userHome.absolutePath + "/.ivy2/local"))(Resolver.ivyStylePatterns)
diff --git a/conf/routes b/conf/routes
index 0f8b183..040fd85 100644
--- a/conf/routes
+++ b/conf/routes
@@ -8,4 +8,4 @@ GET     /               controllers.Application.index()
 # CRUD Controllers
 ->     /app             play.crud.Routes
 # REST API
-->     /api             play.rest.Routes
+->     /api             play.utils.rest.Routes
diff --git a/project/build.properties b/project/build.properties
index 0974fce..be6c454 100644
--- a/project/build.properties
+++ b/project/build.properties
@@ -1 +1 @@
-sbt.version=0.13.0
+sbt.version=0.13.5
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 53e581d..6e010af 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -5,4 +5,4 @@ logLevel := Level.Warn
 resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

 // Use the Play sbt plugin for Play projects
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.2")
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.2")
pilou- commented 10 years ago

It seems that this patch set doesn't always fix the value RouterCrudController is not a member of object play.utils.crud.routes error.

I found that

allow to

Should play2-crud always be a subproject or is there another solution ?