deanhiller/playorm

Playframework 2.1 plugin needs scala version

Opened this issue · 16 comments

Playframework plugin needs to have both scala and java version. Artifact for scala will have scala number appended - standard in scala community, so they can be both uploaded to maven repo.

currently playframework plugin depends on "javaCore". If you have scala playframework app and want playorm you need to add javaCore to work. While adding one more dependency is not a problem. There seems to be runtime check in template generator if javaCore is included because it generates templates with different API.

java uses play.data.* while scala play.data.api.*; they might be other differences in generated templates as well.

Plugin seems to be very small, so adding few scala lines to make scala version would not be problem. Alternative solution is to make playframework work without need to add javaCore.

where is plugin source code? i see just binary JAR in
https://github.com/deanhiller/playorm/tree/master/src/resources/play2plugin

The code is checked in at https://github.com/easility/Play2Plugin now.

code for this was merged to https://github.com/easility/Play2Plugin

Is it completely done now? Are you able to test with both Scala and Java?

Yes, this is done. There is another problem with play plugin - entities are not saved to database, but it didn't worked with original plugin too, so its not regression. This issue - needs to work with both java and scala is done.

Old plugin was working fine. An example project is checked in which is using the Plugin.jar and it is still working fine..You may see "https://github.com/easility/play2pluginexample" . If you will run this in Play2.1.0 it will show the messages at console.
You may call localhost:9000/save which was using em.flush()

yes, my guess is you did not call mgr.flush which takes all the puts you did and writes them to noSQL in parallel where as if we put them in noSQL at mgr.put call, then they would be come serialized writes and slow down your system....writing in parallel is more optimal.

pull request for scala version sent.

This is done. Both plugins (java and scala) can be published maven central after playframework 2.2 is released

Many thanks. So will it not work with Play 2.1.1?
We will publish the play2plugin soon in mavenrepo..till then, we can keep this ticket open.

it works with play 2.1.1 but it can not be pushed to central because play framework is not in central repo. Play 2.2 will be pushed to central.

Ok. We are trying to push it into maven repo.
@deanhiller : Will group id "com.alvazan" and artifactid "play2plugin" be ok for this plugin?

in sbt i have set group "com.alvazan.play2" and artifacts "plugin" for scala and "plugin-java" for java version

I am not picky. Go with what @hsn10 wants here.

Ok. We are onto it..there is some issue that the jar is creating as plugin-root.XX.jar and pluging-java.jar..

plugin-root is empty jar if you do sbt publish it will not be published. If you do sbt assembly then you will have available repackaged java plugin to include scala plugin -> you will need to deploy just one jar.