Tux's lil' helper
Joined: 21 Apr 2005
|Posted: Tue Apr 01, 2008 3:17 pm Post subject: [Script] Adding Libraries to Netbeans.
|I have plenty of java libraries installed on my desktop and it’s turning into a real hassle to set them up each time I clean out my Netbeans configuration folder.
- Yes, I’m the kind that keeps installing the development releases and each time clears out his config folder...
So, I created a script that should deal with this.
It is somewhat meant to be used on Gentoo. But it can be used on other distros too.
To see the complete code: go here http://rafb.net/p/8RvGMn42.html
To fetch the complete code: go here here
Output from the help:
./nb-importlib.sh - Imports a system java library into a netbeans installation
./nb-importlib.sh [OPTION] <LIBRARY> [NAME]
This script will import a system java library into a netbeans installation.
If ran on gentoo, --gentoo is selected by default. You can use '-n' or
'--no-gentoo' to disable and set the library up manually.
The netbeans target folder. uses "~/.netbeans/dev/" by default.
Only output the xml file to the screen. Don't write anywhere.
Do not prompt before overwriting.
Use java-config-2 to get the information.
Enabling the gentoo mode will disable the use of '--description',
'--classpath', '--javadoc' and '--source'.
Disable the use of java-config-2 and only use manually provided
Use this alternate description.
Set the classpath to RESOURCES (separated by a comma or colon).
Set the javadocs to JAVADOCS (separated by a comma or a colon).
Set the sources to SOURCES (separated by a comma or a colon).
Set the maven-pom resources to MAVEN-POM
(separated by a comma or a colon).
In gentoo, the script will query java-config-2 and use the information he finds there. So to add dev-java/fuse for example, you would:
|./nb-importlib.sh fuse Fuse |
If you want to specify stuff manually (which is also doable):
|./nbimportlib.sh --description "Fuse Injects Stuff" --classpath=/usr/share/fuse/lib/fuse-core.jar:/usr/share/fuse/lib/fuse-swing.jar --javadoc=/usr/share/doc/fuse-0.4/html/api fuse Fuse |
If you don't trust it (as you shouldn't!), you can use the -r or --dry-run option.
This will just output the xml file as it would be written.
-- I'll eat it--