Skip to content

Commit

Permalink
Build option to check documentation [6877] (eProsima#862)
Browse files Browse the repository at this point in the history
* Refs #6724. New option CHECK_DOCUMENTATION avoids download from readthedocs.

* Refs #6724. Avoid usage of dot tool.

* Refs #6724. Fixing indentation on TimedEvent.h

* Refs #6724. Not installing manual.

* Refs #6724. Fixing AnnotationParameterValue.h

* Refs #6724. Not requiring wget and unzip.

* Refs #6724. Fixing TypeIdentifierTypes.h

* Refs #6724. Fixing more headers.
  • Loading branch information
IkerLuengo authored and MiguelCompany committed Nov 20, 2019
1 parent daabbc7 commit 2feecb9
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 319 deletions.
70 changes: 44 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,17 @@ endif()
###############################################################################
# Add an option to toggle the generation of the API documentation.
option(BUILD_DOCUMENTATION "Use doxygen to create product documentation" OFF)
option(CHECK_DOCUMENTATION "Use doxygen to check code documentation" OFF)

if(EPROSIMA_INSTALLER)
set(BUILD_DOCUMENTATION ON)
set(DOXYGEN_SHOULD_SKIP_THIS_PUBLIC "DOXYGEN_SHOULD_SKIP_THIS_PUBLIC")
endif()

if(CHECK_DOCUMENTATION)
set(BUILD_DOCUMENTATION ON)
endif()

if(BUILD_DOCUMENTATION)
find_package(Doxygen)
if(NOT DOXYGEN_FOUND)
Expand All @@ -304,17 +309,20 @@ if(BUILD_DOCUMENTATION)
elseif(WIN32)
set(DOXYFILE_MAKE make.bat)
endif()
find_program(WGET_EXE wget)
if(WGET_EXE)
message(STATUS "Found WGet: ${WGET_EXE}")
else()
message(FATAL_ERROR "wget is needed to build the documentation. Please install it correctly")
endif()
find_program(UNZIP_EXE unzip)
if(UNZIP_EXE)
message(STATUS "Found Unzip: ${UNZIP_EXE}")
else()
message(FATAL_ERROR "unzip is needed to build the documentation. Please install it correctly")

if(NOT CHECK_DOCUMENTATION)
find_program(WGET_EXE wget)
if(WGET_EXE)
message(STATUS "Found WGet: ${WGET_EXE}")
else()
message(FATAL_ERROR "wget is needed to build the documentation. Please install it correctly")
endif()
find_program(UNZIP_EXE unzip)
if(UNZIP_EXE)
message(STATUS "Found Unzip: ${UNZIP_EXE}")
else()
message(FATAL_ERROR "unzip is needed to build the documentation. Please install it correctly")
endif()
endif()

# Target to create documentation directories
Expand All @@ -323,7 +331,11 @@ if(BUILD_DOCUMENTATION)
COMMENT "Creating documentation directory" VERBATIM)

### Doxygen ########################3

if(CHECK_DOCUMENTATION)
set(USE_DOT NO)
else()
set(USE_DOT YES)
endif()
# Configure the template doxyfile for or specific project
configure_file(doxyfile.in ${PROJECT_BINARY_DIR}/doxyfile @ONLY IMMEDIATE)
# Add custom target to run doxygen when ever the project is build
Expand All @@ -348,21 +360,25 @@ if(BUILD_DOCUMENTATION)
configure_file(doc/README.html.in ${README_LOCATION}/README.html @ONLY IMMEDIATE)

### ReadTheDocs ########################
if(NOT CHECK_DOCUMENTATION)
add_custom_target(readthedocs
COMMAND "${WGET_EXE}" "https://media.readthedocs.org/htmlzip/eprosima-fast-rtps/v${PROJECT_VERSION}/eprosima-fast-rtps.zip"
COMMAND "${UNZIP_EXE}" "eprosima-fast-rtps.zip" -d "${PROJECT_BINARY_DIR}/doc/"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PROJECT_BINARY_DIR}/doc/manual"
COMMAND ${CMAKE_COMMAND} -E rename "${PROJECT_BINARY_DIR}/doc/eprosima-fast-rtps-v${PROJECT_VERSION}" "${PROJECT_BINARY_DIR}/doc/manual"
COMMAND ${CMAKE_COMMAND} -E remove "eprosima-fast-rtps.zip"
)

add_custom_target(readthedocs
COMMAND "${WGET_EXE}" "https://media.readthedocs.org/htmlzip/eprosima-fast-rtps/v${PROJECT_VERSION}/eprosima-fast-rtps.zip"
COMMAND "${UNZIP_EXE}" "eprosima-fast-rtps.zip" -d "${PROJECT_BINARY_DIR}/doc/"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PROJECT_BINARY_DIR}/doc/manual"
COMMAND ${CMAKE_COMMAND} -E rename "${PROJECT_BINARY_DIR}/doc/eprosima-fast-rtps-v${PROJECT_VERSION}" "${PROJECT_BINARY_DIR}/doc/manual"
COMMAND ${CMAKE_COMMAND} -E remove "eprosima-fast-rtps.zip"
)

add_dependencies(readthedocs docdirs)
add_dependencies(readthedocs docdirs)
endif()

add_custom_target(doc ALL
COMMENT "Generated project documentation" VERBATIM)

add_dependencies(doc doxygen readthedocs)
add_dependencies(doc doxygen)
if(NOT CHECK_DOCUMENTATION)
add_dependencies(doc readthedocs)
endif()
endif()

###############################################################################
Expand Down Expand Up @@ -409,10 +425,12 @@ if(BUILD_DOCUMENTATION)
COMPONENT documentation
)

