private void addStaticPropertiesFromConfigurationFile()

in gradle-runner-agent/src/main/java/jetbrains/buildServer/gradle/agent/propertySplit/TeamCityBuildPropertiesGradleSplitter.java [112:135]


  private void addStaticPropertiesFromConfigurationFile(@NotNull Map<Object, Object> staticProperties,
                                                        @NotNull Properties teamCityBuildProperties) throws RunBuildException {

    if (!teamCityBuildProperties.containsKey(TEAMCITY_CONFIGURATION_PROPERTIES_KEY)) return;

    String tcConfigPropertiesFilePath = (String) teamCityBuildProperties.get(TEAMCITY_CONFIGURATION_PROPERTIES_KEY);
    if (tcConfigPropertiesFilePath == null) return;
    File tcConfigPropertiesFile = new File(tcConfigPropertiesFilePath);
    if (!tcConfigPropertiesFile.exists()) return;

    Properties tcConfigFileProperties = readProperties(tcConfigPropertiesFile);
    if (tcConfigFileProperties.containsKey(TEAMCITY_CONFIGURATION_TEST_NAME_FORMAT_KEY)) {
      staticProperties.put(TEAMCITY_CONFIGURATION_TEST_NAME_FORMAT_KEY, tcConfigFileProperties.get(TEAMCITY_CONFIGURATION_TEST_NAME_FORMAT_KEY));
    }
    if (tcConfigFileProperties.containsKey(TEAMCITY_CONFIGURATION_IGNORE_SUITE_FORMAT_KEY)) {
      staticProperties.put(TEAMCITY_CONFIGURATION_IGNORE_SUITE_FORMAT_KEY, tcConfigFileProperties.get(TEAMCITY_CONFIGURATION_IGNORE_SUITE_FORMAT_KEY));
    }
    if (tcConfigFileProperties.containsKey(TEAMCITY_CONFIGURATION_USE_TEST_RETRY_PLUGIN_KEY)) {
      staticProperties.put(TEAMCITY_CONFIGURATION_USE_TEST_RETRY_PLUGIN_KEY, tcConfigFileProperties.get(TEAMCITY_CONFIGURATION_USE_TEST_RETRY_PLUGIN_KEY));
    }
    if (tcConfigFileProperties.containsKey(TEAMCITY_CONFIGURATION_BUILD_BRANCH_KEY)) {
      staticProperties.put(TEAMCITY_CONFIGURATION_BUILD_BRANCH_KEY, tcConfigFileProperties.get(TEAMCITY_CONFIGURATION_BUILD_BRANCH_KEY));
    }
  }