Generate Apple Docs for XCODE project

1.7k views Asked by At

I am trying to generate apple docs for one of my projects. I am using the following commands to generate the docs...

headerdoc2html -o OutPutDirectory InputDirectory

I am getting the following message...

Processing /Users/Ankit/Documents/Projects/pos/trunk/TestProject/TestProject/Test.h
    Skipping. No HeaderDoc comments found.
No default encoding.  Guessing.  If date formats are wrong, try
specifying an appropriate value in the LANG environment variable.

Any help is appreciated.

3

There are 3 answers

0
Andrew T. On

The LANG environment variable is not set in any location that your Xcode can reach. Probably because it wasn't set in your build settings.

Running the command below will print all environment variables, LANG will not be among them.

xcodebuild -project Path/To/Your.xcodeproj -target "YourTarget" -showBuildSettings

Environment variables are managed in your schemes under the "Environment Variables" table, but I haven't had luck changing them there. What I eventually did (since my headerdoc2html call was in a build script in my Build Phases of my Documentation target) was add this line to the top of my bash script:

export LANG=en_US.US-ASCII

The message went away after that.


My total script, for the curious.

export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/usr/bin/headerdoc2html -o ~/Development/Path/To/My/Documentation ~/Development/Path/To/My/Project/Headers
/Applications/Xcode.app/Contents/Developer/usr/bin/gatherheaderdoc ~/Development/Path/To/My/Documentation

(Xcode Version 4.6.3)

1
Midhun MP On

I had same issue. I fixed it by changing all

/// Comments

And

/**
 * Comments
 */ 

Comments to

/*!
 * Comments
 */

And everything worked fine for me.

1
Mohammad On

You can also use the -j flag to enable javadoc syntax and not have to change any of your documentation code.

headerdoc2html -j -o OutputDirectory InputDirectory