After I create a new Play app
$ play new myapp
$ cd myapp/
$ play idealize
$ ls
app conf lib myapp.iml public test
I can open a file (only if an IDEA project is already opened) using
$ alias "ij=open -a /Applications/IntelliJ\ IDEA*.app"
$ ij app/controllers/Application.java
Is there a nice way to create a new (or open an existing) Play project from the command line? I could write a simple script which creates the necessary XML-files (myapp.ipr, myapp.iws) and then opens the project by
$ ij myapp.ipr
but I hope this is unnecessary (or has been already done).
I have forked the framework and made the necessary changes to make this possible. See https://github.com/andreif/play/commit/ec70ab8162620a0c9ba5ca7195fc3c51d7de91b1 (note, the branch is called idea_project!)
This commit adds command
ideaprojwhich creates Module, Project and Workspace files of a very simple structure. If you are using OS X, the command will also try to open the project in all(!) IDEA apps located at/Applications/IntelliJ\ IDEA*.app. So adjust the python script in case if you have more than one IDEA app there. Additionally, you will probably want to change the default workspace layout. Have a look atiwsTemplate.xmland modify it to fit your preferences.Usage: run the following command in the app directory to create IDEA project files (and open them):
Note, that it will overwrite existing project files! If the IDEA project is already opened at the time you run this command again, then IDEA will ask you if you want to reload the project.
I have also added the following two commits:
If you want to start using this command now, then copy files
intellij.py,iprTemplate.xml, andiwsTemplate.xmlto your Play framework directory (to the corresponding locations!).EDIT: I have made two more commits to fix project tree in the workspace template, so that it expands first time you open the project.