Skip to content

Latest commit

 

History

History
68 lines (51 loc) · 4.57 KB

File metadata and controls

68 lines (51 loc) · 4.57 KB

Arm Pelion Cloud SDK for Java

CircleCI

Builds Docs codecov Maintainability Download License

Prerequisites

  • Java > 1.7 tested with Oracle JDK
  • Gradle. Use gradle wrapper if possible
  • Python > 2.7 or > 3.6. In case build scripts are used or for running test suite
  • grep > 2.5. In case build scripts are used
  • git. In case build scripts are used

Building

  1. Clone the git repository to your machine:

    shell git clone https://github.com/ARMmbed/mbed-cloud-sdk-java.git

  2. Sets required environment/build variables in gradle.properties

  3. In order to build the SDK, you can call gradle tasks directly or use wrapper scripts present in ./scripts folder

    shell ./gradlew build (on Linux) gradlew.bat build (on Windows) or python scripts/sdk.py <action> e.g. python sdk.py build Note that actions other than 'build are available; use ./gradlew tasks to see a complete list

Formatting the sources

The build uses checkstyle to ensure that the source code has a consistent format. You can automatically apply formatting to the code by running ./gradlew spotlessApply in the project root at any time.

Javadoc

It is possible to customise the javadoc output by specifying file paths of header, footer, style sheet, etc. in gradle.properties. e.g. on Windows:

    javadocStylesheet=C:\\Users\\john\\mbed-cloud-sdk-java\\stylesheet.css

To regenerate the javadoc, just run the following command:

    ./gradlew clean javadoc
  • Style sheet: (javadoc -stylesheetfile option) Specifies the path of an alternate HTML stylesheet file. Without this option, the Javadoc tool automatically creates a stylesheet file stylesheet.css that is hard-coded in the Javadoc tool. This option enables you to override this default. The filename can be any name and is not restricted to stylesheet.css.

  • Top: (javadoc -top option) Specifies the text to be placed at the top of each output file.

  • Header: (javadoc -header option) Specifies the header text to be placed at the top of each output file. The header will be placed to the right of the upper navigation bar. header may contain HTML tags and white space. Any internal quotation marks within header may have to be escaped.

  • Bottom: (javadoc -bottom option) Specifies the text to be placed at the bottom of each output file. The text will be placed at the bottom of the page, below the lower navigation bar. The text may contain HTML tags and white space. Any internal quotation marks within text may have to be escaped.

  • Footer: (javadoc -footer option) Specifies the footer text to be placed at the bottom of each output file. The footer will be placed to the right of the lower navigation bar. footer may contain HTML tags and white space. Any internal quotation marks within footer may have to be escaped.

Testing

The SDK is tested via a set of unit tests and integration tests.

  • Unit tests can be run using gradlew test command. They use JUnit framework and are present in src/test folder.
  • All integration tests are defined in mbed-cloud-sdk-testrunner.

Releasing

The SDK is set up to perform CI/CD on every commit to master. Only approved builds are then uploaded to JCenter and Maven Central. The version number is bumped automatically. It is however possible to overwrite it by setting the following environment variable MBED_CLOUD_SDK_VERSION_TO_SET with the wanted version value.