Verify RegistryTool can instantiate (#400)

* Verify RegistryTool can instantiate

Add a task that instantiates all command classes in RegistryTool
with runtimeClasspath.

Also make sure that runtimeClasspath is a superset of
compileClasspath.
This commit is contained in:
Weimin Yu 2019-12-06 12:08:16 -05:00 committed by GitHub
parent df7d272157
commit bba5aff4b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 4 deletions

View file

@ -104,6 +104,8 @@ final class RegistryCli implements AutoCloseable, CommandRunner {
// Create all command instances. It would be preferrable to do this in the constructor, but
// JCommander mutates the command instances and doesn't reset them so we have to do it for every
// run.
// TODO(weiminyu): extract this into a standalone static method to simplify
// :core:registryToolIntegrationTest
try {
for (Map.Entry<String, ? extends Class<? extends Command>> entry : commands.entrySet()) {
Command command = entry.getValue().getDeclaredConstructor().newInstance();