public Collection process()

in fxcop-server/src/jetbrains/buildServer/fxcop/server/FxCopRunTypePropertiesProcessor.java [23:54]


  public Collection<InvalidProperty> process(Map<String, String> properties) {
    List<InvalidProperty> result = new Vector<InvalidProperty>();

    final String files = properties.get(FxCopConstants.SETTINGS_FILES);
    final String project = properties.get(FxCopConstants.SETTINGS_PROJECT);

    if (PropertiesUtil.isEmptyOrNull(project) && PropertiesUtil.isEmptyOrNull(files)) {
      result.add(new InvalidProperty(FxCopConstants.SETTINGS_FILES, "Files or project option must be specified"));
    }

    if(FxCopConstants.DETECTION_MODE_MANUAL.equals(properties.get(FxCopConstants.SETTINGS_DETECTION_MODE))){
      final String fxcopRoot = properties.get(FxCopConstants.SETTINGS_FXCOP_ROOT);
      if (PropertiesUtil.isEmptyOrNull(fxcopRoot)) {
        result.add(new InvalidProperty(FxCopConstants.SETTINGS_FXCOP_ROOT, "FxCop installation root must be specified"));
      }
    }

    if (FxCopConstants.DETECTION_MODE_MANUAL.equals(properties.get(FxCopConstants.SETTINGS_DETECTION_MODE))) {
      resetProperty(properties, FxCopConstants.SETTINGS_FXCOP_VERSION);
    } else {
      resetProperty(properties, FxCopConstants.SETTINGS_FXCOP_ROOT);
    }

    if (FxCopConstants.WHAT_TO_INSPECT_PROJECT.equals(properties.get(FxCopConstants.SETTINGS_WHAT_TO_INSPECT))) {
      resetProperty(properties, FxCopConstants.SETTINGS_FILES);
      resetProperty(properties, FxCopConstants.SETTINGS_FILES_EXCLUDE);
    } else {
      resetProperty(properties, FxCopConstants.SETTINGS_PROJECT);
    }

    return result;
  }