1. #1
    Sencha User
    Join Date
    Apr 2010
    Posts
    8
    Vote Rating
    0
    opticyclic is on a distinguished road

      0  

    Default Is It Possible To Use JSDuck On Java Code?

    Is It Possible To Use JSDuck On Java Code?


    Is it possible to use JSDuck on Java code (not javascript)?

    I am looking at different documentation tools and would like to have the same format for the Java side as for the javascript side.

  2. #2
    Sencha - Services Team arthurakay's Avatar
    Join Date
    Sep 2008
    Location
    Antioch, IL
    Posts
    1,235
    Vote Rating
    7
    arthurakay has a spectacular aura about arthurakay has a spectacular aura about

      0  

    Default


    One of my colleagues has run JSDuck on Java, Ruby and other languages besides JavaScript. I'll see if I can get him to comment...
    Arthur Kay
    Solutions Engineer, Sencha Inc.

    Twitter | Sencha Chicago User Group

  3. #3
    Touch Premium Member suzuki1100nz's Avatar
    Join Date
    Apr 2011
    Location
    New Zealand
    Posts
    345
    Vote Rating
    17
    suzuki1100nz will become famous soon enough suzuki1100nz will become famous soon enough

      0  

    Default


    Can I ask why?
    Why would you want to use JSDuck to generate docs on Java code? JSDuck is based on Javadoc which was written specifically to generate docs from java code following sun standards.
    It comes with eclipse.

  4. #4
    Sencha - Services Team arthurakay's Avatar
    Join Date
    Sep 2008
    Location
    Antioch, IL
    Posts
    1,235
    Vote Rating
    7
    arthurakay has a spectacular aura about arthurakay has a spectacular aura about

      0  

    Default


    You might want the output to look extra nice :-)

    You might also want all of your application documentation in a centralized place... JavaScript (client), Java (server), and any other tier.
    Arthur Kay
    Solutions Engineer, Sencha Inc.

    Twitter | Sencha Chicago User Group

  5. #5
    Sencha - Services Team
    Join Date
    Mar 2007
    Location
    Foristell, MO
    Posts
    1,100
    Vote Rating
    3
    jratcliff is on a distinguished road

      0  

    Default


    Quote Originally Posted by opticyclic View Post
    Is it possible to use JSDuck on Java code (not javascript)?

    I am looking at different documentation tools and would like to have the same format for the Java side as for the javascript side.
    Yes, I've used it to document Java, PHP, and Ruby. It's a little trickier with Ruby since you have to wrap your doc comments in =begin, =end ruby comment blocks. PHP also has issue with single line comments that start with '#'. But as for Java, it was the most straight forward.

    So, the trick to get JSDuck to document your classes and methods is that you have to add the @class and @method tags in your doc comments. JSDuck is geared toward JavaScript and specifically code written using the ExtJS styles and therefore it will do a lot of the work for you in figuring out what the class and method names are. For non-JavaScript code, you just have to manually add your @tags (@class, @extend, @method, etc.).
    Jack Ratcliff
    Sencha Inc, Green bleeding Senchan

    How to report a bug:
    http://www.sencha.com/forum/showthre...o-report-a-bug

  6. #6
    Ext JS Premium Member Gjslick's Avatar
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    129
    Vote Rating
    5
    Gjslick is on a distinguished road

      0  

    Default What a great idea

    What a great idea


    Honestly, what a great idea. I love the output and application that jsduck creates next to the framed, difficult-to-navigate javadocs. If I want to keep a few classes open for reference in Java, I usually end up opening a browser tab for each one (then forgetting which one is which if I have too many and lose the window titles). Not to mention the search feature, ability to show/hide public/protected/private, show/hide inherited fields/methods, etc.

    Might just want to add a custom @throws tag to fill in for that need

  7. #7
    Sencha User
    Join Date
    Apr 2010
    Posts
    8
    Vote Rating
    0
    opticyclic is on a distinguished road

      0  

    Default


    Thanks for the info.
    Would you mind pasting a sample command of running it as I haven't used JSDuck before.

    Is the only way to integrate it with ant ANT script to use the Exec task?

  8. #8
    Sencha - Services Team
    Join Date
    Mar 2007
    Location
    Foristell, MO
    Posts
    1,100
    Vote Rating
    3
    jratcliff is on a distinguished road

      0  

    Default


    Here's an example shell script that I use:

    Code:
    jsduck \
      ./src/com/sencha/test/*.java \
      ./src/com/sencha/test/servlet/*.java \
      ./src/com/sencha/test/util/*.java \
      ./src/com/sencha/jetty/*.java \
      --output docs \
      --title="Test Title" \
      --warnings=-all \
      --welcome=./doc_src/welcome.html \
    However, I seem to recall that on windows, this won't work as a bat file since the line continuation character is different.

    So a more cross-platform way to do this would be to use a config file. Your command would then be:

    Code:
    jsduck --config yourconfigfile.config
    And your config would be in json format and would look something like this:


    Code:
    {
      "--title" : "Test Title",
      "--warnings" : "-all",
      "--welcome" : "./doc_src/welcome.html",
      "--output" : "docs:,
      "--" : [
        "./src/com/sencha/test/*.java",
        "./src/com/sencha/test/servlet/*.java".
        "./src/com/sencha/test/util/*.java",
        "./src/com/sencha/jetty/*.java"
      ]
    }
    Jack Ratcliff
    Sencha Inc, Green bleeding Senchan

    How to report a bug:
    http://www.sencha.com/forum/showthre...o-report-a-bug

  9. #9
    Sencha User
    Join Date
    Mar 2011
    Posts
    1
    Vote Rating
    0
    javidmasti is on a distinguished road

      0  

    Default Windows

    Windows


    Has anyone tried it on windows. I get an error when i try to include javafiles for the documentation

    Code:
    c:\ jsduck {*.js,*.java} -o docs
    Error: Error while parsing c:\test.java: Line 1: Unexpected reserved word

  10. #10
    Sencha User
    Join Date
    Oct 2012
    Posts
    1
    Vote Rating
    0
    jasmin007 is on a distinguished road

      0  

    Default


    Every once in a while I get asked why doesn't JSDuck support a certain character in the names of various entities. The character is usually some punctuation like the dot (.) or dash (-). The names in question are the names of classes and class members (methods, properties, events, etc).

    So why doesn't JSDuck allow you to document a class named My.Special-Class or method named my+method? Why doesn't the freaking tool just get out of the way and allow you to do what you want? Supporting just one more character can't be so hard - why not simply do it?

    Three reasons:

    It's not sensible
    It's troublesome to implement
    It's not just JSDuck

Tags for this Thread