Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is a very tricky business. SBT in Play is used for fetching dependencies, compiling source and templates, and for the SBT incremental compilation + auto-reloading feature. I have written a <code>build.gradle</code> script to resolve all Play 2.0 dependencies and set-up Eclipse or IntelliJ IDEA classpaths, and made it <a href="https://gist.github.com/rodionmoiseev/2484934">public here</a>.</p> <p>I will try to implement the compilation later when I have time, but that would require some research. Of course, you can add compile and run tasks that just delegate to SBT but that would require describing all your project dependencies in both SBT and Gradle, which will become difficult to manage.</p> <p><strong>Edit:</strong></p> <p>I have updated the <a href="https://gist.github.com/rodionmoiseev/2484934">sample build.gradle</a> file. I have added <code>playCompile</code> and <code>playClean</code> tasks that should help in a CI environment. The <code>playCompile</code> task does the following:</p> <ol> <li>Copy all user dependencies (defined in <code>compile</code> configuration) to <code>lib/</code> folder. This works because Play will kindly pick up all jars from under <code>lib/</code>.</li> <li>Execute <code>play compile</code> command to compile all sources, templates and other Play framework stuff.</li> </ol> <p>You can use <code>cleanCopyPlayLibs</code> and <code>playClean</code> to remove the output of the above commands, respectively.</p> <p>Note that there appears to be a strange problem (bug?) on Windows, which means that even if <code>play compile</code> fails, gradle will tell you it succeeded.</p> <p><strong>Reply to comment:</strong></p> <p>I think you are simply missing</p> <pre><code>repositories{ mavenCentral() } </code></pre> <p>in your file. Check <a href="http://gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html">this doc out</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload