NB-ImportLib
INTRODUCTION
NB-ImportLib is a small script to import java libraries into netbeans with ease. After re-adding my libraries over and over again each time I clean out my netbeans configuration folder (for whatever reason), I found it was time to automate the system a little for my own convenience.
Although the script works together with Gentoo’s java-config, it should be usable for other systems too. If you need more automation, you can wrap it in another script or adjust the script to work better for your distro. If you do so, remember that other people might find it usefull too. You can always mail me your sources so they can be added here.
FEATURES
- Choose the target to install to if you have several netbeans installations.
- Use java-config-2 to get the location of the files.
- See the help output below for a complete overview.
CHANGELOG
- 2008/04/01: Released v0.1
- 2008/10/01: Released v0.2
A couple of changes:- Fixed using spaces as a library name.
- Fixed adding libraries to the global build.properties file.
- Some minor bugfixes (output, error handling, …)
- Switched the location of functions.sh for OpenRC.
(Replace /etc/init.d/functions.sh with /sbin/functions.sh if you are NOT using OpenRC yet.)
TODO
There is still some work to be done:
- Beautify output
- Remove the use for functions.sh when using gentoo / openrc
- Handle errors better (don’t leave incomplete files)
- Handle canceling better (ctrl-c anybody?)
- Update help with build.properties stuff (dry run).
DOWNLOAD
- v0.2: NB-ImportLib v0.2
HELP
NAME
./nb-importlib.sh - Imports a system java library into a netbeans installation
SYNOPSIS
./nb-importlib.sh [OPTION] [NAME]
DESCRIPTION
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.
OPTIONS
-t, --target
The netbeans target folder. uses "~/.netbeans/dev/" by default.
-r, --dry-run
Only output the xml file to the screen. Don't write anywhere.
-f, --force
Do not prompt before overwriting.
-g, --gentoo
Use java-config-2 to get the information.
Enabling the gentoo mode will disable the use of '--description',
'--classpath', '--javadoc' and '--source'.
-n, --no-gentoo
Disable the use of java-config-2 and only use manually provided
information.
-d, --description
Use this alternate description.
-c, --classpath=RESOURCES
Set the classpath to RESOURCES (separated by a comma or colon).
-j, --javadoc=JAVADOCS
Set the javadocs to JAVADOCS (separated by a comma or a colon).
-s, --source=SOURCES
Set the sources to SOURCES (separated by a comma or a colon).
-m, --maven-pom=MAVEN-POM
Set the maven-pom resources to MAVEN-POM
(separated by a comma or a colon).
LIBRARY
To use the functionality without java-config-2 or alter it, you can use
or alter the functionality provided in the script.
Following 2 functions are provided:
* function print_library( , , > ...);
- Name of the library to be displayed in netbeans.
- Short description of the library.
- Different volumes to add (separated by a single space).
A volume can be specified in the format: =
- The following volume types are allowed:
classpath src javadoc maven-pom
- Resources are to be separated by ':' or ','.
* function print_volume( , );
- The type of the volume.
Possible values are:
classpath src javadoc maven-pom
- A list of resources to add.
Resources are to be separated by ':' or ','.
AUTHOR
Written by Jan Vansteenkiste
SEE ALSO
java-config, java-config-2
REPORTING BUGS
Report bugs to http://vstone.eu/nb-importlib/
