diff --git a/.editorconfig b/.editorconfig index b13636fa..17937eeb 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,9 +6,14 @@ root = true # Unix-style newlines with a newline ending every file [*] insert_final_newline = true +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true # Markdown [*.md] -indent_style = space -indent_size = 2 trim_trailing_whitespace = false + +# Gradle +[*.gradle] +indent_size = 4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..7a158a04 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.DS_Store +build/ +.idea/ +.gradle/ +*.java +.gradletasknamecache diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..d6956fce --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +language: java +jdk: + - oraclejdk8 +env: + - TERM=dumb + +deploy: + provider: releases + api_key: + secure: ${GH_TOKEN} + file_glob: true + file: 'java-sdk/*/build/libs/*.jar' + skip_cleanup: true + on: + tags: true + +before_install: + - cd java-sdk + +after_deploy: + - ./gradlew bintrayUpload diff --git a/README.md b/README.md index 56c65ea6..97aa4066 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # RADAR-Schemas -Discussion of the schemas for RADAR-CNS + +[![Build Status](https://travis-ci.org/RADAR-CNS/RADAR-Schemas.svg?branch=master)](https://travis-ci.org/RADAR-CNS/RADAR-Schemas) + +[Avro schemas](https://avro.apache.org/docs/1.8.1/spec.html) used in RADAR-CNS. ## Contributing diff --git a/common/aggregator/double_aggregator.avsc b/commons/aggregator/double_aggregator.avsc similarity index 100% rename from common/aggregator/double_aggregator.avsc rename to commons/aggregator/double_aggregator.avsc diff --git a/common/aggregator/double_array_aggregator.avsc b/commons/aggregator/double_array_aggregator.avsc similarity index 100% rename from common/aggregator/double_array_aggregator.avsc rename to commons/aggregator/double_array_aggregator.avsc diff --git a/common/application/application_record_counts.avsc b/commons/application/application_record_counts.avsc similarity index 100% rename from common/application/application_record_counts.avsc rename to commons/application/application_record_counts.avsc diff --git a/common/application/application_server_status.avsc b/commons/application/application_server_status.avsc similarity index 100% rename from common/application/application_server_status.avsc rename to commons/application/application_server_status.avsc diff --git a/common/application/application_uptime.avsc b/commons/application/application_uptime.avsc similarity index 100% rename from common/application/application_uptime.avsc rename to commons/application/application_uptime.avsc diff --git a/common/biovotion/biovotion_vsm_acceleration.avsc b/commons/biovotion/biovotion_vsm_acceleration.avsc similarity index 100% rename from common/biovotion/biovotion_vsm_acceleration.avsc rename to commons/biovotion/biovotion_vsm_acceleration.avsc diff --git a/common/biovotion/biovotion_vsm_battery_state.avsc b/commons/biovotion/biovotion_vsm_battery_state.avsc similarity index 100% rename from common/biovotion/biovotion_vsm_battery_state.avsc rename to commons/biovotion/biovotion_vsm_battery_state.avsc diff --git a/common/biovotion/biovotion_vsm_blood_pulse_wave.avsc b/commons/biovotion/biovotion_vsm_blood_pulse_wave.avsc similarity index 100% rename from common/biovotion/biovotion_vsm_blood_pulse_wave.avsc rename to commons/biovotion/biovotion_vsm_blood_pulse_wave.avsc diff --git a/common/biovotion/biovotion_vsm_energy.avsc b/commons/biovotion/biovotion_vsm_energy.avsc similarity index 100% rename from common/biovotion/biovotion_vsm_energy.avsc rename to commons/biovotion/biovotion_vsm_energy.avsc diff --git a/common/biovotion/biovotion_vsm_galvanic_skin_response.avsc b/commons/biovotion/biovotion_vsm_galvanic_skin_response.avsc similarity index 100% rename from common/biovotion/biovotion_vsm_galvanic_skin_response.avsc rename to commons/biovotion/biovotion_vsm_galvanic_skin_response.avsc diff --git a/common/biovotion/biovotion_vsm_heart_rate.avsc b/commons/biovotion/biovotion_vsm_heart_rate.avsc similarity index 100% rename from common/biovotion/biovotion_vsm_heart_rate.avsc rename to commons/biovotion/biovotion_vsm_heart_rate.avsc diff --git a/common/biovotion/biovotion_vsm_heart_rate_variability.avsc b/commons/biovotion/biovotion_vsm_heart_rate_variability.avsc similarity index 100% rename from common/biovotion/biovotion_vsm_heart_rate_variability.avsc rename to commons/biovotion/biovotion_vsm_heart_rate_variability.avsc diff --git a/common/biovotion/biovotion_vsm_respiration_rate.avsc b/commons/biovotion/biovotion_vsm_respiration_rate.avsc similarity index 100% rename from common/biovotion/biovotion_vsm_respiration_rate.avsc rename to commons/biovotion/biovotion_vsm_respiration_rate.avsc diff --git a/common/biovotion/biovotion_vsm_spo2.avsc b/commons/biovotion/biovotion_vsm_spo2.avsc similarity index 100% rename from common/biovotion/biovotion_vsm_spo2.avsc rename to commons/biovotion/biovotion_vsm_spo2.avsc diff --git a/common/biovotion/biovotion_vsm_temperature.avsc b/commons/biovotion/biovotion_vsm_temperature.avsc similarity index 100% rename from common/biovotion/biovotion_vsm_temperature.avsc rename to commons/biovotion/biovotion_vsm_temperature.avsc diff --git a/common/empatica/empatica_e4_acceleration.avsc b/commons/empatica/empatica_e4_acceleration.avsc similarity index 100% rename from common/empatica/empatica_e4_acceleration.avsc rename to commons/empatica/empatica_e4_acceleration.avsc diff --git a/common/empatica/empatica_e4_battery_level.avsc b/commons/empatica/empatica_e4_battery_level.avsc similarity index 100% rename from common/empatica/empatica_e4_battery_level.avsc rename to commons/empatica/empatica_e4_battery_level.avsc diff --git a/common/empatica/empatica_e4_blood_volume_pulse.avsc b/commons/empatica/empatica_e4_blood_volume_pulse.avsc similarity index 100% rename from common/empatica/empatica_e4_blood_volume_pulse.avsc rename to commons/empatica/empatica_e4_blood_volume_pulse.avsc diff --git a/common/empatica/empatica_e4_electrodermal_activity.avsc b/commons/empatica/empatica_e4_electrodermal_activity.avsc similarity index 100% rename from common/empatica/empatica_e4_electrodermal_activity.avsc rename to commons/empatica/empatica_e4_electrodermal_activity.avsc diff --git a/common/empatica/empatica_e4_inter_beat_interval.avsc b/commons/empatica/empatica_e4_inter_beat_interval.avsc similarity index 100% rename from common/empatica/empatica_e4_inter_beat_interval.avsc rename to commons/empatica/empatica_e4_inter_beat_interval.avsc diff --git a/common/empatica/empatica_e4_sensor_status.avsc b/commons/empatica/empatica_e4_sensor_status.avsc similarity index 100% rename from common/empatica/empatica_e4_sensor_status.avsc rename to commons/empatica/empatica_e4_sensor_status.avsc diff --git a/common/empatica/empatica_e4_tag.avsc b/commons/empatica/empatica_e4_tag.avsc similarity index 100% rename from common/empatica/empatica_e4_tag.avsc rename to commons/empatica/empatica_e4_tag.avsc diff --git a/common/empatica/empatica_e4_temperature.avsc b/commons/empatica/empatica_e4_temperature.avsc similarity index 100% rename from common/empatica/empatica_e4_temperature.avsc rename to commons/empatica/empatica_e4_temperature.avsc diff --git a/common/key/measurement_key.avsc b/commons/key/measurement_key.avsc similarity index 100% rename from common/key/measurement_key.avsc rename to commons/key/measurement_key.avsc diff --git a/common/key/windowed_key.avsc b/commons/key/windowed_key.avsc similarity index 100% rename from common/key/windowed_key.avsc rename to commons/key/windowed_key.avsc diff --git a/common/pebble/pebble2_acceleration.avsc b/commons/pebble/pebble2_acceleration.avsc similarity index 100% rename from common/pebble/pebble2_acceleration.avsc rename to commons/pebble/pebble2_acceleration.avsc diff --git a/common/pebble/pebble2_battery_level.avsc b/commons/pebble/pebble2_battery_level.avsc similarity index 100% rename from common/pebble/pebble2_battery_level.avsc rename to commons/pebble/pebble2_battery_level.avsc diff --git a/common/pebble/pebble2_heart_rate.avsc b/commons/pebble/pebble2_heart_rate.avsc similarity index 100% rename from common/pebble/pebble2_heart_rate.avsc rename to commons/pebble/pebble2_heart_rate.avsc diff --git a/common/pebble/pebble2_heart_rate_filtered.avsc b/commons/pebble/pebble2_heart_rate_filtered.avsc similarity index 100% rename from common/pebble/pebble2_heart_rate_filtered.avsc rename to commons/pebble/pebble2_heart_rate_filtered.avsc diff --git a/common/phone/phone_acceleration.avsc b/commons/phone/phone_acceleration.avsc similarity index 100% rename from common/phone/phone_acceleration.avsc rename to commons/phone/phone_acceleration.avsc diff --git a/common/phone/phone_battery_level.avsc b/commons/phone/phone_battery_level.avsc similarity index 100% rename from common/phone/phone_battery_level.avsc rename to commons/phone/phone_battery_level.avsc diff --git a/common/phone/phone_call.avsc b/commons/phone/phone_call.avsc similarity index 100% rename from common/phone/phone_call.avsc rename to commons/phone/phone_call.avsc diff --git a/common/phone/phone_light.avsc b/commons/phone/phone_light.avsc similarity index 100% rename from common/phone/phone_light.avsc rename to commons/phone/phone_light.avsc diff --git a/common/phone/phone_relative_location.avsc b/commons/phone/phone_relative_location.avsc similarity index 100% rename from common/phone/phone_relative_location.avsc rename to commons/phone/phone_relative_location.avsc diff --git a/common/phone/phone_sms.avsc b/commons/phone/phone_sms.avsc similarity index 100% rename from common/phone/phone_sms.avsc rename to commons/phone/phone_sms.avsc diff --git a/common/phone/phone_user_interaction.avsc b/commons/phone/phone_user_interaction.avsc similarity index 100% rename from common/phone/phone_user_interaction.avsc rename to commons/phone/phone_user_interaction.avsc diff --git a/java-sdk/build.gradle b/java-sdk/build.gradle new file mode 100644 index 00000000..82799151 --- /dev/null +++ b/java-sdk/build.gradle @@ -0,0 +1,122 @@ +//---------------------------------------------------------------------------// +// Configuration // +//---------------------------------------------------------------------------// + +plugins { + id 'com.commercehub.gradle.plugin.avro-base' version '0.9.0' + id 'com.jfrog.bintray' version '1.7.3' +} + +subprojects { + apply plugin: 'java' + apply plugin: 'java-library' + apply plugin: 'com.jfrog.bintray' + apply plugin: 'com.commercehub.gradle.plugin.avro-base' + apply plugin: 'maven-publish' + + version = '0.1-SNAPSHOT' + group = 'org.radarcns' + ext.githubRepo = 'RADAR-CNS/RADAR-Schemas' + + targetCompatibility = '1.7' + sourceCompatibility = '1.7' + + ext.avroVersion = '1.8.1' + + ext.vcsUrl = 'https://github.com/' + githubRepo + '.git' + ext.issueUrl = 'https://github.com/' + githubRepo + '/issues' + ext.website = 'http://radar-cns.org' + + repositories { + jcenter() + maven { url 'http://dl.bintray.com/typesafe/maven-releases' } + } + + dependencies { + api group: 'org.apache.avro', name: 'avro', version: avroVersion + } + + ext.pomConfig = { + licenses { + license { + name "The Apache Software License, Version 2.0" + url "http://www.apache.org/licenses/LICENSE-2.0.txt" + distribution 'repo' + } + } + developers { + developer { + id 'herkulano' + name 'Herculano Campos' + email 'herculano@goldenarm.com' + organization 'Golden Arm Inc.' + } + developer { + id 'fnobilia' + name 'Francesco Nobilia' + email 'francesco.nobilia@kcl.ac.uk' + organization 'King\'s College London' + } + developer { + id 'blootsvoets' + name 'Joris Borgdorff' + email 'joris@thehyve.nl' + organization 'The Hyve' + } + } + issueManagement { + system 'GitHub' + url issueUrl + } + organization { + name 'RADAR-CNS' + url website + } + scm { + connection 'scm:git:' + vcsUrl + url vcsUrl + } + } + ext.sharedManifest = manifest { + attributes("Implementation-Title": rootProject.name, + "Implementation-Version": version) + } + + jar { + manifest.from sharedManifest + } + // custom tasks for creating source/javadoc jars + task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.output + manifest.from sharedManifest + } + + task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir + manifest.from sharedManifest + } + + // add javadoc/source jar tasks as artifacts + artifacts { + archives sourcesJar, javadocJar + } + + ext.avroOutputDir = file('src/main/java') + + clean { + delete avroOutputDir + } +} + +//---------------------------------------------------------------------------// +// Testing // +//---------------------------------------------------------------------------// + + + +task wrapper(type: Wrapper) { + gradleVersion = '3.4.1' + distributionUrl distributionUrl.replace("bin", "all") +} diff --git a/java-sdk/gradle/wrapper/gradle-wrapper.jar b/java-sdk/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..188bc2c0 Binary files /dev/null and b/java-sdk/gradle/wrapper/gradle-wrapper.jar differ diff --git a/java-sdk/gradle/wrapper/gradle-wrapper.properties b/java-sdk/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..31764595 --- /dev/null +++ b/java-sdk/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Apr 04 09:32:46 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip diff --git a/java-sdk/gradlew b/java-sdk/gradlew new file mode 100755 index 00000000..4453ccea --- /dev/null +++ b/java-sdk/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save ( ) { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/java-sdk/gradlew.bat b/java-sdk/gradlew.bat new file mode 100644 index 00000000..e95643d6 --- /dev/null +++ b/java-sdk/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/java-sdk/radar-schemas-commons/build.gradle b/java-sdk/radar-schemas-commons/build.gradle new file mode 100644 index 00000000..dea5b9a8 --- /dev/null +++ b/java-sdk/radar-schemas-commons/build.gradle @@ -0,0 +1,62 @@ +ext.artifactName = 'radar-schemas-commons' +ext.description = 'RADAR Schemas Commons SDK' + +//---------------------------------------------------------------------------// +// AVRO file manipulation // +//---------------------------------------------------------------------------// +task generateAvro(type: com.commercehub.gradle.plugin.avro.GenerateAvroJavaTask) { + source rootProject.fileTree('../commons') { + include '**/*.avsc' + } + outputDir avroOutputDir +} + +compileJava.dependsOn generateAvro + +//---------------------------------------------------------------------------// +// Publishing // +//---------------------------------------------------------------------------// + +publishing { + publications { + RadarCommonsPublication(MavenPublication) { + from components.java + artifact sourcesJar + artifact javadocJar + groupId project.group + artifactId artifactName + version project.version + pom.withXml { + def root = asNode() + root.appendNode('description', description) + root.appendNode('name', artifactName) + root.appendNode('url', vcsUrl) + root.children().last() + pomConfig + } + } + } +} + +bintray { + user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') + key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') + override = false + publications = ['RadarCommonsPublication'] + pkg { + repo = project.group + name = rootProject.name + userOrg = artifactName + licenses = ['Apache-2.0'] + websiteUrl = website + issueTrackerUrl = issueUrl + vcsUrl = vcsUrl + githubRepo = githubRepo + githubReleaseNotesFile = 'README.md' + version { + name = project.version + desc = description + vcsTag = System.getenv('TRAVIS_TAG') + released = new Date() + } + } +} diff --git a/java-sdk/radar-schemas-questionnaire/build.gradle b/java-sdk/radar-schemas-questionnaire/build.gradle new file mode 100644 index 00000000..58f9bcaf --- /dev/null +++ b/java-sdk/radar-schemas-questionnaire/build.gradle @@ -0,0 +1,62 @@ +ext.artifactName = 'radar-schemas-questionnaire' +ext.description = 'RADAR Schemas Questionnaire SDK' + +//---------------------------------------------------------------------------// +// AVRO file manipulation // +//---------------------------------------------------------------------------// +task generateAvro(type: com.commercehub.gradle.plugin.avro.GenerateAvroJavaTask) { + source rootProject.fileTree('../questionnaire') { + include '**/*.avsc' + } + outputDir avroOutputDir +} + +compileJava.dependsOn generateAvro + +//---------------------------------------------------------------------------// +// Publishing // +//---------------------------------------------------------------------------// + +publishing { + publications { + RadarQuestionnairePublication(MavenPublication) { + from components.java + artifact sourcesJar + artifact javadocJar + groupId project.group + artifactId artifactName + version project.version + pom.withXml { + def root = asNode() + root.appendNode('description', description) + root.appendNode('name', artifactName) + root.appendNode('url', vcsUrl) + root.children().last() + pomConfig + } + } + } +} + +bintray { + user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') + key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') + override = false + publications = ['RadarQuestionnairePublication'] + pkg { + repo = project.group + name = rootProject.name + userOrg = artifactName + licenses = ['Apache-2.0'] + websiteUrl = website + issueTrackerUrl = issueUrl + vcsUrl = vcsUrl + githubRepo = githubRepo + githubReleaseNotesFile = 'README.md' + version { + name = project.version + desc = description + vcsTag = System.getenv('TRAVIS_TAG') + released = new Date() + } + } +} diff --git a/java-sdk/radar-schemas-restapi/build.gradle b/java-sdk/radar-schemas-restapi/build.gradle new file mode 100644 index 00000000..b640426f --- /dev/null +++ b/java-sdk/radar-schemas-restapi/build.gradle @@ -0,0 +1,62 @@ +ext.artifactName = 'radar-schemas-restapi' +ext.description = 'RADAR Schemas REST API SDK' + +//---------------------------------------------------------------------------// +// AVRO file manipulation // +//---------------------------------------------------------------------------// +task generateAvro(type: com.commercehub.gradle.plugin.avro.GenerateAvroJavaTask) { + source rootProject.fileTree('../restapi') { + include '**/*.avsc' + } + outputDir avroOutputDir +} + +compileJava.dependsOn generateAvro + +//---------------------------------------------------------------------------// +// Publishing // +//---------------------------------------------------------------------------// + +publishing { + publications { + RadarRestApiPublication(MavenPublication) { + from components.java + artifact sourcesJar + artifact javadocJar + groupId project.group + artifactId artifactName + version project.version + pom.withXml { + def root = asNode() + root.appendNode('description', description) + root.appendNode('name', artifactName) + root.appendNode('url', vcsUrl) + root.children().last() + pomConfig + } + } + } +} + +bintray { + user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') + key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') + override = false + publications = ['RadarRestApiPublication'] + pkg { + repo = project.group + name = rootProject.name + userOrg = artifactName + licenses = ['Apache-2.0'] + websiteUrl = website + issueTrackerUrl = issueUrl + vcsUrl = vcsUrl + githubRepo = githubRepo + githubReleaseNotesFile = 'README.md' + version { + name = project.version + desc = description + vcsTag = System.getenv('TRAVIS_TAG') + released = new Date() + } + } +} diff --git a/java-sdk/settings.gradle b/java-sdk/settings.gradle new file mode 100644 index 00000000..ed12a550 --- /dev/null +++ b/java-sdk/settings.gradle @@ -0,0 +1,5 @@ +rootProject.name = 'radar-schemas' + +include ':radar-schemas-commons' +include ':radar-schemas-restapi' +include ':radar-schemas-questionnaire' diff --git a/RADAR-Questionnaire/config.md b/questionnaire/README.md similarity index 100% rename from RADAR-Questionnaire/config.md rename to questionnaire/README.md diff --git a/restapi/source/source_specification.avsc b/restapi/source/source_specification.avsc index 5e6c0970..40b305f0 100644 --- a/restapi/source/source_specification.avsc +++ b/restapi/source/source_specification.avsc @@ -5,6 +5,6 @@ "doc": "Source specification", "fields": [ {"name": "name", "type": "SourceType", "doc": "Source name"}, - {"name": "sensors", "type": {"type": "map", "values": "org.radarcns.avro.restapi.sensor.SensorSpecification" }, "doc": "Specifications of on board sensors. It is a Map where the key is the String conversion of a SensorType"} + {"name": "sensors", "type": {"type": "map", "values": "org.radarcns.avro.restapi.sensor.SensorSpecification" }, "doc": "Specifications of on board sensors. It is a map where the key is the String conversion of a SensorType"} ] }