Skip to content

Commit a5ed9af

Browse files
committed
Merge branch 'master' into docs/contributing
2 parents b2eea29 + fdf35cb commit a5ed9af

File tree

269 files changed

+10617
-2797
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

269 files changed

+10617
-2797
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,6 @@ node_modules
8585
bower_components
8686

8787
#Generated files should be ignored as the are regenerated as a build step
88-
*/src/generated
88+
**/generated
89+
*/generated_tests
8990
/bin/

.travis-scripts/before-deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
ls -R build/distributions | awk '
2+
ls -R ui/build/distributions | awk '
33
/:$/&&f{s=$0;f=0}
44
/:$/&&!f{sub(/:$/,"");s=$0;f=1;next}
55
NF&&f{ print s"/"$0 }'

.travis-scripts/push-javadoc-to-gh-pages.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# Source of file: http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/
44
if [ "$TRAVIS_REPO_SLUG" == "WPIRoboticsProjects/GRIP" ] && [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
55

6+
echo -e "Generating javadoc...\n"
7+
./gradlew aggregateJavadocs
8+
69
echo -e "Publishing javadoc...\n"
710

811
cp -R build/docs/javadoc $HOME/javadoc-latest

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ before_install:
2121
- sh -e /etc/init.d/xvfb start
2222
- pip install --user codecov
2323

24-
install: ./gradlew :ui:assemble --stacktrace
24+
# Only do an assemble when we aren't building a pull request
25+
install:
26+
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && ./gradlew :ui:assemble --stacktrace || ./gradlew --stacktrace '
2527

26-
after_failure: #Run again with debug info enabled
27-
- ./gradlew check --stacktrace -PprintTestResults
28+
script:
29+
- ./gradlew check --stacktrace -PprintTestResults
2830

2931
after_success:
3032
- codecov
31-
- ./gradlew aggregateJavadocs
3233
- .travis-scripts/push-javadoc-to-gh-pages.sh
3334
- .travis-scripts/before-deploy.sh
3435

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
[![Join the chat at https://gitter.im/WPIRoboticsProjects/GRIP](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/WPIRoboticsProjects/GRIP?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
44
[![Build Status](https://travis-ci.org/WPIRoboticsProjects/GRIP.svg?branch=master)](https://travis-ci.org/WPIRoboticsProjects/GRIP)
5-
[![Build status](https://ci.appveyor.com/api/projects/status/9xl8pggec4l75pqb/branch/master?svg=true)](https://ci.appveyor.com/project/ThomasJClark/grip/branch/master)
5+
[![Build status](https://ci.appveyor.com/api/projects/status/sbrd2nhpiktlhf58/branch/master?svg=true)](https://ci.appveyor.com/project/JLLeitschuh/grip/branch/master)
66
[![codecov.io](http://codecov.io/github/WPIRoboticsProjects/GRIP/coverage.svg?branch=master)](http://codecov.io/github/WPIRoboticsProjects/GRIP?branch=master)
7+
[![Dependency Status](https://www.versioneye.com/user/projects/56aaaac57e03c7003ba40ab6/badge.svg?style=plastic)](https://www.versioneye.com/user/projects/56aaaac57e03c7003ba40ab6)
78
[![Github Releases](https://img.shields.io/github/downloads/WPIRoboticsProjects/GRIP/total.svg)](https://github.com/WPIRoboticsProjects/GRIP/releases/latest)
89

910
# GRIP Computer Vision Engine
1011

1112
GRIP (the Graphically Represented Image Processing engine) is a program for rapidly prototyping and deploying computer
12-
vision algorithms, primarily for robotics applications. **It is currently in an early state of development**,
13-
should be ready in time for the 2016 FIRST Robotics Competition.
13+
vision algorithms, primarily for robotics applications. It has been released with features designed for the
14+
2016 FIRST Robotics Competition Season.
1415

1516
## Getting Started
1617

@@ -22,6 +23,21 @@ Check out the release notes and [the wiki](https://github.com/WPIRoboticsProject
2223

2324
## Building GRIP From Source
2425

25-
To build and run, use the included Gradle wrapper script.
26+
To build and run, use the included Gradle wrapper script on a Unix System:
2627

2728
./gradlew :ui:run
29+
30+
On Windows:
31+
32+
gradlew.bat :ui:run
33+
34+
If you don't have an internet connection you can build using the `--offline` flag if you have built GRIP once before.
35+
36+
## Contributing
37+
38+
See the guide on [setting up build tools](https://github.com/WPIRoboticsProjects/GRIP/wiki/Setting-up-build-tools) in the wiki.
39+
40+
## Thanks
41+
42+
Thanks to [TravisCI](https://travis-ci.org/) and [AppVeyor](https://www.appveyor.com/) for providing their continuous integration
43+
servers to open source projects for free.

appveyor.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ install:
22
- choco install -y InnoSetup
33

44
build_script:
5-
- gradlew.bat :ui:assemble --stacktrace
5+
- gradlew.bat :ui:assemble --stacktrace -PprintTestResults
66

77
# to run your custom scripts instead of automatic tests
88
test_script:
@@ -11,12 +11,10 @@ test_script:
1111
platform:
1212
- x64
1313

14-
after_build:
15-
- dir build /s
16-
1714
artifacts:
1815
- path: ui\build\distributions\*.exe
1916

17+
2018
deploy:
2119
provider: GitHub
2220
description: ''

build.gradle

Lines changed: 121 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
buildscript {
2-
repositories { jcenter() }
2+
repositories {
3+
jcenter()
4+
maven {
5+
url "https://plugins.gradle.org/m2/"
6+
}
7+
}
38

49
dependencies {
510
classpath 'com.netflix.nebula:gradle-aggregate-javadocs-plugin:2.2.+'
11+
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.8'
612
}
713
}
814
plugins {
@@ -15,10 +21,78 @@ plugins {
1521
}
1622
apply plugin: 'nebula-aggregate-javadocs'
1723

24+
def getGitCommit = { ->
25+
String HEAD_REF = new File(rootDir, '.git/HEAD').text.replace("ref: ", "").replace("\n", "")
26+
String COMMIT_HASH = new File(rootDir, ".git/${HEAD_REF}").text.substring(0, 7)
27+
return COMMIT_HASH
28+
}
29+
30+
idea.project {
31+
ipr.withXml { provider ->
32+
def node = provider.asNode()
33+
def compilerConfig = node.component.find { it.'@name' == 'CompilerConfiguration'}
34+
compilerConfig.annotationProcessing[0].'@enabled' = 'true'
35+
// def ccfg = node.component.find { it.@name == 'CompilerConfiguration' }
36+
// ccfg.remove(ccfg.annotationProcessing)
37+
// ccfg.append(new NodeBuilder().annotationProcessing() {
38+
// profile(default: true, name: 'Default', enabled: true) {
39+
// processorPath(useClasspath: true)
40+
// }
41+
// })
42+
}
43+
}
44+
45+
/*
46+
* Gets the version name from the latest Git tag
47+
* http://ryanharter.com/blog/2013/07/30/automatic-versioning-with-git-and-gradle/
48+
*/
49+
def getVersionName = { ->
50+
if (project.hasProperty("vers")) return vers
51+
try {
52+
def stdout = new ByteArrayOutputStream()
53+
exec {
54+
commandLine 'git', 'describe', '--tags'
55+
standardOutput = stdout
56+
}
57+
return stdout.toString().trim().substring(1)
58+
} catch (org.gradle.process.internal.ExecException e) {
59+
if (!new File(rootDir, '.git/HEAD').exists()) {
60+
println("WARN: Could not fetch Git Tag for build version. No Git HEAD available. Substituting version 0.0.0")
61+
return "0.0.0"
62+
}
63+
println("WARN: Could not fetch Git Tag for build version. Please install Git and add it to your PATH. For now, the Git commit hash has been substituted.")
64+
return getGitCommit()
65+
}
66+
}
67+
68+
def getVersionSimple = { ->
69+
if (project.hasProperty("vers")) return vers
70+
try {
71+
def stdout = new ByteArrayOutputStream()
72+
exec {
73+
commandLine 'git', 'describe', '--tags', '--abbrev=0'
74+
standardOutput = stdout
75+
}
76+
return stdout.toString().trim().substring(1)
77+
} catch (org.gradle.process.internal.ExecException e) {
78+
if (!new File(rootDir, '.git/HEAD').exists()) {
79+
println("WARN: Could not fetch Git Tag for build version. No Git HEAD available. Substituting version 0.0.0")
80+
return "0.0.0"
81+
}
82+
println("WARN: Could not fetch Git Tag for build version. Please install Git and add it to your PATH. For now, the Git commit hash has been substituted.")
83+
return getGitCommit()
84+
}
85+
}
86+
1887
allprojects {
1988
apply plugin: 'java'
2089
apply plugin: 'application'
2190
apply plugin: 'jacoco'
91+
apply plugin: 'net.ltgt.errorprone'
92+
93+
configurations.errorprone {
94+
resolutionStrategy.force 'com.google.errorprone:error_prone_core:2.0.8'
95+
}
2296

2397

2498
repositories {
@@ -34,9 +108,11 @@ allprojects {
34108
testCompile group: 'net.jodah', name: 'concurrentunit', version: '0.4.2'
35109
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
36110
testCompile group: 'junit', name: 'junit', version: '4.12'
111+
testCompile group: 'com.google.truth', name: 'truth', version: '0.28'
112+
testCompile group: 'com.google.guava', name: 'guava-testlib', version: '19.0'
37113
}
38114

39-
version = '0.3.0'
115+
version = getVersionName()
40116

41117
compileJava {
42118
options.compilerArgs << "-g"
@@ -76,7 +152,8 @@ allprojects {
76152
}
77153
}
78154

79-
def os = osdetector.classifier.replace("osx", "macosx").replace("windows-x86_32", "windows-x86")
155+
def os = osdetector.classifier.replace("osx", "macosx").replace("x86_32", "x86")
156+
def arch = osdetector.arch.replace("x86_64", "x64")
80157

81158
project(":core") {
82159
apply plugin: 'java'
@@ -91,10 +168,17 @@ project(":core") {
91168
repositories {
92169
flatDir {
93170
dirs 'libs'
171+
maven {
172+
url = "http://first.wpi.edu/FRC/roborio/maven/development"
173+
}
174+
maven {
175+
url = "https://github.com/WPIRoboticsProjects/rosjava_mvn_repo/raw/master"
176+
}
94177
}
95178
}
96179

97180
dependencies {
181+
compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
98182
compile group: 'org.bytedeco', name: 'javacv', version: '1.1'
99183
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1'
100184
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1', classifier: os
@@ -103,9 +187,19 @@ project(":core") {
103187
compile group: 'org.python', name: 'jython', version: '2.7.0'
104188
compile group: 'com.thoughtworks.xstream', name: 'xstream', version: '1.4.8'
105189
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4'
106-
compile group: 'com.google.guava', name: 'guava', version: '18.0'
107-
compile group: 'com.google.inject', name: 'guice', version: '4.0'
190+
compile group: 'com.google.guava', name: 'guava', version: '19.0'
191+
compile group: 'com.google.auto.value', name: 'auto-value', version: '1.1'
192+
// We use the no_aop version of Guice because the aop isn't avaiable in arm java
193+
// http://stackoverflow.com/a/15235190/3708426
194+
// https://github.com/google/guice/wiki/OptionalAOP
195+
compile group: 'com.google.inject', name: 'guice', version: '4.0', classifier: 'no_aop'
108196
compile group: 'com.google.inject.extensions', name: 'guice-assistedinject', version: '4.0'
197+
198+
// Network publishing dependencies
199+
compile group: 'org.ros.rosjava_core', name: 'rosjava', version: '[0.2,0.3)'
200+
compile group: 'org.ros.rosjava_messages', name: 'grip_msgs', version: '0.0.1'
201+
compile group: 'edu.wpi.first.wpilib.networktables.java', name: 'NetworkTables', version: '3.0.0-SNAPSHOT', classifier: 'desktop'
202+
compile group: 'edu.wpi.first.wpilib.networktables.java', name: 'NetworkTables', version: '3.0.0-SNAPSHOT', classifier: 'arm'
109203
}
110204

111205
mainClassName = 'edu.wpi.grip.core.Main'
@@ -172,8 +266,8 @@ project(":core") {
172266

173267
idea.module {
174268
sourceDirs += sourceSets.generated.java.srcDirs
269+
sourceDirs += file('generated')
175270
}
176-
// End IDE setup
177271
}
178272

179273
project(":ui") {
@@ -191,9 +285,7 @@ project(":ui") {
191285
compile project(path: ':core', configuration: 'shadow')
192286
ideProvider project(path: ':core', configuration: 'compile')
193287
compile group: 'org.controlsfx', name: 'controlsfx', version: '8.40.10'
194-
compile group: 'org.apache.ant', name: 'ant-jsch', version: '1.8.1'
195-
compile group: 'com.jcabi', name: 'jcabi-ssh', version: '1.5'
196-
compile group: 'org.jdeferred', name: 'jdeferred-core', version: '1.2.4'
288+
compile group: 'com.hierynomus', name: 'sshj', version: '0.15.0'
197289
testCompile files(project(':core').sourceSets.test.output.classesDir)
198290
testCompile files(project(':core').sourceSets.test.output.resourcesDir)
199291
testCompile group: 'org.testfx', name: 'testfx-core', version: '4.0.+'
@@ -208,9 +300,19 @@ project(":ui") {
208300
}
209301

210302
javafx {
303+
profiles {
304+
linux {
305+
category = 'Development'
306+
bundleArguments = [
307+
// for DEB bundles
308+
'email': '[email protected]', // This is the email used for the deb maintainer field.
309+
]
310+
}
311+
}
211312
appID = 'GRIP'
212313
appName = 'GRIP'
213314
mainClass = "edu.wpi.grip.ui.Main"
315+
version = getVersionSimple()
214316

215317
// This prevents the JIT from eating stack traces that get thrown a lot
216318
// This is slower but means we actually get the stack traces instead of
@@ -220,6 +322,16 @@ project(":ui") {
220322
jvmArgs = ["-XX:-OmitStackTraceInFastThrow"]
221323
}
222324
mainClassName = javafx.mainClass
325+
326+
// The JavaFX plugin does not provide a way to change the installer artifact's name without changing the appName or appID,
327+
// so instead, we simply rename the artifact to append the architecture (x86 or x64)
328+
jfxDeploy.doLast {
329+
def filet = fileTree(dir: 'build/distributions', include: "${javafx.appName}-${getVersionSimple()}.*")
330+
filet.each { File f ->
331+
def f2 = new File(f.getParentFile(), "${f.getName().replace("${getVersionSimple()}", "${getVersionSimple()}-${arch}")}")
332+
f.renameTo(f2)
333+
}
334+
}
223335
}
224336

225337
/*

buildSrc/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ configurations {
1212
dependencies {
1313
compile gradleApi()
1414
compile localGroovy()
15-
compile group: 'com.google.guava', name: 'guava', version: '18.0'
15+
compile group: 'com.google.guava', name: 'guava', version: '19.0'
1616
compile group: 'com.github.javaparser', name: 'javaparser-core', version: '2.2.2'
1717
source group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1', classifier: 'sources'
1818
testCompile group: 'junit', name: 'junit', version: '4.11'

buildSrc/src/main/java/edu/wpi/gripgenerator/FileParser.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class FileParser {
5454
*/
5555
private static InputStream preProcessStream(InputStream stream) {
5656
//FIXME: This is a hack around. This should be removed once the above noted issue is resolved.
57-
java.util.Scanner s = new java.util.Scanner(stream).useDelimiter("\\A");
57+
java.util.Scanner s = new java.util.Scanner(stream, StandardCharsets.UTF_8.name()).useDelimiter("\\A");
5858
String input = s.hasNext() ? s.next() : "";
5959
input = input.replaceAll(methodReorderPattern, methodNewOrder);
6060
return new ByteArrayInputStream(input.getBytes(StandardCharsets.UTF_8));
@@ -241,7 +241,9 @@ public static Map<String, CompilationUnit> parseOpenCVCore(CompilationUnit coreD
241241
new DefinedMethod("min", false, "Mat", "Mat")
242242
.addDescription("Calculate the per-element minimum of two images."),
243243
new DefinedMethod("extractChannel", false, "Mat", "Mat")
244-
.addDescription("Extract a single channel from a image.")
244+
.addDescription("Extract a single channel from a image."),
245+
new DefinedMethod("transpose", false, "Mat", "Mat")
246+
.addDescription("Calculate the transpose of an image.")
245247
// new DefinedMethod("sqrt", false, "Mat", "Mat"),
246248
// new DefinedMethod("pow", false,
247249
// new DefinedParamType("Mat"),

buildSrc/src/main/java/edu/wpi/gripgenerator/defaults/PrimitiveDefaultValue.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,28 @@ public PrimitiveDefaultValue(PrimitiveType type) {
4545
);
4646
break;
4747
case Int:
48-
this.viewValue = "SPINNER";
48+
this.viewValue = "TEXT";
4949
this.domainValue = createDomainValueExpression(
5050
new IntegerLiteralExpr("Integer.MIN_VALUE"),
5151
new IntegerLiteralExpr("Integer.MAX_VALUE")
5252
);
5353
break;
5454
case Float:
55-
this.viewValue = "SPINNER";
55+
this.viewValue = "TEXT";
5656
this.domainValue = createDomainValueExpression(
5757
new DoubleLiteralExpr("-Float.MAX_VALUE"),
5858
new DoubleLiteralExpr("Float.MAX_VALUE")
5959
);
6060
break;
6161
case Double:
62-
this.viewValue = "SPINNER";
62+
this.viewValue = "TEXT";
6363
this.domainValue = createDomainValueExpression(
6464
new DoubleLiteralExpr("-Double.MAX_VALUE"),
6565
new DoubleLiteralExpr("Double.MAX_VALUE")
6666
);
6767
break;
6868
case Char:
69-
this.viewValue = "SPINNER";
69+
this.viewValue = "TEXT";
7070
this.domainValue = createDomainValueExpression(
7171
new CharLiteralExpr(Character.toString(Character.MIN_VALUE)),
7272
new CharLiteralExpr(Character.toString(Character.MAX_VALUE))

0 commit comments

Comments
 (0)