register static method

void register(
  1. DVBuildTarget target
)

Makes target buildable under its name and every alias. A free target's name is refused: it is built by the CLI, and a package that replaced it would change what a free build does.

Implementation

static void register(DVBuildTarget target) {
  for (final String name in <String>[target.name, ...target.aliases]) {
    if (dvFreeTargetNames.contains(name)) {
      throw ArgumentError.value(name, 'target.name',
          'is a free target the CLI builds itself');
    }
    _byName[name] = target;
  }
  _targets.add(target);
}