Sinister is Dairy’s classpath scanning utility library.
@Teleop
and @Autonomous
annotations, and to find methods that are annotated
with the internal hook annotations.
Unfortunately, to add your own classpath scanning, you need to modify the
FTCRobotControllerActivity class, which must be done manually for all users.
Sinister takes a different approach, Sinister starts in the OnCreate
stage,
and performs its own classpath scanning, in the same manner that the FTC SDK
does, but instead is ‘Bootstrapping’. Sinister looks for static instances of
SinisterFilter
, and runs those found filters on the classes as well.
Sinister is used in Dairy to:
- Collect static instances of classes and pre-load and register them. (e.g.
Core’s
Feature
s, Mercurial’sSubsystem
s) - Provide a more type safe way to do the FTC SDK’s apphooks.
Features:
- Classpath scanning filters (
SinisterFilter
). - Reflection utilities for scanning filters.
- Search target system.
- Interface based AppHooks which replace the FTC SDK’s public static annotated method AppHooks.
Installation:
Core contains an installation of Sinister, but you may wish to install a custom
version of it.
- Repository
This only needs to be done once, if you already have this, no need to add it
again.
TeamCode
’s build.gradle
, above dependencies
.
- Implementation
dependencies
block:
- Sync