From b78bce55b2cece1fb463879a3d1e8123d7ca9712 Mon Sep 17 00:00:00 2001 From: Jason Terhune Date: Thu, 8 Sep 2016 10:18:25 -0500 Subject: [PATCH] Configure gradle to compile devicetypes and smartapps. --- build.gradle | 30 ++++++++++++++++++- circle.yml | 6 ++-- .../energy-alerts.src/energy-alerts.groovy | 2 +- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 2334d49..2667f45 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ buildscript { username smartThingsArtifactoryUserName password smartThingsArtifactoryPassword } - url "http://artifactory.smartthings.com/libs-release-local" + url "https://artifactory.smartthings.com/libs-release-local" } } } @@ -27,9 +27,37 @@ buildscript { repositories { mavenLocal() jcenter() + maven { + credentials { + username smartThingsArtifactoryUserName + password smartThingsArtifactoryPassword + } + url "https://artifactory.smartthings.com/libs-release-local" + } +} + +sourceSets { + devicetypes { + groovy { + srcDirs = ['devicetypes'] + } + } + smartapps { + groovy { + srcDirs = ['smartapps'] + } + } } dependencies { + devicetypesCompile 'org.codehaus.groovy:groovy-all:2.4.7' + devicetypesCompile 'smartthings:appengine-z-wave:0.1.2' + devicetypesCompile 'smartthings:appengine-zigbee:0.1.11' + smartappsCompile 'org.codehaus.groovy:groovy-all:2.4.7' + smartappsCompile 'smartthings:appengine-common:0.1.8' + smartappsCompile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1' + smartappsCompile 'org.grails:grails-web:2.3.11' + smartappsCompile 'org.json:json:20140107' } slackSendMessage { diff --git a/circle.yml b/circle.yml index 3785924..0bd6c53 100644 --- a/circle.yml +++ b/circle.yml @@ -3,9 +3,9 @@ machine: version: oraclejdk8 -dependencies: - override: - - echo "Nothing to do." +checkout: + post: + - ./gradlew compileSmartappsGroovy compileDevicetypesGroovy test: override: diff --git a/smartapps/smartthings/energy-alerts.src/energy-alerts.groovy b/smartapps/smartthings/energy-alerts.src/energy-alerts.groovy index 4a4c9ff..bd394a1 100644 --- a/smartapps/smartthings/energy-alerts.src/energy-alerts.groovy +++ b/smartapps/smartthings/energy-alerts.src/energy-alerts.groovy @@ -64,7 +64,7 @@ def meterHandler(evt) { def lastValue = atomicState.lastValue as double atomicState.lastValue = meterValue - def dUnit ? evt.unit : "Watts" + def dUnit = evt.unit ?: "Watts" def aboveThresholdValue = aboveThreshold as int if (meterValue > aboveThresholdValue) {