-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
293 lines (238 loc) · 8.79 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
buildscript {
ext {
springBootVersion = '1.2.7.RELEASE'
}
repositories {
mavenCentral()
}
// dependencies {
// classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
// classpath('io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE')
// }
}
apply plugin: 'java'
apply plugin: 'signing'
apply plugin: 'maven'
//apply plugin: 'spring-boot'
//apply plugin: 'io.spring.dependency-management'
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
task wrapper(type: Wrapper, description: 'Creates and deploys the Gradle wrapper to the current directory.') {
gradleVersion = '2.1'
}
// NetBeans will automatically add "run" and "debug" tasks relying on the
// "mainClass" property. You may however define the property prior executing
// tasks by passing a "-PmainClass=<QUALIFIED_CLASS_NAME>" argument.
//
// Note however, that you may define your own "run" and "debug" task if you
// prefer. In this case NetBeans will not add these tasks but you may rely on
// your own implementation.
if (!hasProperty('mainClass')) {
ext.mainClass = 'com.neuronrobotics.bowlerstudio.BowlerKernel'
}
File buildDir = file(".");
Properties props = new Properties()
props.load(new FileInputStream(buildDir.getAbsolutePath()+"/src/main/resources/com/neuronrobotics/bowlerkernel/build.properties"))
boolean is64Bit() {
////System.out.println("Arch: "+getOsArch());
return getOsArch().startsWith("x86_64") || getOsArch().startsWith("amd64");
}
boolean isARM() {
return getOsArch().startsWith("arm");
}
boolean isCortexA8(){
if(isARM()){
//TODO check for cortex a8 vs arm9 generic
return true;
}
return false;
}
boolean isWindows() {
////System.out.println("OS name: "+getOsName());
return getOsName().toLowerCase().startsWith("windows") ||getOsName().toLowerCase().startsWith("microsoft") || getOsName().toLowerCase().startsWith("ms");
}
boolean isLinux() {
return getOsName().toLowerCase().startsWith("linux");
}
boolean isOSX() {
return getOsName().toLowerCase().startsWith("mac");
}
String getExtension() {
if(isWindows()) {
return ".dll";
}
if(isLinux()) {
return ".so";
}
if(isOSX()) {
return ".jnilib";
}
return "";
}
String getOsName() {
return System.getProperty("os.name");
}
String getOsArch() {
return System.getProperty("os.arch");
}
//https://oss.sonatype.org/service/local/repositories/releases/content/com/neuronrobotics/nrjavaserial/3.10.1/nrjavaserial-3.10.1.jar
repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/releases/' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'http://repo.jenkins-ci.org/public/' }
maven { url 'http://clojars.org/repo' }
maven { url 'http://jline.sourceforge.net/m2repo' }
maven {
url 'http://repo.spring.io/milestone'
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.10'
compile 'gov.nist.math:jama:1.0.2'
compile group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.6'
compile group: 'org.reactfx', name: 'reactfx', version: '2.0-SNAPSHOT'
compile group: 'org.codehaus.groovy', name: 'groovy', version:'2.3.7';
compile group: 'org.controlsfx', name: 'controlsfx', version: '8.0.6'
compile group: 'commons-lang', name: 'commons-lang', version: '2.6'
compile group: 'commons-codec', name: 'commons-codec', version: '1.7'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.2.3'
compile group: 'org.kohsuke.stapler', name: 'stapler-jetty', version: '1.1'
compile group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '4.0.1.201506240215-r'
compile group: 'com.squareup.okhttp', name: 'okhttp-urlconnection', version: '2.0.0'
compile group: 'org.kohsuke', name: 'wordnet-random-name', version: '1.2'
compile group: 'org.mockito', name: 'mockito-all', version: '1.9.5'
compile group: 'com.infradna.tool', name: 'bridge-method-injector', version: '1.14'
compile group: 'org.kohsuke', name: 'github-api', version: '1.66'
compile 'com.miglayout:miglayout-swing:4.2'
compile 'commons-io:commons-io:2.4'
compile group:'org.python',name:'jython',version:'2.5.3'
compile group:'org.python',name:'jython-standalone',version:'2.5.2'
compile 'org.clojure:clojure:1.7.0'
compile 'org.clojure:tools.nrepl:0.2.10'
compile "overtone:overtone:0.9.1"
compile "edu.cmu.sphinx:sphinx4-core:5prealpha-SNAPSHOT"
compile "edu.cmu.sphinx:sphinx4-data:5prealpha-SNAPSHOT"
compile group: 'java3d', name: 'vecmath', version: '1.3.1'
compile 'org.slf4j:slf4j-simple:1.6.1'
compile "com.neuronrobotics:JCSG:0.1.8"
compile "com.neuronrobotics:CHDK-PTP-Java:0.5.3-SNAPSHOT"
compile "com.neuronrobotics:java-bowler:3.16.6"
//compile fileTree (dir: '../java-bowler/build/libs/', includes: ['nrsdk-3.16.4-jar-with-dependencies.jar'])
compile "com.neuronrobotics:WalnutiQ:2.3.1"
String basedir =System.getenv("OPENCV_DIR")+"/../../java/opencv-249.jar";
println("OPENCV_DIR="+basedir);
if(isWindows()){
compile files(basedir)
}
if(isOSX()){
if(System.getenv("OPENCV_DIR")!=null)
compile files(basedir)
else
//If you set your OPENCV_DIR environment variable, then we wouldnt have to do hacky things
compile files('/Volumes/Snow Leopard/Applications/BowlerStudio.app/Contents/MacOS/opencv249build/bin/opencv-249.jar')
}
if(isLinux()){
//compile files('/usr/share/java/opencv-249.jar')
compile fileTree (dir: '/usr/share/java/', includes: ['*opencv-24*.jar'])
}
compile group: 'jfree', name: 'jfreechart', version: '1.0.12'
compile group: 'jexcelapi', name: 'jxl', version: '2.4.2'
compile group: 'com.google.zxing', name: 'zxing-parent', version: '3.2.0'
compile group:'com.github.ellzord', name:'JALSE', version:'1.0.9'
compile group:'de.huxhorn.sulky', name:'de.huxhorn.sulky.3rdparty.jlayer', version:'1.0'
compile group:'com.googlecode.json-simple', name:'json-simple', version:'1.1'
compile 'com.fifesoft:rsyntaxtextarea:2.5.6'
//compile("org.springframework.boot:spring-boot-starter-web:1.2.7.RELEASE")
compile fileTree (dir: 'libs', includes: ['*.jar'])
}
// create a fat-jar (class files plus dependencies
// excludes VRL.jar (plugin jar files must not start with 'vrl-\\d+')
jar {
jar.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
jar.baseName= "BowlerScriptingKernel";
doFirst {
// dependencies except VRL
from (configurations.runtime.asFileTree.
filter({file->return !file.name.startsWith("vrl-0")}).
files.collect { zipTree(it) } ){
exclude 'META-INF/MANIFEST.MF'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
}
}
manifest {
attributes(
"Main-Class": mainClass,
"Manifest-Version": "1.0",
"Created-By": "Neuron Robotics Cooperative",
"Specification-Title": props."app.name",
"Specification-Version": props."app.version",
"Specification-Vendor": "Neuron Robotics Cooperative",,
"Implementation-Title": props."app.name",
"Implementation-Version" : props."app.version",
"Implementation-Vendor": "Neuron Robotics Cooperative"
)
}
}
group = "com.neuronrobotics"
archivesBaseName = "bowler-script-kernel"
version = props."app.version"
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar, jar
}
signing {
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Bowler Scripting Kernel'
packaging 'jar'
// optionally artifactId can be defined here
description 'A command line utility for accsing the bowler framework.'
url 'http://neuronrobotics.com'
scm {
connection 'scm:git:https://github.com/NeuronRobotics/bowler-script-kernel.git'
developerConnection 'scm:git:[email protected]:NeuronRobotics/bowler-script-kernel.git'
url 'https://github.com/NeuronRobotics/bowler-script-kernel'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'madhephaestus'
name 'Kevin Harrington'
email '[email protected]'
}
}
}
}
}
}
//task run(type: JavaExec) {
// classpath = sourceSets.main.runtimeClasspath
// main = mainClass;
// // jvmArgs = ['-Dprism.forceGPU=true', '-Dprism.verbose=true']ssh
//}