Files
POC-Java/build.gradle
2017-02-07 19:02:10 -06:00

70 lines
1.7 KiB
Groovy

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'idea'
group = 'com.henrypump.poc'
version = '1.0-SNAPSHOT'
description = """poc-java"""
sourceCompatibility = 1.5
targetCompatibility = 1.5
repositories {
maven { url "http://repo.maven.apache.org/maven2" }
}
dependencies {
compile group: 'io.mraa', name: 'mraa', version:'1.5.1'
compile group: 'com.googlecode.json-simple', name: 'json-simple', version:'1.1.1'
compile group: 'org.mongodb', name: 'mongodb-driver', version:'3.4.2'
compile group: 'de.vandermeer', name: 'asciitable', version:'0.2.5'
testCompile group: 'junit', name: 'junit', version:'3.8.1'
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.hidetake:gradle-ssh-plugin:2.7.2'
}
}
apply plugin: 'org.hidetake.ssh'
remotes {
edison {
host = '192.168.2.15'
user = 'root'
identity = file('henryPumpDev')
}
}
//create a single Jar with all dependencies
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'POC Jar File',
'Implementation-Version': version,
'Main-Class': 'com.henrypump.poc.POC'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task deploy << {
ssh.run {
session(remotes.edison) {
put from: 'build/libs/poc-java-all-1.0-SNAPSHOT.jar', into: '/home/root'
}
}
}
task runRemote << {
ssh.run {
session(remotes.edison) {
execute 'java -cp .:/usr/lib/java/*:poc-java-all-1.0-SNAPSHOT.jar com.henrypump.poc.POC kiesha7265Well.json kiesha7265_card_147_surface.csv'
}
}
}