Added documentation build script for Doxygen and JavaDoc
authorPatrick C Lankswert <patrick.lankswert@intel.com>
Wed, 24 Jun 2015 17:37:19 +0000 (13:37 -0400)
committerErich Keane <erich.keane@intel.com>
Thu, 25 Jun 2015 16:26:37 +0000 (16:26 +0000)
This change set adds a script (./build_docs.sh) to generate
the documenation for iotivity which is placed into the ./docs
directory. Currently, the script builds java and C/C++ API
documentation and includes checks for warnings and errors.
When all of the existing warnings and errors are addressed,
this should be added to the build script to fail validation
if/when a contributor breaks the API documentation.

Please consider cherry-picking to the 0.9.1 release branch.

Change-Id: I490fbfc83cf61c76c7f59ba2c00404a073b039e7
Signed-off-by: Patrick Lankswert <patrick.lankswert@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1418
Reviewed-by: Erich Keane <erich.keane@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
build_docs.sh [new file with mode: 0755]
resource/docs/Doxyfile

diff --git a/build_docs.sh b/build_docs.sh
new file mode 100755 (executable)
index 0000000..7c0bdbc
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+# Fail script on any failure
+set -e
+
+# Move to script direotory
+pushd `dirname $0` > /dev/null
+
+rm -rf docs
+
+# JavaDoc now... from Uze's script
+ANDROID_JAR="$ANDROID_HOME/platforms/android-21/android.jar"
+
+if [ ! -e "$ANDROID_JAR" ]; then
+    echo "Android platform not found. Expected '$ANDROID_JAR'"
+    exit 1
+fi
+
+BASE_PATH="android/android_api/base/src/main/java/"
+BASE_PKG="org.iotivity.base"
+
+TM_PATH="service/things-manager/sdk/java/src/"
+TM_PKG="org.iotivity.service.tm"
+
+SSM_PATH="service/soft-sensor-manager/SDK/java/"
+SSM_PKG="org.iotivity.service.ssm"
+
+PPM_PATH="service/protocol-plugin/plugin-manager/src/Android/src"
+PPM_PKG="service/protocol-plugin/plugin-manager/src/Android/src/org/iotivity/service/ppm/PluginManager.java service/protocol-plugin/plugin-manager/src/Android/src/org/iotivity/service/ppm/Plugin.java"
+# PPM_PKG="org.iotivity.service.ppm"
+
+javadoc -splitindex \
+        -d ./docs/java \
+        -sourcepath $BASE_PATH:$TM_PATH:$SSM_PATH $BASE_PKG $TM_PKG $SSM_PKG $PPM_PKG \
+        -classpath $ANDROID_JAR
+
+# Doxygen now...
+# NOTE: For now this is a workaround since I am ready to modify the doxygen setup
+pushd resource/docs > /dev/null
+doxygen
+
+# Check for warnings or errors
+if [ -s doxygen.log ]; then
+    echo "Errors running doxygen. Review doxygen.log"
+    exit 2
+fi
+
+popd > /dev/null
+rm -rf docs/cxx
+mv resource/docs/docs/html docs/cxx
+
+popd > /dev/null
index 8b5740a..a1ecb43 100644 (file)
@@ -648,7 +648,7 @@ WARN_FORMAT            = "$file:$line: $text"
 # and error messages should be written. If left blank the output is written
 # to stderr.
 
-WARN_LOGFILE           =
+WARN_LOGFILE           = ./doxygen.log
 
 #---------------------------------------------------------------------------
 # configuration options related to the input files
@@ -666,13 +666,13 @@ INPUT                  = . \
                          ../include/OCResourceRequest.h \
                          ../include/OCResourceResponse.h \
                          ../include/OCResource.h \
-                         ../resource/csdk/stack/include/octypes.h \
-                         ../resource/csdk/stack/include/ocstackconfig.h \
+                         ../csdk/stack/include/octypes.h \
+                         ../csdk/stack/include/ocstackconfig.h \
                          guides \
                          ../../service/things-manager/sdk/inc \
                          ../../service/soft-sensor-manager/SDK/cpp/include \
                          ../../service/protocol-plugin/plugin-manager/src/PluginManager.h \
-                         ../../service/noification-manager/NotificationManager/include/hosting.h 
+                         ../../service/notification-manager/NotificationManager/include/hosting.h 
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is