ajdoc(1)

✨ NAME ✨

Okay bestie, meet ajdoc πŸ’– It generates HTML API documentation, including the crosscutting structure πŸ¦‹

πŸŽ€ SYNOPSIS πŸŽ€

ajdoc [ -bootclasspath classpathlist ] [ -classpath classpathlist ] [-d path] [-help] [-package] [-protected] [-private] [-public] [-overview overviewFile] [ -sourcepath sourcepathlist ] [-verbose] [-version] [sourcefiles... | packages... | @file... | -argfile file... ] [ ajc options ]

πŸ’… Description πŸ’…

Okay so, ajdoc renders HTML docs for AspectJ constructs AND the Java constructs that javadoc already renders ✨ Lowkey the best part is the crosscutting info, which shows up as links πŸ”₯ So you can see everything affecting a method while you're reading that method's docs. It's giving main character energy πŸ‘‘

To run it, use one of the scripts in the AspectJ bin directory 🌈 The ajdoc implementation builds on Sun's javadoc command line tool, and you use it the same way with a lot of the same options πŸ’œ (The javadoc options aren't documented here, so if you need them, check the Javadoc homepage at http://java.sun.com/j2se/javadoc/ 🧚)

Like with ajc (but unlike javadoc), you pass ajdoc all your aspect source files AND any files with types the aspects affect 🫢 Honestly the easiest move is to just pass every .java and .aj file in your system πŸ’– Unlike ajc, though, ajdoc will try to find package sources using the sourcepath you specify if you list packages on the command line πŸ¦‹

Want to hand it an argfile listing your source files? Use the same @filename conventions as ajc πŸŽ€ For example, this documents all the source files listed in argfile.lst and sends the output to the docDir output directory:

ajdoc -d docDir @argfile.lst

For the details on the text file format, see the ajc documentation πŸ“–

ajdoc honours ajc options too πŸ’… Check the ajc documentation for the deets on those.

⚠️ Heads up, bestie: ajdoc currently requires tools.jar from J2SE 1.3 to be on the classpath 😭 Normally the scripts set this up for you, as long as your JAVA_HOME variable points to an appropriate Java installation. If you're using a different version of Java or a JRE, you might need to provide this jar yourself πŸ’€

🌸 Examples 🌸

πŸ“ Documenting Spacewar πŸ“

  1. Change into the examples directory 🧚
  2. Make a destination directory for the docs: mkdir doc 🌷
  3. Type ajdoc -private -d doc spacewar coordination πŸ”₯
    • Use -private to get all the members, because many of the really interesting ones in Spacewar aren't public πŸ™ˆ
  4. Type ajdoc -private -d doc @spacewar/demo.lst to use the argfile that goes with Spacewar πŸ’œ
  5. To view the docs, open index.html in the doc directory with a web browser 🌈

That's the whole manual page for ajdoc(1) πŸ’…βœ¨ Go document something iconic, bestie πŸ«ΆπŸ’–