How to open the Play app in IntelliJ IDEA from the command line?

After creating a new Play application

$ play new myapp $ cd myapp/ $ play idealize $ ls app conf lib myapp.iml public test 

I can open the file (only if the IDEA project is already open) using

 $ alias "ij=open -a /Applications/IntelliJ\ IDEA*.app" $ ij app/controllers/Application.java 

Is there a good way to create a new (or open an existing) Play project from the command line? I could write a simple script that creates the necessary XML files (myapp.ipr, myapp.iws), and then opens the project

 $ ij myapp.ipr 

but I hope this is not necessary (or already done).

+4
source share
2 answers

I branched out the structure 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 command adds the ideaproj command, which creates Module, Project, and Workspace files with a very simple structure. If you are using OS X, the team will also try to open the project in all (!) IDEA applications located in /Applications/IntelliJ\ IDEA*.app . So set up a python script if you have multiple applications for IDEA. Also, you probably want to change the default workspace layout. Take a look at iwsTemplate.xml and change it to your preference.

Usage: run the following command in the application directory to create the IDEA project files (and open them):

 play ideaproj 

Please note that it will overwrite existing project files! If the IDEA project is already open at the time you run this command again, then IDEA will ask you if you want to restart the project.

I also added the following two commits:

If you want to start using this command now, copy the intellij.py , iprTemplate.xml and iwsTemplate.xml to the directory of your playback platform (to the appropriate locations!).

EDIT: I made two more commits to fix the project tree in the workspace template so that it expands the first time you open the project.

0
source

If you can create project files, as you mentioned, idealize the Idea Module file for the Play project, so it should be as simple as integrating this module into the project file and opening the project.

If you do, publish it as a module in the game, it would be convenient :)

+1
source

All Articles