| CARVIEW |
|
parse-ipr
|
| Summary | Set CLASSPATH env var by parsing IntelliJ's .ipr file |
|---|---|
| Categories | None |
| License | Berkeley Software Distribution (BSD) License |
| Owner(s) | kohsuke |
Message from the owner(s)
Even with IntelliJ, it is often convenient to have a shell (or a command prompt) so that you can launch your program with various parameters. However, to do that, you have to set the CLASSPATH variable correctly, I used to do this by writing a little shell script, but then you have to maintain it as you add/remove libraries. All of those add up to a lot of efforts.
This little tool makes this process painless by:
- reading IntelliJ's .ipr file (which contains paths to all the important directories/jar files)
- formatting the contents into ';' or ':' separeted CLASSPATH variable style, and then
- printing that out to stdout (possibly into a few different formats for different flavors of shell.)
You can then write a little wrapper script to set the output to the variable. This last step usually depends on your environment and shell, but I have the following shell script:
#!/usr/bin/bash eval $(java -jar parse-ipr.jar -sh "$@")
And the following alias:
alias parse-ipr=". ~/bin/parse-ipr"
With these, I only need to type "parse-ipr" in the directory that contains *.ipr and it sets the CLASSPATH variable correctly.
On Windows, you can do:
java -jar parse-ipr.jar -batch %* > ./tmp.bat ./tmp.bat
Cygwin users can use orthogonal -cygwin option to get CLASSPATH in the Unix format, such as:
eval $(java -jar parse-ipr.jar -sh -cygwin "$@")
Try java -jar parse-ipr.jar --help for the list of complete options.
Download
Download the library from here.
Usage
When invoked without any argument, it assumes that a file with the .ipr extension is in the current directory.
If arguments are specified, they will be treated as directory names that contain *.ipr, or the name of the .ipr file.
| Powered by CollabNet | Feedback |
FAQ |
Press |
Developer tools
© 1995 - 2007 CollabNet. CollabNet is a registered trademark of CollabNet, Inc. |
