-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
99 lines (81 loc) · 3.02 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/5.4.1/userguide/tutorial_java_projects.html
*/
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building an application
id 'application'
// Apply the SSH plugin to deploy to another device
id 'org.hidetake.ssh' version '2.10.1'
}
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// Not sure what this is, it's added by default
implementation 'com.google.guava:guava:27.0.1-jre'
// Use JUnit test framework
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.3.1'
testImplementation 'org.awaitility:awaitility:3.1.6'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
// OpenCV library
implementation files(new File(System.getProperty("user.home"), 'opencv\\build\\java\\opencv-410.jar'))
}
// Define the main class for the application
mainClassName = 'DeepSpaceVision.App'
// Manifest attributes necessary to run .jar without using Gradle
jar {
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Main-Class': 'DeepSpaceVision.App'
)
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
remotes {
jetson {
host = 'tegra-ubuntu.local'
user = 'robotics'
password = 'MrRoboto'
}
}
ssh.settings {
knownHosts = allowAnyHosts
}
task deploy {
doLast {
ssh.run {
session(remotes.jetson) {
// stop service so we can edit files
executeSudo 'systemctl stop vision-code', pty: true
// update run script
put from: new File(project.projectDir, "src/main/resources/vision-code.sh"), into: '/home/robotics/vision-code/'
execute 'chmod +x /home/robotics/vision-code/vision-code.sh'
// update service file
execute 'mkdir /home/robotics/vision-code/tmp/'
put from: new File(project.projectDir, "src/main/resources/vision-code.service"), into: '/home/robotics/vision-code/tmp/'
executeSudo 'cp /home/robotics/vision-code/tmp/vision-code.service /etc/systemd/system/', pty: true
// update jar file
put from: jar.archivePath, into: '/home/robotics/vision-code/'
// start service
executeSudo 'systemctl start vision-code', pty: true
// cleanup temp directory
execute 'rm -r /home/robotics/vision-code/tmp/'
}
}
}
}
test {
useJUnitPlatform()
}