Skip to content

Comments

Remove runtime classpath scanning#911

Merged
SamCarlberg merged 5 commits intoWPIRoboticsProjects:masterfrom
SamCarlberg:nuke-classpath-scanning
Mar 27, 2019
Merged

Remove runtime classpath scanning#911
SamCarlberg merged 5 commits intoWPIRoboticsProjects:masterfrom
SamCarlberg:nuke-classpath-scanning

Conversation

@SamCarlberg
Copy link
Member

@SamCarlberg SamCarlberg commented Jan 17, 2019

Operations, custom XStream types,and publishable classes are stored in registry files in the META-INF directory of the core project JAR. These files are generated by an annotation processor - when creating a new operation, publishable class, or save-file content, simply add the appropriate annotation to the class (@Description , @PublishableObject , and @XStreamAlias, respectively)

Fixes #784
Fixes #834

@SamCarlberg SamCarlberg added location: core type: bugfix Fixes one or more open bugs labels Jan 17, 2019
@codecov-io
Copy link

codecov-io commented Jan 17, 2019

Codecov Report

Merging #911 into master will decrease coverage by 0.24%.
The diff coverage is 49.48%.

@@             Coverage Diff              @@
##             master     #911      +/-   ##
============================================
- Coverage      54.5%   54.26%   -0.25%     
- Complexity        0        1       +1     
============================================
  Files           304      307       +3     
  Lines          8318     8365      +47     
  Branches        535      540       +5     
============================================
+ Hits           4534     4539       +5     
- Misses         3587     3631      +44     
+ Partials        197      195       -2

edu.wpi.grip.core.operations.composite.PublishVideoOperation
edu.wpi.grip.core.operations.composite.WatershedOperation
edu.wpi.grip.core.operations.composite.FindLinesOperation
edu.wpi.grip.core.operations.composite.DistanceTransformOperation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get Gradle to build this automatically with some sort of annotation processor?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd have to write our own annotation processor, and do something for publishables (reports etc) . That'd probably mean creating a new project for the annotations and annotation processor.

@JLLeitschuh
Copy link
Member

The other thing to try is just updating Guava. There have been fixes to ClassPath in the newer releases that may fix the problems people were having.

@SamCarlberg
Copy link
Member Author

Given how difficult it is to reproduce the problem, I don't think that attempting to use a newer version of Guava will be enough to say we've fixed the problem. Especially since ClassPath is still marked as beta in the newest version of Guava (27.0.1)

@JLLeitschuh
Copy link
Member

How is this any better than just having a static class with an immutable list of all these operations?

Why do dynamic class loading at all when you can just have them declared in the source code where the compiler can tell you if you're using one that doesn't exist?

Operations, custom XStream types,and publishable classes are stored in registry files in the META-INF directory of the core project JAR.
@SamCarlberg SamCarlberg force-pushed the nuke-classpath-scanning branch from 71511b2 to 261cc89 Compare January 24, 2019 20:46
@SamCarlberg
Copy link
Member Author

@JLLeitschuh Any further comments before I merge?

@JLLeitschuh
Copy link
Member

Nope, please resolve merge conflicts.

Copy link
Member

@JLLeitschuh JLLeitschuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@SamCarlberg SamCarlberg merged commit 142b1de into WPIRoboticsProjects:master Mar 27, 2019
@SamCarlberg SamCarlberg deleted the nuke-classpath-scanning branch March 27, 2019 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

location: core type: bugfix Fixes one or more open bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants