From e0a1862ce3c54b0839133256a3f8cc9d0db1ae86 Mon Sep 17 00:00:00 2001 From: Nicolas Oliver Date: Fri, 28 Jul 2017 10:48:48 -0300 Subject: [PATCH] Travis CI and Documentation Generation improvements * Use docker images from docker hub instead of building them on Travis * Fix doxygen warnings for C/C++ Documentation * Fix examples inclusion in documentation * Modify Travis build matrix to include stages and additional jobs * Update doxygen2jsdoc submodule * Add doxyport submodule * Generate documentation for each language in Travis * Add sonar.java.binaries to sonar-scan.sh Signed-off-by: Nicolas Oliver --- .dockerignore | 4 - .gitmodules | 6 +- .travis.yml | 146 +++++++++++++--------- Doxyfile.in | 2 +- Doxyfile.java.in | 19 +-- api/mraa/aio.hpp | 2 +- api/mraa/common.h | 30 +++-- api/mraa/common.hpp | 25 ++-- api/mraa/firmata.h | 2 +- api/mraa/gpio.h | 2 +- api/mraa/gpio.hpp | 2 +- api/mraa/i2c.hpp | 2 +- api/mraa/iio.h | 165 ++++++++++++++++++++++++- api/mraa/iio.hpp | 15 ++- api/mraa/iio_kernel_headers.h | 5 +- api/mraa/pwm.h | 1 + api/mraa/pwm.hpp | 2 +- api/mraa/spi.hpp | 4 +- api/mraa/types.h | 3 + api/mraa/types.hpp | 5 +- api/mraa/uart.h | 1 + api/mraa/uart.hpp | 7 +- api/mraa/uart_ow.h | 10 +- api/mraa/uart_ow.hpp | 4 +- docker-compose.yaml | 92 +++++++++----- docker/Dockerfile.android | 29 ----- docker/Dockerfile.base | 43 ------- docker/Dockerfile.java | 14 --- docker/Dockerfile.node | 16 --- docker/Dockerfile.python | 13 -- docker/Dockerfile.sonar | 39 ------ docs/96boards.md | 2 +- docs/building.md | 96 +++----------- docs/grossetete.md | 5 +- docs/imraa.md | 2 +- docs/index.java.md | 2 +- docs/index.md | 2 +- docs/mock.md | 5 +- doxygen2jsdoc | 2 +- doxyport | 1 + examples/c++/Iio-dummy.cpp | 3 +- scripts/build-doc.sh | 29 +++++ scripts/run-cmake.sh | 1 + scripts/sonar-scan.sh | 1 + src/javascript/CMakeLists.txt | 2 +- src/mraa.i | 13 -- src/python/python2/docs/CMakeLists.txt | 4 +- src/python/python2/docs/conf.py.in | 4 +- src/python/python2/docs/example.rst | 18 +-- src/python/python2/docs/index.rst | 8 +- src/python/python2/mraa2.i | 10 ++ 51 files changed, 486 insertions(+), 434 deletions(-) delete mode 100644 .dockerignore delete mode 100644 docker/Dockerfile.android delete mode 100644 docker/Dockerfile.base delete mode 100644 docker/Dockerfile.java delete mode 100644 docker/Dockerfile.node delete mode 100644 docker/Dockerfile.python delete mode 100644 docker/Dockerfile.sonar create mode 160000 doxyport create mode 100755 scripts/build-doc.sh diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index d7d615e..0000000 --- a/.dockerignore +++ /dev/null @@ -1,4 +0,0 @@ -Dockerfile -docker-compose.yaml -.scannerwork/ -.vscode/ diff --git a/.gitmodules b/.gitmodules index b2bc350..f185867 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,8 @@ [submodule "doxygen2jsdoc"] path = doxygen2jsdoc - url = https://github.com/arfoll/doxygen2jsdoc.git + url = https://github.com/intel-iot-devkit/doxygen2jsdoc.git + branch = master +[submodule "doxyport"] + path = doxyport + url = https://github.com/intel-iot-devkit/doxyport.git branch = master diff --git a/.travis.yml b/.travis.yml index eb7ce5f..8f73727 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,54 +3,6 @@ sudo: required language: cpp -compiler: - - clang - - gcc - -env: - - TARGET=doc - - TARGET=python2 - - TARGET=python3 - - TARGET=java - - TARGET=node4 - - TARGET=node5 - - TARGET=android - - TARGET=sonar-scan - - JSONPLAT=ON TARGET=python2 - - JSONPLAT=ON TARGET=python3 - - JSONPLAT=ON TARGET=java - - JSONPLAT=ON TARGET=node4 - - JSONPLAT=ON TARGET=node5 - - BUILDARCH=MOCK TARGET=python2 - - BUILDARCH=MOCK TARGET=python3 - - BUILDARCH=MOCK TARGET=java - - BUILDARCH=MOCK TARGET=node4 - - BUILDARCH=MOCK TARGET=node5 - -matrix: - exclude: - - compiler: clang - env: TARGET=java - - compiler: clang - env: JSONPLAT=ON TARGET=java - - compiler: clang - env: BUILDARCH=MOCK TARGET=java - - compiler: gcc - env: TARGET=android - - compiler: clang - env: TARGET=sonar-scan - allow_failures: - - compiler: gcc - env: JSONPLAT=ON TARGET=node4 - - compiler: clang - env: JSONPLAT=ON TARGET=node4 - - compiler: gcc - env: JSONPLAT=ON TARGET=node5 - - compiler: clang - env: JSONPLAT=ON TARGET=node5 - - compiler: gcc - env: TARGET=sonar-scan - services: - docker @@ -60,14 +12,90 @@ before_install: - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin -before_script: - - if [ "$CC" == "gcc" ]; then export CC=gcc-4.8; fi - - if [ "$CXX" == "g++" ]; then export CXX=g++-4.8; fi - - if [ "$CC" == "clang" ]; then export CC=clang-3.8; fi - - if [ "$CXX" == "clang++" ]; then export CXX=clang++-3.8; fi - - docker-compose build base - - if [ "$TARGET" == "android" ]; then docker-compose build java; fi - - docker-compose build ${TARGET} - -script: - - docker-compose run ${TARGET} +jobs: + fast_finish: true + allow_failures: + - env: TARGET=sonar-scan + - env: TARGET=ipk + - env: TARGET=rpm + include: + - &run-with-clang + stage: Clang 3.8 + env: TARGET=python2 + before_script: docker-compose pull ${TARGET} + script: + - export CC=clang-3.8 CXX=clang++-3.8 + - docker-compose run ${TARGET} + - BUILDARCH=MOCK docker-compose run ${TARGET} + - if [[ ${TARGET} != *"node"* ]]; then JSONPLAT=ON docker-compose run ${TARGET}; fi + - <<: *run-with-clang + env: TARGET=python3 + - <<: *run-with-clang + env: TARGET=node4 + - <<: *run-with-clang + env: TARGET=node5 + - <<: *run-with-clang + env: TARGET=node6 + - <<: *run-with-clang + env: TARGET=java + - &run-with-gcc-5 + stage: Gcc 5 + env: TARGET=python2 + before_script: docker-compose pull ${TARGET} + script: + - export CC=gcc-5 CXX=g++-5 + - docker-compose run ${TARGET} + - BUILDARCH=MOCK docker-compose run ${TARGET} + - if [[ ${TARGET} != *"node"* ]]; then JSONPLAT=ON docker-compose run ${TARGET}; fi + - <<: *run-with-gcc-5 + env: TARGET=python3 + - <<: *run-with-gcc-5 + env: TARGET=node4 + - <<: *run-with-gcc-5 + env: TARGET=node5 + - <<: *run-with-gcc-5 + env: TARGET=node6 + - <<: *run-with-gcc-5 + env: TARGET=java + - &run-with-gcc-6 + stage: Gcc 6 + env: TARGET=python2 + before_script: docker-compose pull ${TARGET} + script: + - export CC=gcc-6 CXX=g++-6 + - docker-compose run ${TARGET} + - BUILDARCH=MOCK docker-compose run ${TARGET} + - if [[ ${TARGET} != *"node"* ]]; then JSONPLAT=ON docker-compose run ${TARGET}; fi + - <<: *run-with-gcc-6 + env: TARGET=python3 + - <<: *run-with-gcc-6 + env: TARGET=node4 + - <<: *run-with-gcc-6 + env: TARGET=node5 + - <<: *run-with-gcc-6 + env: TARGET=node6 + - <<: *run-with-gcc-6 + env: TARGET=java + - &run-additional-jobs + stage: Additional Jobs + env: TARGET=doc + before_script: docker-compose pull ${TARGET} + script: + - export CC=clang-3.8 CXX=clang++-3.8 + - docker-compose run ${TARGET} + - <<: *run-additional-jobs + env: TARGET=android + - <<: *run-additional-jobs + env: TARGET=usbplat + - <<: *run-additional-jobs + env: TARGET=firmata + - <<: *run-additional-jobs + env: TARGET=imraa + - <<: *run-additional-jobs + env: TARGET=ftdi4442 + - <<: *run-additional-jobs + env: TARGET=ipk + - <<: *run-additional-jobs + env: TARGET=rpm + - <<: *run-additional-jobs + env: TARGET=sonar-scan diff --git a/Doxyfile.in b/Doxyfile.in index f997043..816f7ac 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -832,7 +832,7 @@ RECURSIVE = NO # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/docs/index.java.md # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded diff --git a/Doxyfile.java.in b/Doxyfile.java.in index db86d33..c925496 100644 --- a/Doxyfile.java.in +++ b/Doxyfile.java.in @@ -756,10 +756,9 @@ WARN_LOGFILE = INPUT = @CMAKE_CURRENT_SOURCE_DIR@/api/ \ @CMAKE_CURRENT_SOURCE_DIR@/api/mraa/ \ @CMAKE_CURRENT_SOURCE_DIR@/docs/ \ - @CMAKE_CURRENT_SOURCE_DIR@/docs/CONTRIBUTING.md \ + @CMAKE_CURRENT_SOURCE_DIR@/CONTRIBUTING.md \ @CMAKE_BINARY_DIR@/src/ \ - @CMAKE_CURRENT_SOURCE_DIR@/docs/index.java.md \ - @CMAKE_CURRENT_SOURCE_DIR@/README.md + @CMAKE_CURRENT_SOURCE_DIR@/docs/index.java.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -797,7 +796,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/docs/index.md # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -1810,18 +1809,6 @@ GENERATE_XML = YES XML_OUTPUT = xml -# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a -# validating XML parser to check the syntax of the XML files. -# This tag requires that the tag GENERATE_XML is set to YES. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify a XML DTD, which can be used by a -# validating XML parser to check the syntax of the XML files. -# This tag requires that the tag GENERATE_XML is set to YES. - -XML_DTD = - # If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program # listings (including syntax highlighting and cross-referencing information) to # the XML output. Note that enabling this will significantly increase the size diff --git a/api/mraa/aio.hpp b/api/mraa/aio.hpp index 5404739..e6ea2a1 100644 --- a/api/mraa/aio.hpp +++ b/api/mraa/aio.hpp @@ -60,7 +60,7 @@ class Aio * position. Check your board mapping for details. An arduino style layout * will have A0 as pin14 but AIO0. * - * @param void * to an AIO context + * @param aio_context void * to an AIO context */ Aio(void* aio_context) { diff --git a/api/mraa/common.h b/api/mraa/common.h index 3c8aba3..64ac6d8 100644 --- a/api/mraa/common.h +++ b/api/mraa/common.h @@ -27,13 +27,19 @@ #include #include "types.h" +/** Max size off Mraa Platform name */ #define MRAA_PLATFORM_NAME_MAX_SIZE 64 +/** Size off Mraa pin name */ #define MRAA_PIN_NAME_SIZE 12 +/** Bit Shift for Mraa sub platform */ #define MRAA_SUB_PLATFORM_BIT_SHIFT 9 +/** Mask for Mraa sub platform */ #define MRAA_SUB_PLATFORM_MASK (1< - #include +#include #include "iio.h" #include "types.hpp" namespace mraa { +/** Iio Event Data */ struct IioEventData { + /** Channel Type */ int channelType; + /** Modifier */ int modifier; + /** Type */ int type; + /** Direction */ int direction; + /** Channel */ int channel; + /** Channel 2 */ int channel2; + /** Difference */ int diff; }; +/** Iio Handler */ class IioHandler { public: + /** onIioEvent Handler */ virtual void onIioEvent(const IioEventData& eventData) = 0; + /** Destructor */ virtual ~IioHandler() {}; // add an empty destructor to get rid of warning }; @@ -56,7 +67,7 @@ public: * * This file defines the C++ iio interface for libmraa * - * @snippet iio_dummy_test.cpp Interesting + * @snippet Iio-dummy.cpp Interesting */ class Iio { diff --git a/api/mraa/iio_kernel_headers.h b/api/mraa/iio_kernel_headers.h index fab9bf4..2f7092b 100644 --- a/api/mraa/iio_kernel_headers.h +++ b/api/mraa/iio_kernel_headers.h @@ -115,12 +115,11 @@ enum iio_event_direction { /** * struct iio_event_data - The actual event being pushed to userspace - * @id: event identifier - * @timestamp: best estimate of time of event occurrence (often from - * the interrupt handler) */ struct iio_event_data { + /** event identifier */ unsigned long long int id; + /** best estimate of time of event occurrence (often from the interrupt handler) */ long long int timestamp; }; diff --git a/api/mraa/pwm.h b/api/mraa/pwm.h index d6f17df..a121e3b 100644 --- a/api/mraa/pwm.h +++ b/api/mraa/pwm.h @@ -45,6 +45,7 @@ extern "C" { #include "common.h" +/** Mraa Pwm Context */ typedef struct _pwm* mraa_pwm_context; /** diff --git a/api/mraa/pwm.hpp b/api/mraa/pwm.hpp index c75255a..8ef915b 100644 --- a/api/mraa/pwm.hpp +++ b/api/mraa/pwm.hpp @@ -71,7 +71,7 @@ class Pwm * Pwm constructor, takes a pointer to the PWM context and * initialises the class * - * @param void * to a PWM context + * @param pwm_context void * to a PWM context */ Pwm(void* pwm_context) { diff --git a/api/mraa/spi.hpp b/api/mraa/spi.hpp index f82aa95..b7df1dd 100644 --- a/api/mraa/spi.hpp +++ b/api/mraa/spi.hpp @@ -71,7 +71,7 @@ class Spi } /** - * Initialise SPI object using 'raw' mode. Mraa will go and grab the spidev device lablled /dev/spidev. + * Initialise SPI object using 'raw' mode. Mraa will go and grab the spidev device lablled /dev/spidev[bus].[cs] * * @param bus to use * @param cs to use @@ -89,7 +89,7 @@ class Spi * Spi Constructor, takes a pointer to a SPI context and initialises * the SPI class * - * @param void * to SPI context + * @param spi_context void * to SPI context */ Spi(void* spi_context) { diff --git a/api/mraa/types.h b/api/mraa/types.h index 2d0a217..a4ba1af 100644 --- a/api/mraa/types.h +++ b/api/mraa/types.h @@ -245,6 +245,9 @@ typedef enum { MRAA_I2C_HIGH = 2 /**< up to 3.4Mhz */ } mraa_i2c_mode_t; +/** + * Enum representing different uart parity states + */ typedef enum { MRAA_UART_PARITY_NONE = 0, MRAA_UART_PARITY_EVEN = 1, diff --git a/api/mraa/types.hpp b/api/mraa/types.hpp index a527df0..2a9ee17 100644 --- a/api/mraa/types.hpp +++ b/api/mraa/types.hpp @@ -231,7 +231,7 @@ typedef enum { } Pinmodes; /** - * Enum reprensenting different i2c speeds/modes + * Enum representing different i2c speeds/modes */ typedef enum { I2C_STD = 0, /**< up to 100Khz */ @@ -239,6 +239,9 @@ typedef enum { I2C_HIGH = 2 /**< up to 3.4Mhz */ } I2cMode; +/** + * Enum representing different uart parity states + */ typedef enum { UART_PARITY_NONE = 0, UART_PARITY_EVEN = 1, diff --git a/api/mraa/uart.h b/api/mraa/uart.h index d07356e..b375e77 100644 --- a/api/mraa/uart.h +++ b/api/mraa/uart.h @@ -45,6 +45,7 @@ extern "C" { #include "common.h" +/** Mraa Uart Context */ typedef struct _uart* mraa_uart_context; /** diff --git a/api/mraa/uart.hpp b/api/mraa/uart.hpp index 8bd5d34..6b9c6ed 100644 --- a/api/mraa/uart.hpp +++ b/api/mraa/uart.hpp @@ -64,7 +64,7 @@ class Uart * Uart Constructor, takes a string to the path of the serial * interface that is needed. * - * @param uart the index of the uart set to use + * @param path the index of the uart set to use */ Uart(std::string path) { @@ -79,7 +79,7 @@ class Uart * Uart Constructor, takes a pointer to the UART context and initialises * the UART class * - * @param void * to a UART context + * @param uart_context void * to a UART context */ Uart(void* uart_context) { @@ -160,7 +160,7 @@ class Uart /** * Write bytes in String object to a device * - * @param string to write + * @param data string to write * @return the number of bytes written, or -1 if an error occurred */ int @@ -273,7 +273,6 @@ class Uart /** * Set the blocking state for write operations * - * @param dev The UART context * @param nonblock new nonblocking state * @return Result of operation */ diff --git a/api/mraa/uart_ow.h b/api/mraa/uart_ow.h index 8551166..53c2c6b 100644 --- a/api/mraa/uart_ow.h +++ b/api/mraa/uart_ow.h @@ -64,16 +64,20 @@ extern "C" { #include "common.h" #include "uart.h" -/* 8 bytes (64 bits) for a device rom code */ +/** 8 bytes (64 bits) for a device rom code */ #define MRAA_UART_OW_ROMCODE_SIZE 8 -/* for now, we simply use the normal MRAA UART context */ +/** for now, we simply use the normal MRAA UART context */ typedef struct _mraa_uart_ow { + /** Uart Context */ mraa_uart_context uart; - /* search state */ + /** search state */ unsigned char ROM_NO[MRAA_UART_OW_ROMCODE_SIZE]; /* 8 byte (64b) rom code */ + /** Context laxt discrepancy */ int LastDiscrepancy; + /** Context las family discrepancy */ int LastFamilyDiscrepancy; + /** Context las device flag */ mraa_boolean_t LastDeviceFlag; } *mraa_uart_ow_context; diff --git a/api/mraa/uart_ow.hpp b/api/mraa/uart_ow.hpp index 84297e7..972310f 100644 --- a/api/mraa/uart_ow.hpp +++ b/api/mraa/uart_ow.hpp @@ -46,8 +46,8 @@ class UartOW * UartOW Constructor, takes a pin number which will map directly to the * linux uart number, this 'enables' the uart, nothing more * - * @throws std::invalid_argument in case of error * @param uart the index of the uart to use + * @throws std::invalid_argument in case of error */ UartOW(int uart) { @@ -62,8 +62,8 @@ class UartOW * UartOW Constructor, takes a string to the path of the serial * interface that is needed. * - * @throws std::invalid_argument in case of error * @param path the file path for the UART to use + * @throws std::invalid_argument in case of error */ UartOW(std::string path) { diff --git a/docker-compose.yaml b/docker-compose.yaml index 8d1475d..999c390 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,14 +3,7 @@ version: '2.1' services: base: - image: mraa-base - build: - context: . - dockerfile: docker/Dockerfile.base - args: - - http_proxy - - https_proxy - - no_proxy + image: dnoliver/mraa-base environment: - http_proxy - https_proxy @@ -41,17 +34,18 @@ services: doc: extends: base + image: dnoliver/mraa-all environment: + - BUILDSWIG=ON + - BUILDSWIGPYTHON=ON + - BUILDSWIGNODE=ON + - BUILDSWIGJAVA=ON - BUILDDOC=ON - command: bash -c "./scripts/run-cmake.sh && make -Cbuild doc" + command: bash -c "./scripts/run-cmake.sh && ./scripts/build-doc.sh" sonar-scan: extends: base - image: mraa-sonar - build: - dockerfile: docker/Dockerfile.sonar - args: - - NODE_VERSION=v5.12.0 + image: dnoliver/mraa-all environment: - BUILDSWIG=ON - BUILDSWIGPYTHON=ON @@ -69,11 +63,52 @@ services: - GITHUB_TOKEN command: bash -c "./scripts/run-cmake.sh && cd build && ../scripts/sonar-scan.sh" + usbplat: + extends: base + image: dnoliver/mraa-all + environment: + - USBPLAT=ON + command: bash -c "./scripts/run-cmake.sh && make -Cbuild" + + firmata: + extends: base + image: dnoliver/mraa-all + environment: + - FIRMATA=ON + command: bash -c "./scripts/run-cmake.sh && make -Cbuild" + + imraa: + extends: base + image: dnoliver/mraa-all + environment: + - IMRAA=ON + - FIRMATA=ON + command: bash -c "./scripts/run-cmake.sh && make -Cbuild" + + ftdi4442: + extends: base + image: dnoliver/mraa-all + environment: + - FTDI4222=ON + command: bash -c "./scripts/run-cmake.sh && make -Cbuild" + + ipk: + extends: base + image: dnoliver/mraa-all + environment: + - IPK=ON + command: bash -c "./scripts/run-cmake.sh && make -Cbuild package" + + rpm: + extends: base + image: dnoliver/mraa-all + environment: + - RPM=ON + command: bash -c "./scripts/run-cmake.sh && make -Cbuild package" + python2: extends: base - image: mraa-python - build: - dockerfile: docker/Dockerfile.python + image: dnoliver/mraa-python environment: - BUILDSWIG=ON - BUILDSWIGPYTHON=ON @@ -87,9 +122,7 @@ services: java: extends: base - image: mraa-java - build: - dockerfile: docker/Dockerfile.java + image: dnoliver/mraa-java environment: - BUILDSWIG=ON - BUILDSWIGJAVA=ON @@ -97,20 +130,14 @@ services: android: extends: java - image: mraa-android - build: - dockerfile: docker/Dockerfile.android + image: dnoliver/mraa-android environment: - BUILDARCH=PERIPHERALMAN command: bash -c "./scripts/build-android.sh" node4: extends: base - image: mraa-node4 - build: - dockerfile: docker/Dockerfile.node - args: - - NODE_VERSION=v4.4.7 + image: dnoliver/mraa-node4 environment: - BUILDSWIG=ON - BUILDSWIGNODE=ON @@ -118,7 +145,8 @@ services: node5: extends: node4 - image: mraa-node5 - build: - args: - - NODE_VERSION=v5.12.0 + image: dnoliver/mraa-node5 + + node6: + extends: node4 + image: dnoliver/mraa-node6 diff --git a/docker/Dockerfile.android b/docker/Dockerfile.android deleted file mode 100644 index 579da2b..0000000 --- a/docker/Dockerfile.android +++ /dev/null @@ -1,29 +0,0 @@ -FROM mraa-java - -WORKDIR /opt - -# Install CMake 3.6.2 -RUN wget -q https://cmake.org/files/v3.6/cmake-3.6.2-Linux-x86_64.sh && \ - mkdir /opt/cmake && \ - sh /opt/cmake-3.6.2-Linux-x86_64.sh --prefix=/opt/cmake --skip-license && \ - ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake && \ - cmake --version && \ - rm -fr /opt/cmake-3.6.2-Linux-x86_64.sh - -# Android NDK build Dependencies -RUN wget -q https://dl.google.com/android/repository/android-ndk-r14b-linux-x86_64.zip && \ - unzip -qq android-ndk-r14b-linux-x86_64.zip && \ - rm -fr android-ndk-r14b-linux-x86_64.zip -ENV NDK_HOME /opt/android-ndk-r14b -ENV NDK_MODULE_PATH /opt/android-ndk-r14b - -# Android Things library -RUN wget -q https://github.com/androidthings/native-libandroidthings/archive/0.4.1-devpreview.tar.gz && \ - tar xf 0.4.1-devpreview.tar.gz && \ - rm -fr /opt/0.4.1-devpreview.tar.gz -ENV ANDROIDTHINGS_NATIVE_LIB /opt/native-libandroidthings-0.4.1-devpreview - -# Set Workdir -WORKDIR $MRAA_SRC_DIR - -CMD bash diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base deleted file mode 100644 index 464f624..0000000 --- a/docker/Dockerfile.base +++ /dev/null @@ -1,43 +0,0 @@ -FROM ubuntu:16.04 - -ENV DEBIAN_FRONTEND noninteractive - -# Update apt-get -RUN apt-get -y update && \ - # Install apt-utils - apt-get -y --no-install-recommends install apt-utils && \ - # Main Build Dependencies - apt-get -y --no-install-recommends install git build-essential cmake clang-3.8 \ - g++-4.8 wget ca-certificates libpcre3 libpcre3-dev python unzip \ - # Docs Build Dependencies - python-sphinx doxygen graphviz \ - # Json Platform Build Dependencies - pkg-config libjson0 libjson0-dev \ - # Imraa Platform Build Dependencies - libudev-dev \ - # Doc Build Dependencies - python-sphinx doxygen graphviz - -# Set library download folder to /opt -WORKDIR /opt - -# Swig Build Dependencies -ARG SWIG_VERSION=3.0.10 -RUN wget -q http://iotdk.intel.com/misc/tr/swig-$SWIG_VERSION.tar.gz && \ - tar xf swig-$SWIG_VERSION.tar.gz && cd swig-$SWIG_VERSION && \ - ./configure --prefix=/usr/ && make -j8 && make -j8 install && cd .. && \ - rm -fr /opt/swig-$SWIG_VERSION.tar.gz - -# FTDI4222 Build Dependencies -ARG FTDI4222_VERSION=linux-1.3.1.117 -RUN mkdir libft4222-$FTDI4222_VERSION && cd libft4222-$FTDI4222_VERSION && \ - wget -q http://www.ftdichip.com/Support/SoftwareExamples/libft4222-$FTDI4222_VERSION.tgz && \ - tar xf libft4222-$FTDI4222_VERSION.tgz && ./install4222.sh && \ - rm -fr libft4222-$FTDI4222_VERSION.tgz - -# Set Workdir -ARG MRAA_SRC_DIR=/usr/src/app -ENV MRAA_SRC_DIR $MRAA_SRC_DIR -WORKDIR $MRAA_SRC_DIR - -CMD bash diff --git a/docker/Dockerfile.java b/docker/Dockerfile.java deleted file mode 100644 index a9c9fec..0000000 --- a/docker/Dockerfile.java +++ /dev/null @@ -1,14 +0,0 @@ -FROM mraa-base - -# Update apt-get -RUN apt-get -y update && \ - # Java Build Dependencies - apt-get -y --no-install-recommends install default-jre default-jdk - -# Set JAVA_HOME -ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/ - -# Set Workdir -WORKDIR $MRAA_SRC_DIR - -CMD bash diff --git a/docker/Dockerfile.node b/docker/Dockerfile.node deleted file mode 100644 index ce4825b..0000000 --- a/docker/Dockerfile.node +++ /dev/null @@ -1,16 +0,0 @@ -FROM mraa-base - -WORKDIR /opt - -# Node.js Build Dependencies -RUN wget -q -O - https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash -ENV NVM_DIR /root/.nvm -ARG NODE_VERSION -RUN . $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use $NODE_VERSION && \ - npm install -g node-gyp && node-gyp install -ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH - -# Set Workdir -WORKDIR $MRAA_SRC_DIR - -CMD bash diff --git a/docker/Dockerfile.python b/docker/Dockerfile.python deleted file mode 100644 index e117c2c..0000000 --- a/docker/Dockerfile.python +++ /dev/null @@ -1,13 +0,0 @@ -FROM mraa-base - -# Update apt-get -RUN apt-get -y update && \ - # Python 2 Build Dependencies - apt-get -y --no-install-recommends install python python-dev \ - # Python 3 Build Dependencies - python3 python3-dev - -# Set Workdir -WORKDIR $MRAA_SRC_DIR - -CMD bash diff --git a/docker/Dockerfile.sonar b/docker/Dockerfile.sonar deleted file mode 100644 index 0ea3c7a..0000000 --- a/docker/Dockerfile.sonar +++ /dev/null @@ -1,39 +0,0 @@ -FROM mraa-base - -# Update apt-get -RUN apt-get -y update && \ - # Python 2 Build Dependencies - apt-get -y --no-install-recommends install python python-dev \ - # Python 3 Build Dependencies - python3 python3-dev \ - # Java Build Dependencies - default-jre default-jdk - -# Set JAVA_HOME -ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/ - -WORKDIR /opt - -# Node.js Build Dependencies -RUN wget -q -O - https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash -ENV NVM_DIR /root/.nvm -ARG NODE_VERSION -RUN . $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use $NODE_VERSION && \ - npm install -g node-gyp && node-gyp install -ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH - -# Static Code Analysis Scanner -ENV SONAR_DIR /opt/sonar -ENV SONAR_VER "3.0.3.778" -WORKDIR $SONAR_DIR -RUN wget https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_VER}-linux.zip && \ - wget https://sonarqube.com/static/cpp/build-wrapper-linux-x86.zip && \ - unzip sonar-scanner-cli-${SONAR_VER}-linux.zip && \ - unzip build-wrapper-linux-x86.zip && \ - rm sonar-scanner-cli-${SONAR_VER}-linux.zip build-wrapper-linux-x86.zip -ENV PATH $SONAR_DIR/sonar-scanner-${SONAR_VER}-linux/bin:$SONAR_DIR/build-wrapper-linux-x86:$PATH - -# Set Workdir -WORKDIR $MRAA_SRC_DIR - -CMD bash diff --git a/docs/96boards.md b/docs/96boards.md index ff37ebf..0b8425b 100644 --- a/docs/96boards.md +++ b/docs/96boards.md @@ -1,4 +1,4 @@ -96Boards Development Platform {#96boards} +96Boards Development Platform {#_96boards} ============================= 96Boards is a range of hardware specifications created by Linaro to make the latest ARM-based processors available to developers at a reasonable cost. The specifications are open and define a standard board layout for SoC-agnostic (processor independent) development platforms that can be used by software application, hardware device, kernel and other system software developers. Boards produced to the 96Boards specifications are suitable for rapid prototyping, hobbyist projects or incorporation into new systems for a wide range of applications including desktop and laptop computing, the digital home, digital signage, point of sale (POS), high-end audio, robotics and drones, artificial intelligence, virtual reality, IoT and industrial control. diff --git a/docs/building.md b/docs/building.md index 4aeac14..4550217 100644 --- a/docs/building.md +++ b/docs/building.md @@ -4,7 +4,7 @@ libmraa uses cmake in order to make compilation relatively painless. CMake runs build out of tree so the recommended way is to clone from git and make a `build/` directory inside the clone directory. -For building imraa check [building imraa](./imraa.md) +For building imraa check @ref buildingimraa page. ## Build dependencies Not all these are required but if you're unsure of what you're doing this is what you'll need: @@ -95,8 +95,10 @@ Building doc, this will require [SPHINX](http://sphinx-doc.org) & `-DBUILDDOC=ON` You will also require clone git submodules from your existing checkout: `git submodule update --init --recursive` -The from doxygen2jsdoc dir: - `npm install mkdirp commander lodash bluebird pegjs` +Then from doxygen2jsdoc dir: + `npm install` +Then from doxyport dir: + `make setup` Override build architecture (this is useful because on x86 ARM code is not compiled so use this flag to force the target arch) @@ -166,7 +168,7 @@ To run, make sure `libmraajava.so` is in `LD_LIBRARY_PATH` jave -cp $DIR_WHERE_YOU_INSTALLED_MRAA/mraa.jar:. Example ~~~~~~~~~~~~~ -If you want to add or improve Java bindings for mraa, please follow the [Creating Java Bindings Guide](https://github.com/intel-iot-devkit/upm/blob/master/docs/creating_java_bindings.md). +If you want to add or improve Java bindings for mraa, please follow the Creating Java Bindings Guide. ## Building an IPK/RPM package using `cpack` @@ -195,7 +197,8 @@ The [Things Native Library](https://github.com/androidthings/native-libandroidth [FindAndroidThings.cmake](https://github.com/androidthings/native-libandroidthings/blob/master/FindAndroidThings.cmake). Make sure the directory containing this module is added to the CMAKE_MODULE_PATH. -#### NDK r14b +### NDK r14b + ~~~~~~~~~~~~~{.sh} cmake -DBUILDSWIG=OFF -DBUILDARCH=PERIPHERALMAN -DANDROID_TOOLCHAIN_NAME=x86-i686 -DCMAKE_TOOLCHAIN_FILE=/path/to/android-ndk-r14b/build/cmake/android.toolchain.cmake -DCMAKE_MODULE_PATH=/path/to/native-libandroidthings .. ~~~~~~~~~~~~~ @@ -212,61 +215,6 @@ Requirements: **NOTE:** docker-compose is an optional requirement. It actually make running complex docker build and run command easier. But you can just use docker to build and run. -### Docker Images Hierarchy - -To improve build times and images sizes, mraa use a build hierarchy to incrementally -create a build environment. Find below a brief description of them: - -1. **mraa-base:** Provides the basic infrastructure and tools to compile C/C++ code and documentation. -2. **mraa-python:** Provides the python2/python3 build tools. Depends on `mraa-base`. -3. **mraa-java:** Provides the Java build tools. Depends on `mraa-base`. -4. **mraa-android:** Provides the Android Things build tools. Depends on `mraa-java`. -5. **mraa-node4:** Provides the Node.js v4.4.7 build tools. Depends on `mraa-base`. -6. **mraa-node5:** Same as `mraa-node4`, but using Node.js v5.12.0. -7. **mraa-sonar:** Provides the tools for running [Sonar Qube](https://www.sonarqube.org/) Scans. Depends on `mraa-base`. - -**NOTE:** If you want to know which tools are installed for each of the mraa targets, -just take a look at the `docker/` folder. All the related Dockerfiles are stored there! - -### Building Docker Images - -**tl;dr:** Just use this commands to build the hierarchy: - -```sh -# Build the base image -$ docker-compose build base -# Build python image -$ docker-compose build python -# Build java image -$ docker-compose build java -# Build node4 image -$ docker-compose build node4 -# Build node5 image -$ docker-compose build node5 -# Build android things image -$ docker-compose build android -# Build sonar image -$ docker-compose build sonar-scan -``` - -**docker-compose** will take a look at the `docker-compose.yaml` file in the repository -root directory, and build the requested target for you. At the end, docker-compose will -tag the image built with an `mraa-` prefix. You can check them by running `docker images`. - -If you don't want to use docker-compose, you can also use `docker build` to generate every image. -For example, to create the base image, you can do: - -```sh -# From the repository root folder -$ docker build -d docker/Dockerfile.base -t mraa-base . -``` - -Now, you don't actually need to build every image to start working. Let's say you -are a Python developer, and has no idea what Node.js is, just build the base and -python image! - -**NOTE:** If you work on Android Things, you will need the base, java, and android image. - ### Using Docker Images to build Mraa **tl;dr:** Just use this commands to build mraa: @@ -284,6 +232,8 @@ $ docker-compose run java $ docker-compose run node4 # Build mraa node5 package $ docker-compose run node5 +# Build mraa node6 package +$ docker-compose run node6 # Build mraa for android things package $ docker-compose run android # Run Sonar Qube Scans for mraa @@ -291,7 +241,8 @@ $ docker-compose run sonar-scan ``` **docker-compose** will take a look at the `docker-compose.yaml` file in the repository -root directory, and run an specific command to build mraa for the requested target. +root directory, pull the required docker image, and run an specific command to build +mraa for the requested target. Once the build is completed, you will have a `build/` folder in the repository root with all the compiled code. This `build/` folder is created by using a docker volume. The `build\` folder contents is reused each time you execute `docker-compose run [TARGET]`. @@ -318,7 +269,7 @@ $ docker run \ --env BUILDSWIGPYTHON=ON \ --env BUILDSWIGJAVA=OFF \ --env BUILDSWIGNODE=OFF \ - mraa-python \ + dnoliver/mraa-python \ bash -c "./scripts/run-cmake.sh && make -Cbuild _python2-mraa" ``` @@ -332,25 +283,6 @@ to proxy settings: Visit [this link](https://docs.docker.com/engine/admin/systemd/#httphttps-proxy) to configure docker daemon behind a proxy. -**docker build fails to fetch packages from internet** - -docker-compose will automatically take `http_proxy`, `https_proxy`, and `no_proxy` -environment variables and use it as build arguments. Be sure to properly configure -this variables before building. - -docker, unlinke docker-compose, do not take the proxy settings from the environment -automatically. You need to send them as build arguments: - -```sh -# From the repository root folder -$ docker build \ - -d docker/Dockerfile.base \ - --build-arg http_proxy=$http_proxy \ - --build-arg https_proxy=$https_proxy \ - --build-arg no_proxy=$no_proxy \ - -t mraa-base . -``` - **docker run fails to access the internet** docker-compose will automatically take `http_proxy`, `https_proxy`, and `no_proxy` @@ -371,6 +303,6 @@ $ docker run \ --env http_proxy=$http_proxy \ --env https_proxy=$https_proxy \ --env no_proxy=$no_proxy \ - mraa-python \ + dnoliver/mraa-python \ bash -c "./scripts/run-cmake.sh && make -Cbuild _python2-mraa" ``` diff --git a/docs/grossetete.md b/docs/grossetete.md index f27ee06..93f0c22 100644 --- a/docs/grossetete.md +++ b/docs/grossetete.md @@ -1,5 +1,6 @@ -{#grossetete} +Grosstete {#grossetete} +========= -You probably meant to go here: @joule. +You probably meant to go here: @ref joule. Note: This page will be deleted in the future, don't link to it! diff --git a/docs/imraa.md b/docs/imraa.md index 84fa9b2..60bcb3d 100644 --- a/docs/imraa.md +++ b/docs/imraa.md @@ -6,7 +6,7 @@ MRAA_GENERIC_FIRMATA subplatform to the first process that calls imraa_init ## Build dependencies To build imraa, you'll need to build mraa with -DIMRAA=ON and all the normal -dependencies for build mraa, see [Building mraa](./building.md). +dependencies for build mraa, see @ref building page. You'll also need the following: * [dfu-utils-cross](https://github.com/arduino/dfu-utils-cross) or dfu 0.8 (0.9 does not work well with the 101). Precompiled binaries can be found on diff --git a/docs/index.java.md b/docs/index.java.md index 2dfcc3e..0515438 100644 --- a/docs/index.java.md +++ b/docs/index.java.md @@ -56,7 +56,7 @@ Specific platform information for supported platforms is documented here: Sometimes it just doesn't want to work, let us try and help you, you can file issues in github or join us in #mraa on freenode IRC, hang around for a little while because we're not necessarily on 24/7, but we'll get back to you! Have a -glance at our @debugging page too +glance at our @ref debugging page too ## COMPILING diff --git a/docs/index.md b/docs/index.md index ea9633a..1cfcb38 100644 --- a/docs/index.md +++ b/docs/index.md @@ -56,7 +56,7 @@ Specific platform information for supported platforms is documented here: Sometimes it just doesn't want to work, let us try and help you, you can file issues in github or join us in #mraa on freenode IRC, hang around for a little while because we're not necessarily on 24/7, but we'll get back to you! Have a -glance at our @debugging page too +glance at our @ref debugging page too ## COMPILING diff --git a/docs/mock.md b/docs/mock.md index 37c9847..f7a5d31 100644 --- a/docs/mock.md +++ b/docs/mock.md @@ -26,7 +26,8 @@ See [SPI mock header](../include/mock/mock_board_spi.h#L38-L39) for constant val * Single UART port. All functions are supported, but many are simple stubs. Write always succeeds, read returns 'Z' symbol as many times as `read()` requested. -We plan to develop it further and all [contributions](../CONTRIBUTING.md) are more than welcome. +We plan to develop it further and all contributions are more than welcome. See our +@ref contributing page for more information. See the table below for pin layout and features @@ -47,7 +48,7 @@ Building -------- Generally all the building steps are the same as listed -in the [main building guide](./building.md), you just need to set some specific +in the main @ref building guide, you just need to set some specific CMake options. ### Linux diff --git a/doxygen2jsdoc b/doxygen2jsdoc index 9cc90b7..67cad69 160000 --- a/doxygen2jsdoc +++ b/doxygen2jsdoc @@ -1 +1 @@ -Subproject commit 9cc90b7976252b2d14b7956230c5870097e1f008 +Subproject commit 67cad692720982ac3cbd99bf1c3421edc69b08f9 diff --git a/doxyport b/doxyport new file mode 160000 index 0000000..db3e1a6 --- /dev/null +++ b/doxyport @@ -0,0 +1 @@ +Subproject commit db3e1a6eb8677d3166d90d82c3068689803ce547 diff --git a/examples/c++/Iio-dummy.cpp b/examples/c++/Iio-dummy.cpp index 0672ec3..118531b 100644 --- a/examples/c++/Iio-dummy.cpp +++ b/examples/c++/Iio-dummy.cpp @@ -107,6 +107,7 @@ protected: } }; +//! [Interesting] int main() { @@ -154,4 +155,4 @@ main() delete iio_device; return EXIT_SUCCESS; } - +//! [Interesting] diff --git a/scripts/build-doc.sh b/scripts/build-doc.sh new file mode 100755 index 0000000..88a7288 --- /dev/null +++ b/scripts/build-doc.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -x +set -e + +# Install doxygen2jsdoc dependencies +cd doxygen2jsdoc && npm install && cd .. + +# Install doxyport dependencies +cd doxyport && make setup && cd .. + +# Make Documentation +make -j8 -Cbuild + +# Make Java Documentation +cd build/src/java && echo ../../../src/mraa.i > mraa.i.list && \ +../../../doxyport/doxyport mraa.i.list \ + --cmake ../../compile_commands.json \ + --source ../../../api,../../../api/mraa \ + --destination $(pwd)/ \ + --convert-protected-to-private \ + --output mraa-java-files.txt \ + --mapping ../../../examples/samples.mapping.txt && \ +doxygen Doxyfile && cd ../../../ + +# Copy output to build/html/ directory +cp -r build/src/python/python2/docs/html build/html/python && \ +cp -r build/src/java/html build/html/java && \ +cp build/jsdoc/ternjs/mraa/doc.js build/html/node/mraa_tern.js diff --git a/scripts/run-cmake.sh b/scripts/run-cmake.sh index 01b8107..f8d4ec5 100755 --- a/scripts/run-cmake.sh +++ b/scripts/run-cmake.sh @@ -21,6 +21,7 @@ cmake \ -DINSTALLTOOLS=$INSTALLTOOLS \ -DBUILDTESTS=$BUILDTESTS \ -DUSEPYTHON3TESTS=$USEPYTHON3TESTS \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -H. \ -Bbuild diff --git a/scripts/sonar-scan.sh b/scripts/sonar-scan.sh index f02d283..544abfb 100755 --- a/scripts/sonar-scan.sh +++ b/scripts/sonar-scan.sh @@ -37,6 +37,7 @@ sonar_cmd_base="build-wrapper-linux-x86-64 --out-dir ${bw_output_path} make clea -Dsonar.projectBaseDir=${MRAA_SRC_DIR} \ -Dsonar.sources=${MRAA_SRC_DIR} \ -Dsonar.inclusions='api/**/*,CMakeLists.txt,examples/**/*,imraa/**/*,include/**/*,src/**/*,tests/**/*' \ + -Dsonar.java.binaries='src' \ -Dsonar.coverage.exclusions='**/*' \ -Dsonar.cfamily.build-wrapper-output=${bw_output_path} \ -Dsonar.host.url=https://sonarqube.com \ diff --git a/src/javascript/CMakeLists.txt b/src/javascript/CMakeLists.txt index fe537c4..aaf1fd6 100644 --- a/src/javascript/CMakeLists.txt +++ b/src/javascript/CMakeLists.txt @@ -108,7 +108,7 @@ if (BUILDDOC) find_package(Yuidoc) if (YUIDOC_FOUND) add_custom_target(jsdoc ALL - COMMAND ${CMAKE_SOURCE_DIR}/doxygen2jsdoc/docgen.js -m mraa i xml/ -o jsdoc -c ${CMAKE_CURRENT_SOURCE_DIR}/doxygen2jsdoc_custom.json --strict -h + COMMAND ${CMAKE_SOURCE_DIR}/doxygen2jsdoc/docgen.js -m mraa -i xml/ -o jsdoc -c ${CMAKE_CURRENT_SOURCE_DIR}/doxygen2jsdoc_custom.json --strict COMMAND ${YUIDOC_EXECUTABLE} -C --no-sort --helpers ${CMAKE_SOURCE_DIR}/doxygen2jsdoc/generators/yuidoc/tmpl/mraa/helper.js --themedir ${CMAKE_SOURCE_DIR}/doxygen2jsdoc/generators/yuidoc/tmpl/mraa -o html/node jsdoc/yuidoc/mraa COMMAND ${CMAKE_SOURCE_DIR}/doxygen2jsdoc/tolower.js -i html/node WORKING_DIRECTORY ${CMAKE_BINARY_DIR} diff --git a/src/mraa.i b/src/mraa.i index fd77c1c..2a81f6a 100644 --- a/src/mraa.i +++ b/src/mraa.i @@ -4,19 +4,6 @@ %include std_string.i %include exception.i -#ifdef DOXYGEN - //and doesn't seem to work correctly in SWIG's preprocessor - #ifdef SWIGPYTHON2 - %include common_hpp_doc.i - %include gpio_class_doc.i - %include i2c_class_doc.i - %include pwm_class_doc.i - %include aio_class_doc.i - %include spi_class_doc.i - %include uart_class_doc.i - #endif -#endif - %{ #include "common.hpp" #include "types.hpp" diff --git a/src/python/python2/docs/CMakeLists.txt b/src/python/python2/docs/CMakeLists.txt index c2a7c98..3079b22 100644 --- a/src/python/python2/docs/CMakeLists.txt +++ b/src/python/python2/docs/CMakeLists.txt @@ -19,7 +19,7 @@ if (DOXYGEN_FOUND) set (SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html") # doc .rst locations - set (SPHINX_DOC_LOATION "${CMAKE_CURRENT_SOURCE_DIR}") + set (SPHINX_DOC_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}") configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" @@ -31,7 +31,7 @@ if (DOXYGEN_FOUND) ${SPHINX_EXECUTABLE} -b html -c "${BINARY_BUILD_DIR}" -d "${SPHINX_CACHE_DIR}" - "${SPHINX_DOC_LOATION}" + "${SPHINX_DOC_LOCATION}" "${SPHINX_HTML_DIR}" COMMENT "Building HTML documentation with Sphinx" ) diff --git a/src/python/python2/docs/conf.py.in b/src/python/python2/docs/conf.py.in index fa662ff..f1b86c4 100644 --- a/src/python/python2/docs/conf.py.in +++ b/src/python/python2/docs/conf.py.in @@ -31,7 +31,7 @@ sys.path.insert(0, "@CMAKE_BINARY_DIR@/src/python/python2") # ones. extensions = [ 'sphinx.ext.autodoc', - 'sphinx.ext.viewcode', + 'sphinx.ext.viewcode' ] # Add any paths that contain templates here, relative to this directory. @@ -131,7 +131,7 @@ html_theme_path = ['@SPHINX_THEME_DIR@'] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +#html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied diff --git a/src/python/python2/docs/example.rst b/src/python/python2/docs/example.rst index ab11be5..f627455 100644 --- a/src/python/python2/docs/example.rst +++ b/src/python/python2/docs/example.rst @@ -12,12 +12,12 @@ Hello GPIO Here is the simplest Gpio program in mraa. -.. literalinclude:: ../../../examples/python/hello_gpio.py +.. literalinclude:: ../../../../examples/python/hello_gpio.py :prepend: import mraa :start-after: import mraa GPIO Interrupt (isr) -=================== +==================== The GPIO module allows you to set an interrupt on a GPIO. This interrupt is controlled by the mode that the 'edge' is in. Before setting another isr please @@ -27,7 +27,7 @@ values. **Note:** Galileo Gen1 only supports EDGE_BOTH -.. literalinclude:: ../../../examples/python/hello_isr.py +.. literalinclude:: ../../../../examples/python/hello_isr.py :prepend: import mraa :start-after: import mraa @@ -44,11 +44,11 @@ The I2c module module has a number of different ways of interacting with the i2c bus, including a number of overloaded read() calls and the writeReg() helper function. -.. literalinclude:: ../../../examples/python/bmp85.py +.. literalinclude:: ../../../../examples/python/bmp85.py :prepend: x = m.I2c(0) :start-after: x = m.I2c(0) -.. literalinclude:: ../../../docs/i2c.txt +.. literalinclude:: ../../../../docs/i2c.txt Pwm === @@ -56,7 +56,7 @@ Pwm The PWM module is rather simple, note that different hardware support PWM generation is various different ways so results may vary. -.. literalinclude:: ../../../examples/python/cycle-pwm3.py +.. literalinclude:: ../../../../examples/python/cycle-pwm3.py :prepend: import mraa :start-after: import mraa @@ -67,7 +67,7 @@ The ADC is typically provided on a dedicated or shared SPI bus, this is abstracted by the Linux kernel as spidev and abstracted again by mraa. It is fairly simple in use. -.. literalinclude:: ../../../examples/python/aio.py +.. literalinclude:: ../../../../examples/python/aio.py :prepend: import mraa :start-after: import mraa @@ -82,12 +82,12 @@ Here's a simple pair of programs comprising a sender and receiver pair. Sender: -.. literalinclude:: ../../../examples/python/uart_sender.py +.. literalinclude:: ../../../../examples/python/uart_sender.py :prepend: import mraa :start-after: import mraa Receiver: -.. literalinclude:: ../../../examples/python/uart_receiver.py +.. literalinclude:: ../../../../examples/python/uart_receiver.py :prepend: import mraa :start-after: import mraa diff --git a/src/python/python2/docs/index.rst b/src/python/python2/docs/index.rst index a693f8c..c800d47 100644 --- a/src/python/python2/docs/index.rst +++ b/src/python/python2/docs/index.rst @@ -6,7 +6,7 @@ Welcome to mraa's documentation! ================================ -.. include:: ../../../docs/index.md +.. include:: ../../../../docs/index.md :start-after: ============== :end-before: ## API @@ -41,13 +41,15 @@ a C library. Generally attaching gdb to python works well, build mraa with debug symbols and set breakpoints either in the SWIG _wrap functions, the C++ method/functions or the underlying C function. More info can be found on the C/C++ documentation: + * `Debugging <../debugging.html>`_ * `Building from source <../building.html>`_ API Changelog ============= -.. include:: ../../../docs/index.md - :start-after: API Changelog + +`Changelog <../changelog.html>`_ + Indices and tables ================== diff --git a/src/python/python2/mraa2.i b/src/python/python2/mraa2.i index 81f9158..814ba59 100644 --- a/src/python/python2/mraa2.i +++ b/src/python/python2/mraa2.i @@ -2,4 +2,14 @@ %feature("autodoc", "3"); +#ifdef DOXYGEN + %include common_hpp_doc.i + %include gpio_class_doc.i + %include i2c_class_doc.i + %include pwm_class_doc.i + %include aio_class_doc.i + %include spi_class_doc.i + %include uart_class_doc.i +#endif + %include ../mraapython.i