Skip to content

Dev | Gradle

zero edited this page Jan 24, 2019 · 4 revisions

Describes IoT Engine Gradle build that affect your project

Create new Project

Determine new project belongs which parent project, which will be affect to your steps:

For example: create project bacnet in :edge:connector

  • Step 1: Create folder mkdir -p iot-engine/edge/connector/bacnet
  • Step 2: Create build.gradle and gradle.properties in iot-engine/edge/connector/bacnet
  • Step 3: Append include ':edge:connector:bacnet' in iot-engine/settings.gradle
  • Step 4: Tweak iot-engine/edge/connector/bacnet/build.gradle - Add project dependencies
    dependencies {
        compile project(':core:base')
        compile "com.serotonin:bacnet4j:5.0.0-SNAPSHOT"
    }
  • Step 5: Add more information into iot-engine/edge/connector/bacnet/gradle.properties
    title=<your project title>
    executable=<true|false>
    mainClass=com.nubeiot.core.NubeLauncher
    mainVerticle=<your_verticle_java_file>
    In which:
    • your_verticle_java_file must be extended from one of:

      @See Unit-and-Container

    • executable:

      • true : if you're writing new service
      • false: if you're writing new core unit
  • Step 6: Add README.md describes your project

Project properties

Some useful project properties:

  • executable:

    • true : if you're writing new service
    • false: if you're writing new core unit
  • standalone: (true|false) if you want to build fat-jar. Never be in :core

  • dockerable: (true|false) if you want to dockerize application. Never be in :core

  • generated: (true|false) if you want to generate java class from Vertx annotation @Codegen

  • serviceDescriptor: (string_no-space) it is mandatory property in case of you're writing service in :edge:module, :edge:connector or :edge:rule