Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Script] Adding Libraries to Netbeans.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Po0ky
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2005
Posts: 142
Location: Belgium

PostPosted: Tue Apr 01, 2008 3:17 pm    Post subject: [Script] Adding Libraries to Netbeans. Reply with quote

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:
Code:

NAME
    ./nb-importlib.sh - Imports a system java library into a netbeans installation

SYNOPSIS
    ./nb-importlib.sh [OPTION] <LIBRARY> [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).


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:
Code:
./nb-importlib.sh fuse Fuse


If you want to specify stuff manually (which is also doable):
Code:
./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--
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum