Commit 5aa97cae authored by François Grisez's avatar François Grisez
Browse files

Add a target to generate Liblinphone's JavaDoc

parent 20561818
......@@ -42,6 +42,7 @@ option(ENABLE_CONSOLE_UI "Turn on or off compilation of console interface." YES)
option(ENABLE_DATE "Use build date in internal version number." NO)
cmake_dependent_option(ENABLE_DAEMON "Enable the linphone daemon interface." YES "NOT WIN32" NO)
option(ENABLE_DOC "Enable documentation generation with Doxygen." YES)
option(ENABLE_JAVADOC "Add a target to generate documentation for Java API" NO)
option(ENABLE_GTK_UI "Turn on or off compilation of gtk interface." YES)
option(ENABLE_LDAP "Enable LDAP support." NO)
option(ENABLE_LIME "Enable Instant Messaging Encryption." YES)
......
......@@ -45,6 +45,25 @@ if (ENABLE_DOC)
endif()
endif()
if(ENABLE_JAVADOC)
find_package(Java REQUIRED)
set(JAVADOC_PACKAGES "org.linphone.core org.linphone.mediastream")
set(JAVADOC_CLASSPATHS
"${PROJECT_SOURCE_DIR}/java/common"
"${PROJECT_SOURCE_DIR}/java/j2se"
"${PROJECT_SOURCE_DIR}/mediastreamer2/java/src"
)
string(REPLACE ";" ":" JAVADOC_CLASSPATHS "${JAVADOC_CLASSPATHS}")
set(JAVADOC_TITLE "Linphone SDK ${PROJECT_VERSION} reference documentation")
set(JAVADOC_JAVA_REFERENCE "http://docs.oracle.com/javase/8/docs/api/")
set(JAVADOC_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/doc/java")
set(JAVADOC_LOGFILE "${CMAKE_CURRENT_BINARY_DIR}/javadoc.log")
configure_file("generate_javadoc.sh.in" "generate_javadoc.sh" @ONLY)
add_custom_target(javadoc
COMMAND "${CMAKE_CURRENT_BINARY_DIR}/generate_javadoc.sh"
)
endif()
if (ENABLE_TOOLS)
set(USE_BUNDLE )
if (IOS)
......
#!/bin/bash -x
packages='@JAVADOC_PACKAGES@'
classpaths='@JAVADOC_CLASSPATHS@'
title='@JAVADOC_TITLE@'
javaref='@JAVADOC_JAVA_REFERENCE@'
outputdir='@JAVADOC_OUTPUT_DIR@'
@Java_JAVADOC_EXECUTABLE@ ${packages} -classpath ${classpaths} -doctitle "${title}" -link ${javaref} -d ${outputdir} 2>&1 | tee @JAVADOC_LOGFILE@
grep -E '^[0-9]{1,3} errors?' @JAVADOC_LOGFILE@ &> /dev/null && exit 1
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment