Skip to content

Commit c9efca1

Browse files
committed
Merge remote-tracking branch 'upstream/master' into ntSource
2 parents abd31fb + 547f897 commit c9efca1

File tree

62 files changed

+365
-118
lines changed

Some content is hidden

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

62 files changed

+365
-118
lines changed

.pullapprove.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
approve_by_comment: true
2+
approve_regex: ^(Approved|LGTM)
3+
reject_regex: ^Rejected
4+
reset_on_push: true
5+
reviewers:
6+
-
7+
name: "GRIP Merge Approvers"
8+
required: 1
9+
teams:
10+
- grip-merge-approvers

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ install:
3030
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && ./gradlew :ui:jfxNative --stacktrace || ./gradlew --stacktrace '
3131

3232
script:
33-
- ./gradlew checkstyleMain checkstyleTest pmdMain jacocoTestReport jacocoRootReport test --stacktrace -Pheadless=true -PlogTests
33+
- ./gradlew checkstyleMain checkstyleTest pmdMain pmdTest jacocoTestReport jacocoRootReport test --stacktrace -Pheadless=true -PlogTests
3434

3535
after_success:
3636
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then codecov ; fi

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ Include details about your configuration and environment:</br>
6969

7070
### Code Formatting
7171

72-
* GRIP uses standard Java formatting rules, although we don't care if your line length is over 80 characters. You can probably use your IDE's built-in formatter. This helps keep the code more consistent and readable.
72+
* GRIP follows the [Google Java Styleguide](https://google.github.io/styleguide/javaguide.html) with a few modifications regarding import order. We use the gradle [checkstyle](http://checkstyle.sourceforge.net/) plugin to ensure that code conforms to this styleguide. There are plugins for most major IDE's that support importing the `checkstyle.xml` file.

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build_script:
66

77
# to run your custom scripts instead of automatic tests
88
test_script:
9-
- gradlew.bat checkstyleMain checkstyleTest pmdMain jacocoTestReport jacocoRootReport test --stacktrace -Pheadless=true -PlogTests
9+
- gradlew.bat checkstyleMain checkstyleTest pmdMain pmdTest jacocoTestReport jacocoRootReport test --stacktrace -Pheadless=true -PlogTests
1010

1111
platform:
1212
- x64

build.gradle

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
}
88

99
dependencies {
10-
classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '8.5.1'
10+
classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '8.5.2'
1111
classpath 'com.netflix.nebula:gradle-aggregate-javadocs-plugin:2.2.+'
1212
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.8'
1313
}
@@ -85,7 +85,7 @@ def getVersionSimple = { ->
8585
}
8686
}
8787

88-
allprojects {
88+
configure(allprojects - project(':ui:linuxLauncher')) {
8989
apply plugin: 'java'
9090
apply plugin: 'application'
9191
apply plugin: 'jacoco'
@@ -301,6 +301,30 @@ project(":core") {
301301
}
302302
}
303303

304+
project (":ui:linuxLauncher") {
305+
apply plugin: 'cpp'
306+
307+
model {
308+
binaries {
309+
all {
310+
cppCompiler.args '-pthread', '-ldl'
311+
linker.args '-pthread', '-ldl'
312+
}
313+
}
314+
components {
315+
linuxLauncher(NativeExecutableSpec) {
316+
sources {
317+
cpp {
318+
source {
319+
srcDir "src/cpp"
320+
}
321+
}
322+
}
323+
}
324+
}
325+
}
326+
}
327+
304328
project (":ui:preloader") {
305329
apply plugin: 'java'
306330
apply plugin: 'idea'
@@ -339,7 +363,10 @@ project(":ui") {
339363
}
340364

341365
evaluationDependsOn(':core')
342-
evaluationDependsOnChildren()
366+
evaluationDependsOn(':ui:preloader')
367+
if (System.getProperty("os.name").toLowerCase().contains("linux")) {
368+
jfxNative.dependsOn tasks.getByPath(':ui:linuxLauncher:linuxLauncherExecutable')
369+
}
343370
compileTestJava.dependsOn tasks.getByPath(':core:testClasses')
344371

345372
idea.module {
@@ -375,10 +402,9 @@ project(":ui") {
375402
// See: https://plumbr.eu/blog/java/on-a-quest-for-missing-stacktraces
376403
jvmArgs = ["-XX:-OmitStackTraceInFastThrow"]
377404

378-
// This was a workaround introduced by the plugin dev. For some reason the build fails
379-
// when the workaround is enabled in Java 1.8.0_101. If you are building with a version
380-
// less than _101 you may need to set this to false.
381-
skipNativeLauncherWorkaround124 = true
405+
bundleArguments = [
406+
"linux.launcher.url": file('linuxLauncher/build/exe/linuxLauncher/linuxLauncher').toURI().toURL()
407+
]
382408
}
383409
mainClassName = jfx.mainClass
384410
}
@@ -389,20 +415,22 @@ project(":ui") {
389415
*/
390416
task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') {
391417
description = 'Generates an aggregate report from all subprojects'
392-
dependsOn(subprojects.test)
418+
configure(subprojects - project(':ui:linuxLauncher')) {
419+
dependsOn(test)
393420

394-
additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
395-
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
396-
classDirectories = files(subprojects.sourceSets.main.output)
397-
executionData = files(subprojects.jacocoTestReport.executionData)
421+
additionalSourceDirs = files(sourceSets.main.allSource.srcDirs)
422+
sourceDirectories = files(sourceSets.main.allSource.srcDirs)
423+
classDirectories = files(sourceSets.main.output)
424+
executionData = files(jacocoTestReport.executionData)
398425

399-
reports {
400-
html.enabled = true
401-
xml.enabled = true
402-
}
426+
reports {
427+
html.enabled = true
428+
xml.enabled = true
429+
}
403430

404-
doFirst {
405-
executionData = files(executionData.findAll { it.exists() })
431+
doFirst {
432+
executionData = files(executionData.findAll { it.exists() })
433+
}
406434
}
407435
}
408436

core/src/main/java/edu/wpi/grip/core/events/ConnectionAddedEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* An event that occurs when a new connection is added to the pipeline. This is triggered by the
1111
* user adding a connection with the GUI.
1212
*/
13-
public class ConnectionAddedEvent implements RunPipelineEvent {
13+
public class ConnectionAddedEvent implements RunPipelineEvent, DirtiesSaveEvent {
1414
private final Connection connection;
1515

1616
/**

core/src/main/java/edu/wpi/grip/core/events/ConnectionRemovedEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* An event that occurs when a connection is removed from the pipeline. This is triggered by the
1111
* user deleting a connection with the GUI.
1212
*/
13-
public class ConnectionRemovedEvent {
13+
public class ConnectionRemovedEvent implements DirtiesSaveEvent {
1414
private final Connection connection;
1515

1616
/**
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package edu.wpi.grip.core.events;
2+
3+
/**
4+
* An event that can potentially dirty the save file.
5+
*
6+
* <p>These events ensure that anything that changes causes the save file to be flagged as dirty and
7+
* in need of being saved for the project to be deemed "clean" again.
8+
*/
9+
public interface DirtiesSaveEvent {
10+
11+
/**
12+
* Some events may have more logic regarding whether they make the save dirty or not.
13+
*
14+
* @return True if this event should dirty the project save
15+
*/
16+
default boolean doesDirtySave() {
17+
return true;
18+
}
19+
}

core/src/main/java/edu/wpi/grip/core/events/SocketChangedEvent.java

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* An event that occurs when the value stored in a socket changes. This can happen, for example, as
1111
* the result of an operation completing, or as a response to user input.
1212
*/
13-
public class SocketChangedEvent implements RunPipelineEvent {
13+
public class SocketChangedEvent implements RunPipelineEvent, DirtiesSaveEvent {
1414
private final Socket socket;
1515

1616
/**
@@ -31,19 +31,26 @@ public boolean isRegarding(Socket socket) {
3131
return socket.equals(this.socket);
3232
}
3333

34+
/**
35+
* This event will only dirty the save if the InputSocket does not have connections.
36+
* Thus the value can only have been changed by a UI component.
37+
* If the socket has connections then the value change is triggered by another socket's change.
38+
*
39+
* @return True if this should dirty the save.
40+
*/
41+
@Override
42+
public boolean doesDirtySave() {
43+
return pipelineShouldRun();
44+
}
45+
3446
@Override
3547
public boolean pipelineShouldRun() {
3648
/*
3749
* The pipeline should only flag an update when it is an input changing. A changed output
38-
* doesn't mean
39-
* the pipeline is dirty.
40-
* If the socket is connected to another socket then then the input will only change
41-
* because of the
42-
* pipeline thread.
43-
* In that case we don't want the pipeline to be releasing itself.
44-
* If the connections are empty then the change must have come from the UI so we need to
45-
* run the pipeline
46-
* with the new values.
50+
* doesn't mean the pipeline is dirty. If the socket is connected to another socket then then
51+
* the input will only change because of the pipeline thread. In that case we don't want the
52+
* pipeline to be releasing itself. If the connections are empty then the change must have come
53+
* from the UI so we need to run the pipeline with the new values.
4754
*/
4855
return socket.getDirection().equals(Socket.Direction.INPUT) && socket.getConnections()
4956
.isEmpty();

core/src/main/java/edu/wpi/grip/core/events/SocketPreviewChangedEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* An event that occurs when a {@link OutputSocket} is set to be either previewed or not previewed.
1111
* The GUI listens for these events so it knows which sockets to show previews for.
1212
*/
13-
public class SocketPreviewChangedEvent {
13+
public class SocketPreviewChangedEvent implements DirtiesSaveEvent {
1414
private final OutputSocket socket;
1515

1616
/**

0 commit comments

Comments
 (0)