install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/manual
DESTINATION ${DOC_INSTALL_DIR}
COMPONENT documentation
)
if(NOT CHECK_DOCUMENTATION)
install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/manual
DESTINATION ${DOC_INSTALL_DIR}
COMPONENT documentation
)
endif()

### Documentation component
set(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation")
Expand Down
2 changes: 1 addition & 1 deletion doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2088,7 +2088,7 @@ HIDE_UNDOC_RELATIONS = YES
# set to NO
# The default value is: NO.

HAVE_DOT = YES
HAVE_DOT = @USE_DOT@

# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of
Expand Down
42 changes: 1 addition & 41 deletions include/fastrtps/types/AnnotationParameterValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,6 @@ class ExtendedAnnotationParameterValue
*/
ExtendedAnnotationParameterValue& operator=(ExtendedAnnotationParameterValue &&x);

#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

/*!
* @brief This function returns the maximum serialized size of an object
* depending on the buffer alignment.
* @param current_alignment Buffer alignment.
* @return Maximum serialized size.
*/
//static size_t getMaxCdrSerializedSize(size_t current_alignment = 0);

#endif

/*!
* @brief This function returns the serialized size of a data depending on the buffer alignment.
* @param data Data which is calculated its serialized size.
Expand Down Expand Up @@ -546,18 +534,6 @@ class AnnotationParameterValue
*/
ExtendedAnnotationParameterValue& extended_value();

#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

/*!
* @brief This function returns the maximum serialized size of an object
* depending on the buffer alignment.
* @param current_alignment Buffer alignment.
* @return Maximum serialized size.
*/
//static size_t getMaxCdrSerializedSize(size_t current_alignment = 0);

#endif

/*!
* @brief This function returns the serialized size of a data depending on the buffer alignment.
* @param data Data which is calculated its serialized size.
Expand Down Expand Up @@ -883,18 +859,6 @@ class AppliedAnnotationParameter
return m_value;
}

#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

/*!
* @brief This function returns the maximum serialized size of an object
* depending on the buffer alignment.
* @param current_alignment Buffer alignment.
* @return Maximum serialized size.
*/
//static size_t getMaxCdrSerializedSize(size_t current_alignment = 0);

#endif

/*!
* @brief This function returns the serialized size of a data depending on the buffer alignment.
* @param data Data which is calculated its serialized size.
Expand Down Expand Up @@ -971,7 +935,6 @@ class AppliedAnnotationParameter
inline const AnnotationParameterValue& value() const { return m_value; }
inline AnnotationParameterValue& value() { return m_value; }
static size_t getMaxCdrSerializedSize(size_t current_alignment = 0);
static size_t getCdrSerializedSize(const AppliedAnnotationParameter& data, size_t current_alignment = 0);
void serialize(eprosima::fastcdr::Cdr &cdr) const;
void deserialize(eprosima::fastcdr::Cdr &cdr);
Expand Down Expand Up @@ -1011,7 +974,6 @@ class AppliedAnnotation
inline const AppliedAnnotationParameterSeq& param_seq() const { return m_param_seq; }
inline AppliedAnnotationParameterSeq& param_seq() { return m_param_seq; }

//static size_t getMaxCdrSerializedSize(size_t current_alignment = 0);
static size_t getCdrSerializedSize(const AppliedAnnotation& data, size_t current_alignment = 0);
void serialize(eprosima::fastcdr::Cdr &cdr) const;
void deserialize(eprosima::fastcdr::Cdr &cdr);
Expand Down Expand Up @@ -1060,7 +1022,6 @@ class AppliedVerbatimAnnotation
inline const std::string& text() const { return m_text; }
inline std::string& text() { return m_text; }

//static size_t getMaxCdrSerializedSize(size_t current_alignment = 0);
static size_t getCdrSerializedSize(const AppliedVerbatimAnnotation& data, size_t current_alignment = 0);
void serialize(eprosima::fastcdr::Cdr &cdr) const;
void deserialize(eprosima::fastcdr::Cdr &cdr);
Expand Down Expand Up @@ -1114,7 +1075,6 @@ class AppliedBuiltinMemberAnnotations
inline const std::string& hash_id() const { return m_hash_id; }
inline std::string& hash_id() { return m_hash_id; }

//static size_t getMaxCdrSerializedSize(size_t current_alignment = 0);
static size_t getCdrSerializedSize(const AppliedBuiltinMemberAnnotations& data, size_t current_alignment = 0);
void serialize(eprosima::fastcdr::Cdr &cdr) const;
void deserialize(eprosima::fastcdr::Cdr &cdr);
Expand All @@ -1136,4 +1096,4 @@ class AppliedBuiltinMemberAnnotations
} // namespace fastrtps
} // namespace eprosima

#endif // _ANNOTATIONPARAMETERVALUE_H_
#endif // _ANNOTATIONPARAMETERVALUE_H_
12 changes: 0 additions & 12 deletions include/fastrtps/types/TypeIdentifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,18 +360,6 @@ class TypeIdentifier
*/
RTPS_DllAPI ExtendedTypeDefn& extended_defn();

#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

/*!
* @brief This function returns the maximum serialized size of an object
* depending on the buffer alignment.
* @param current_alignment Buffer alignment.
* @return Maximum serialized size.
*/
//static size_t getMaxCdrSerializedSize(size_t current_alignment = 0);

#endif

/*!
* @brief This function returns the serialized size of a data depending on the buffer alignment.
* @param data Data which is calculated its serialized size.
Expand Down
Loading

0 comments on commit 2feecb9

Please sign in to comment.