Class XmlProjectSettingsGenerator
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.versionedSettings.XmlProjectSettingsGenerator
-
- All Implemented Interfaces:
ProjectSettingsGenerator
public class XmlProjectSettingsGenerator extends Object implements ProjectSettingsGenerator
-
-
Field Summary
-
Fields inherited from interface jetbrains.buildServer.serverSide.impl.versionedSettings.ProjectSettingsGenerator
ACCEPT_ALL
-
-
Constructor Summary
Constructors Constructor Description XmlProjectSettingsGenerator(VersionedSettingsOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
ensureConfigCompatibility(SProject project, List<String> errors, Map<String,Map<String,String>> idsToRename, Map<String,String> options)
Checks if this generator can produce settings for the given project.ProjectSettingsGenerationResult
generate(VersionedSettingsFileSystem fs, RawConfigsBuilder builder, GenOptions options)
Set<String>
getBuildTypeConfigPaths(SBuildType buildType, ProjectSettingsPaths projectSettingsPaths)
Should return paths to configs of the specified buildType from the root directory of the versioned settings VCS root.String
getFormat()
Returns format supported by this generatorSet<String>
getProjectConfigPaths(SProject project, ProjectSettingsPaths projectSettingsPaths)
Should return paths to configs of the specified project from the root directory of the versioned settings VCS root.ProjectSettingsPathsProvider
getSettingsPathsProvider()
Returns provider of the paths that are used to store Versioned Settings for the given format, e.g., logic related to ".teamcity" for the Kotlin / XML formatsSet<String>
getTemplateConfigPaths(BuildTypeTemplate template, ProjectSettingsPaths projectSettingsPaths)
Should return paths to configs of the specified template from the root directory of the versioned settings VCS root.Set<String>
getVcsRootConfigPaths(SVcsRoot root, ProjectSettingsPaths projectSettingsPaths)
Should return paths to configs of the specified VCS root from the root directory of the versioned settings VCS root.boolean
isCustomFormat()
Indicates whether this project settings generator returns values in custom format that requires additional processing (i.e.boolean
isGenerateFullProject()
Returns true if generator is able to generate full project settings which can be committed to VCSboolean
isMoveEntitiesSupported(SProject project)
Returns true if format supports move of entities in projects hierarchyboolean
isSupportProjectDirRemove()
Whether format supports project dir remove in VCS.boolean
isUIEditingEnabled(SProject project)
Returns true if UI editing was enabled for the specified defining project, i.e.boolean
isUIEditingSupported(SProject project, SProject effectiveProject)
Returns true if UI editing is supported in the specified project and the effective projectvoid
register()
void
setRegistry(ProjectSettingsGeneratorRegistry registry)
void
setVersionedSettingsManager(VersionedSettingsManager versionedSettingsManager)
void
setVersionedSettingsRegistry(VersionedSettingsRegistryEx versionedSettingsRegistry)
void
writeProjectConfigs(SProject project, File dstDir, ProjectSettingsGeneratorConfig config)
Writes project settings of the given project to the specified dir-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.impl.versionedSettings.ProjectSettingsGenerator
generate, generate, generate, generate, getCommitFilePredicate, getDocumentationUrl, getEditableSettingsNote, getFormatDisplayName, getProjectScriptName, getReadOnlyReason, getRootScriptName, getVersions, getZipReadme, isExtIdChangeSupported, isProjectCreateSupported, isProjectDeleteSupported, isProjectMoveSupported, isSupportsRelativeIds, isSupportsRelativeIds, isUseRelativeIds, isVersionedSettingsConfigStoredInVCS, isVersionedSettingsConfigUpdateSupported, isVersionedSettingsRootUpdateSupported, isVisible
-
-
-
-
Constructor Detail
-
XmlProjectSettingsGenerator
public XmlProjectSettingsGenerator(@NotNull VersionedSettingsOptions options)
-
-
Method Detail
-
setVersionedSettingsManager
public void setVersionedSettingsManager(@NotNull VersionedSettingsManager versionedSettingsManager)
-
setRegistry
public void setRegistry(@NotNull ProjectSettingsGeneratorRegistry registry)
-
setVersionedSettingsRegistry
public void setVersionedSettingsRegistry(@NotNull VersionedSettingsRegistryEx versionedSettingsRegistry)
-
register
public void register()
-
isUIEditingEnabled
public boolean isUIEditingEnabled(@NotNull SProject project)
Description copied from interface:ProjectSettingsGenerator
Returns true if UI editing was enabled for the specified defining project, i.e. project where versioned settings were enabled- Specified by:
isUIEditingEnabled
in interfaceProjectSettingsGenerator
- Parameters:
project
- project of interest- Returns:
- see above
-
isUIEditingSupported
public boolean isUIEditingSupported(@NotNull SProject project, @NotNull SProject effectiveProject)
Description copied from interface:ProjectSettingsGenerator
Returns true if UI editing is supported in the specified project and the effective project- Specified by:
isUIEditingSupported
in interfaceProjectSettingsGenerator
- Parameters:
project
- project of interesteffectiveProject
- effective project where versioned settings are enabled
-
isSupportProjectDirRemove
public boolean isSupportProjectDirRemove()
Description copied from interface:ProjectSettingsGenerator
Whether format supports project dir remove in VCS. If it does, then remove of the project in UI leads to commit which removes the dir with projectExtId from VCS.- Specified by:
isSupportProjectDirRemove
in interfaceProjectSettingsGenerator
- Returns:
- see above
-
isMoveEntitiesSupported
public boolean isMoveEntitiesSupported(@NotNull SProject project)
Description copied from interface:ProjectSettingsGenerator
Returns true if format supports move of entities in projects hierarchy- Specified by:
isMoveEntitiesSupported
in interfaceProjectSettingsGenerator
- Returns:
- see above
-
getFormat
@NotNull public String getFormat()
Description copied from interface:ProjectSettingsGenerator
Returns format supported by this generator- Specified by:
getFormat
in interfaceProjectSettingsGenerator
- Returns:
- see above
-
getBuildTypeConfigPaths
@NotNull public Set<String> getBuildTypeConfigPaths(@NotNull SBuildType buildType, @NotNull ProjectSettingsPaths projectSettingsPaths)
Description copied from interface:ProjectSettingsGenerator
Should return paths to configs of the specified buildType from the root directory of the versioned settings VCS root. Should use '/' as a name separator- Specified by:
getBuildTypeConfigPaths
in interfaceProjectSettingsGenerator
- Parameters:
buildType
- buildType of interestprojectSettingsPaths
- custom project settings paths in VCS- Returns:
- see above
-
getTemplateConfigPaths
@NotNull public Set<String> getTemplateConfigPaths(@NotNull BuildTypeTemplate template, @NotNull ProjectSettingsPaths projectSettingsPaths)
Description copied from interface:ProjectSettingsGenerator
Should return paths to configs of the specified template from the root directory of the versioned settings VCS root. Should use '/' as a name separator- Specified by:
getTemplateConfigPaths
in interfaceProjectSettingsGenerator
- Parameters:
template
- template of interestprojectSettingsPaths
- custom project settings paths in VCS- Returns:
- see above
-
getVcsRootConfigPaths
@NotNull public Set<String> getVcsRootConfigPaths(@NotNull SVcsRoot root, @NotNull ProjectSettingsPaths projectSettingsPaths)
Description copied from interface:ProjectSettingsGenerator
Should return paths to configs of the specified VCS root from the root directory of the versioned settings VCS root. Should use '/' as a name separator- Specified by:
getVcsRootConfigPaths
in interfaceProjectSettingsGenerator
- Parameters:
root
- VCS root of interestprojectSettingsPaths
- custom project settings paths in VCS- Returns:
- see above
-
getProjectConfigPaths
@NotNull public Set<String> getProjectConfigPaths(@NotNull SProject project, @NotNull ProjectSettingsPaths projectSettingsPaths)
Description copied from interface:ProjectSettingsGenerator
Should return paths to configs of the specified project from the root directory of the versioned settings VCS root. Should use '/' as a name separator- Specified by:
getProjectConfigPaths
in interfaceProjectSettingsGenerator
- Parameters:
project
- project of interestprojectSettingsPaths
- custom project settings paths in VCS- Returns:
- see above
-
writeProjectConfigs
public void writeProjectConfigs(@NotNull SProject project, @NotNull File dstDir, @NotNull ProjectSettingsGeneratorConfig config)
Description copied from interface:ProjectSettingsGenerator
Writes project settings of the given project to the specified dir- Specified by:
writeProjectConfigs
in interfaceProjectSettingsGenerator
- Parameters:
project
- project of interestdstDir
- destination dirconfig
- options for settings generator
-
generate
@NotNull public ProjectSettingsGenerationResult generate(@NotNull VersionedSettingsFileSystem fs, @NotNull RawConfigsBuilder builder, @NotNull GenOptions options) throws ConfigGenerationException
- Specified by:
generate
in interfaceProjectSettingsGenerator
- Throws:
ConfigGenerationException
-
isGenerateFullProject
public boolean isGenerateFullProject()
Description copied from interface:ProjectSettingsGenerator
Returns true if generator is able to generate full project settings which can be committed to VCS- Specified by:
isGenerateFullProject
in interfaceProjectSettingsGenerator
- Returns:
- see above
-
ensureConfigCompatibility
public void ensureConfigCompatibility(@NotNull SProject project, @NotNull List<String> errors, @NotNull Map<String,Map<String,String>> idsToRename, @NotNull Map<String,String> options)
Description copied from interface:ProjectSettingsGenerator
Checks if this generator can produce settings for the given project. Fills theidsToSubstitute
map for entities where extId should be changed. Reports errors viaerrors
.Options
contains generator specific options which can affect how extIds are mapped to the names in produced settings.- Specified by:
ensureConfigCompatibility
in interfaceProjectSettingsGenerator
-
isCustomFormat
public boolean isCustomFormat()
Description copied from interface:ProjectSettingsGenerator
Indicates whether this project settings generator returns values in custom format that requires additional processing (i.e. DSL)- Specified by:
isCustomFormat
in interfaceProjectSettingsGenerator
- Returns:
- see above
-
getSettingsPathsProvider
@NotNull public ProjectSettingsPathsProvider getSettingsPathsProvider()
Description copied from interface:ProjectSettingsGenerator
Returns provider of the paths that are used to store Versioned Settings for the given format, e.g., logic related to ".teamcity" for the Kotlin / XML formats- Specified by:
getSettingsPathsProvider
in interfaceProjectSettingsGenerator
- Returns:
- see above
-
-