Пример #1
0
  @Override
  public void execute() throws BuildException {
    if (null == _from) throw new IllegalStateException("Missing 'from'.");
    if (null == _to) throw new IllegalStateException("Missing 'to'.");

    try {
      final FailureHandler failureHandler = new FailureHandler();
      new ApiDiff(failureHandler, _ignoreSettings, _from, _to, _platform.defaultConfig()).run();
      if (failureHandler.failures() > 0) {
        throw new BuildException(
            "API surfaces do not match. " + format(failureHandler) + " been reported.",
            getLocation());
      }
    } catch (IOException e) {
      throw new BuildException(e, getLocation());
    }
  }
Пример #2
0
 public void setPlatform(String platform) {
   _platform = TargetPlatform.valueOf(platform.toUpperCase());
 }