Skip to content

Commit

Permalink
Improve idealize command to generate .ipr file
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Hilton committed Sep 9, 2011
1 parent 51fd0ca commit f74ef27
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion framework/pym/play/commands/intellij.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ def execute(**kargs):
replaceAll(imlFile, r'%MODULE_LINKS%', mlXML)
replaceAll(imlFile, r'%MODULE_LIB_CLASSES%', msXML)
replaceAll(imlFile, r'%MODULE_LIBRARIES%', jdXML)

iprFile = os.path.join(app.path, application_name + '.ipr')
shutil.copyfile(os.path.join(play_env["basedir"], 'resources/idea/iprTemplate.xml'), iprFile)
replaceAll(iprFile, r'%PROJECT_NAME%', application_name)


print "~ OK, the application is ready for Intellij Idea"
print "~ Use File/New Module/Import Existing module"
print "~ Use File, Open Project... to open \"" + application_name + ".ipr\""
print "~"

8 changes: 8 additions & 0 deletions resources/idea/iprTemplate.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/%PROJECT_NAME%.iml" filepath="$PROJECT_DIR$/%PROJECT_NAME%.iml" />
</modules>
</component>
</project>

0 comments on commit f74ef27

Please sign in to comment.