Saturday, March 15, 2014

Libgdx Extensions Javadocs or How to Extract Javadocs from Source Jars

Hi,

A lot of open source projects like Libgdx package sources in jars. So how do you generate Javadocs with the Javadoc command directly from a jar file?

You can't. You have to extract the jar first.

Specifically for Libgdx, extensions are not documented in the http://libgdx.badlogicgames.com/nightlies/docs/api/ online Javadoc.

One alternative is to just attach the source jars with whatever editor you are using, such as Eclipse. For Eclipse, right click on the project -> build path -> configure build path. Then there should be a window similar to this:



Click the plus symbol next to the jar, then double click source attachment. A dialog box will appear to allow you to attach the source jar.





However, this does not solve the original problem. You want an HTML Javadoc Index.html file to look at, possibly on a multi-monitor setup. No problem. Create a small script to extract the jar files and build the Javadoc for you (or use Ant or build tool of your choosing).

The below is specific to Libgdx but could be modified for any open source project with source jars. Download the Libgdx nightly here http://libgdx.badlogicgames.com/nightlies/

1.

touch ./extensions-javadoc


2.
chmod 755 ./extensions-javadoc
 
3. Open extensions-javadoc with your favourite text editor and paste below

#!/bin/bash

mkdir extension-sources
cd extension-sources
jar -xvf ./../extensions/gdx-audio/sources/gdx-audio-sources.jar
jar -xvf ./../extensions/gdx-bullet/sources/gdx-bullet-sources.jar
jar -xvf ./../extensions/gdx-controllers/sources/gdx-controllers-android-sources.jar
jar -xvf ./../extensions/gdx-controllers/sources/gdx-controllers-desktop-sources.jar
jar -xvf ./../extensions/gdx-controllers/sources/gdx-controllers-gwt-sources.jar
jar -xvf ./../extensions/gdx-controllers/sources/gdx-controllers-sources.jar
jar -xvf ./../extensions/gdx-freetype/sources/gdx-freetype-sources.jar
jar -xvf ./../extensions/gdx-image/sources/gdx-image-sources.jar
jar -xvf ./../extensions/gdx-jnigen/sources/gdx-jnigen-sources.jar
jar -xvf ./../extensions/gdx-tiled-preprocessor/sources/gdx-tiled-preprocessor-sources.jar
jar -xvf ./../extensions/gdx-tools/sources/gdx-tools-sources.jar

javadoc -d ./../docs-extensions -sourcepath ./ -subpackages com
 


4. Save and run script
./extensions-javadoc
Rejoice at your newly available HTML Javadocs!

16 comments:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training from India . Nowadays Java has tons of job opportunities on various vertical industry.

    ReplyDelete
  2. Thank you for sharing this informative post.MyAssignmenthelp.com is giving assignment help to students.we are already trusted by thousands of students who struggle to write their academic papers and also by those students who simply want English homework help canada to save their time and make life easy.Are you on the lookout for flawless Online English Homework help in Canada? This blog will greet you with reliable insights. A case study requires investigating a specific issue of the Help with english homework, examining the alternative solutions, and proposing the most effective solution by using suitable supporting evidence.

    ReplyDelete
  3. Excellent information Providing by your Article, thank you for taking the time to share with us such a nice article. Amazing insight you have on this, it's nice to find a website that details so much information about different artists. Kindly visit livewebtutors website we providing best assignment help services in Australia.
    Read more now :- My Assignment Help

    ReplyDelete
  4. Still, not getting effective Assignment Help for your project submission? Don’t get panic! Browse the website greatassignmenthelp to connect with the remarkable academic writers to complete your project. Don’t waste your time and place your order right now!
    Assignment Help Online
    Online Assignment Help
    Assignment Help Online Services
    Assignment Helper
    Assignment Assistance
    Assignment Help Experts
    Online Assignment Help Services

    ReplyDelete
  5. A special thanks to My Assignment Help for providing a well-written assignment. You guys were a savior to me. Will contact you soon for my upcoming assignments. You can email us at cs@Myassignmenthelpau.Com or Phone Number: +61-2-8005-8227

    ReplyDelete
  6. Do you know the genuine possible behind the non-working of HP Printer? Well, you do not feel worse as you come in the strong grip of Printer office. This is the invalidate condition as there lies some break for the Printer Is Offline Windows 10. No matter how many times you jump on the print command using the file menu of word file and other concerning page, the printer cannot yield the quality result. It is the best option that you would have to come on our third party professional as you are firm minded to eradicate the maximum problems. Feel free to contact our team.
    how to get printer online
    how do i get my printer online
    HP Solution Center
    HP Solution Center Windows 10
    Error Printing
    Printer Error
    hp printer driver is unavailable
    printer driver unavailable
    driver is unavailable printer

    ReplyDelete
  7. 'I'm highly impressed by the piece of thoughts you have shared on this portal. all the best
    connect us on Assignment Help can shed your burden of assignments with a return of qualitative assignments.

    ReplyDelete
  8. Thank you for bringing to a halt my long search topic. I really benefited from your content. If you are experiencing trouble striking a balance between your busy academic life and handling your online classes, you can get help from a professional who will take online classes on your behalf. It doesn’t matter the kind of help you need, whether it is passing your exam, finishing your assignments or even the entire classwork, you can get help here at Online Class Help .

    ReplyDelete
  9. In HP printers WPS stands for "Wi-Fi protected setup" and one will not able to connect his printer to other devices without opening the WPS pin. So if you want to connect your printer through wireless medium and having trouble finding the WPS pin on your system then feel free to visit find WPS pin on HP printer.

    ReplyDelete

  10. Have you purchased a wireless HP Printer, so looking to connect or set up a wireless printer to wifi? To Setup HP Printer, go to the printer's control panel, then click or touch the wireless network and then wireless setup wizard will display some list of wireless networks in your location, for further information read our article.

    ReplyDelete

  11. Learn to change outlook password as it is a simple process you can do after login your Microsoft outlook account. Follow the article and change the outlook password in minutes.

    ReplyDelete
  12. Thank you for sharing such an informative article. Most people buy coffee already roasted, but if you want the freshest, most flavorful beans, you may want to roast your own. Before roasting, coffee beans are green and grassy. The high temperatures used to roast the beans cause chemical changes to bring out the aroma and flavor that you love. Visit Ikawa Home Coffee Roaster for more.

    ReplyDelete
  13. Take Ireland Assignment Help to connect with native academic writers. Online Assignment Help will help you to get worthy writing assistance at a reasonable price. Choose Assignment Help Online in Ireland for good grades.

    ReplyDelete
  14. ABC Assignment Help has been a pioneer in providing best taxation law assignment help online services. Visit our website and make an order now to get professional work from top experts in Australia.

    ReplyDelete
  15. Hello there, great stuff you’ve shared here I will be checking regularly for more articles. But wait! When it becomes hard to manage your online assignment, availing Online Assignment Help is the best choice. Many students often fail to submit their assignment before deadlines and end up scoring low grades because they didn’t have enough time to write the assignment given on time and satisfactorily. Visit Assignment Help . for assistance.

    ReplyDelete
  16. My Assignment help strive to meet the need of customized assignment help of students from Universities across Australia. With our team of enthusiastic and unwavering writing experts, our aim is to help every student improve the academic grades and submit optimum quality assignments that are 100% unique meeting the University guidelines. Connect with us now to understand how it works and start the unique experience of customised writing help.

    ReplyDelete