- 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
-
Clone the git repository to your machine:
shell git clone https://github.com/ARMmbed/mbed-cloud-sdk-java.git -
Sets required environment/build variables in gradle.properties
-
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 buildNote that actions other than 'build are available; use./gradlew tasksto see a complete list
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.
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.cssTo 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.
The SDK is tested via a set of unit tests and integration tests.
- Unit tests can be run using
gradlew testcommand. They use JUnit framework and are present in src/test folder. - All integration tests are defined in mbed-cloud-sdk-testrunner.
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.