Interface ProjectSettingsGenerator
-
- All Known Implementing Classes:
XmlProjectSettingsGenerator,YamlPipelineSettingsGenerator
public interface ProjectSettingsGenerator
-
-
Field Summary
Fields Modifier and Type Field Description static BiPredicate<String,File>ACCEPT_ALL
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidensureConfigCompatibility(SProject project, List<String> errors, Map<String,Map<String,String>> idsToSubstitute, Map<String,String> options)Checks if this generator can produce settings for the given project.default ConfigurationEntityGenerationResultgenerate(BuildTypeTemplate template, Map<String,String> genOptions)Generates configuration for given build configurationdefault <T> ConfigurationEntityGenerationResultgenerate(BuildTypeTemplate template, T entity, Map<String,String> genOptions)Generates configuration for given build entityProjectSettingsGenerationResultgenerate(VersionedSettingsFileSystem fs, RawConfigsBuilder builder, GenOptions options)default ConfigurationEntityGenerationResultgenerate(SBuildType buildType, Map<String,String> genOptions)Generates configuration for given build configurationdefault <T> ConfigurationEntityGenerationResultgenerate(SBuildType buildType, T entity, Map<String,String> genOptions)Generates configuration for given build entitySet<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.default BiPredicate<String,File>getCommitFilePredicate()Returns predicate for file and its path relative to project root to be committed in VCS.default StringgetDocumentationUrl()Returns documentation url for this format or null if there is no documentationdefault StringgetEditableSettingsNote(String entityDescription)Returns admin area header note text to be shown in editable projects which use this format or null if no note should be shownStringgetFormat()Returns format supported by this generatordefault StringgetFormatDisplayName()Returns format's display name to show in format chooser in UISet<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.default StringgetProjectScriptName()Returns name of per-project root script or null if per-project script is not supporteddefault StringgetReadOnlyReason(SProject project)Returns a reason why UI editing is disabled for a project or null if project is not read-only.default StringgetRootScriptName()Returns name of the root script or null if root script is not supportedProjectSettingsPathsProvidergetSettingsPathsProvider()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.default List<String>getVersions()Returns available format versions or empty list if the format has only one versiondefault StringgetZipReadme()Returns contents of the README file to be written to the root of settings archive or null if no README should be writtendefault booleanisCustomFormat()Indicates whether this project settings generator returns values in custom format that requires additional processing (i.e.default booleanisExtIdChangeSupported()Returns true if format supports external id changedefault booleanisGenerateFullProject()Returns true if generator is able to generate full project settings which can be committed to VCSdefault booleanisMoveEntitiesSupported(SProject project)Returns true if format supports move of entities in projects hierarchydefault booleanisProjectCreateSupported()Returns true if format supports new project creationdefault booleanisProjectDeleteSupported(SProject project)Returns true if format supports project deletiondefault booleanisProjectMoveSupported(SProject project)Returns true if move operation is supported for the project and all its entitiesdefault booleanisSupportProjectDirRemove()Whether format supports project dir remove in VCS.default booleanisSupportsRelativeIds()Returns true if this format supports settings with relative idsdefault booleanisSupportsRelativeIds(String version)Returns true if the specified version of this format supports settings with relative idsdefault booleanisUIEditingEnabled(SProject project)Returns true if UI editing was enabled for the specified defining project, i.e.default booleanisUIEditingSupported(SProject project, SProject effectiveProject)Returns true if UI editing is supported in the specified project and the effective projectdefault booleanisUseRelativeIds(SProject project)default booleanisVersionedSettingsConfigStoredInVCS(SProject project)Returns true if versioned settings config is stored in VCS and can be edited there (if not - we have to allow to edit it in UI)default booleanisVersionedSettingsConfigUpdateSupported(SProject project)Returns true if versioned settings config update in UI is supported in the given projectdefault booleanisVersionedSettingsRootUpdateSupported(SVcsRoot root)Returns true if update in UI of the specified versioned settings VCS root is supporteddefault booleanisVisible()Indicates whether this format should be hidden for users selection, e.g.voidwriteProjectConfigs(SProject project, File dstDir, ProjectSettingsGeneratorConfig config)Writes project settings of the given project to the specified dir
-
-
-
Field Detail
-
ACCEPT_ALL
static final BiPredicate<String,File> ACCEPT_ALL
-
-
Method Detail
-
isUIEditingEnabled
default boolean isUIEditingEnabled(@NotNull SProject project)Returns true if UI editing was enabled for the specified defining project, i.e. project where versioned settings were enabled- Parameters:
project- project of interest- Returns:
- see above
-
isUIEditingSupported
default boolean isUIEditingSupported(@NotNull SProject project, @NotNull SProject effectiveProject)Returns true if UI editing is supported in the specified project and the effective project- Parameters:
project- project of interesteffectiveProject- effective project where versioned settings are enabled
-
isUseRelativeIds
default boolean isUseRelativeIds(@NotNull SProject project)
-
getDocumentationUrl
@Nullable default String getDocumentationUrl()
Returns documentation url for this format or null if there is no documentation- Returns:
- see above
-
getVersions
@NotNull default List<String> getVersions()
Returns available format versions or empty list if the format has only one version- Returns:
- see above
-
getFormat
@NotNull String getFormat()
Returns format supported by this generator- Returns:
- see above
-
getFormatDisplayName
@NotNull default String getFormatDisplayName()
Returns format's display name to show in format chooser in UI- Returns:
- see above
-
generate
@NotNull ProjectSettingsGenerationResult generate(@NotNull VersionedSettingsFileSystem fs, @NotNull RawConfigsBuilder builder, @NotNull GenOptions options) throws ConfigGenerationException
- Throws:
ConfigGenerationException
-
generate
default ConfigurationEntityGenerationResult generate(@NotNull SBuildType buildType, @NotNull Map<String,String> genOptions)
Generates configuration for given build configuration- Parameters:
buildType- build configurationgenOptions-- Returns:
- Since:
- 2018.2
-
generate
default ConfigurationEntityGenerationResult generate(@NotNull BuildTypeTemplate template, @NotNull Map<String,String> genOptions)
Generates configuration for given build configuration- Parameters:
template- build configuration templategenOptions-- Returns:
- Since:
- 2018.2
-
generate
default <T> ConfigurationEntityGenerationResult generate(@NotNull SBuildType buildType, @NotNull T entity, @NotNull Map<String,String> genOptions)
Generates configuration for given build entity- Parameters:
buildType- build configurationgenOptions-- Returns:
- Since:
- 2018.2
-
generate
default <T> ConfigurationEntityGenerationResult generate(@NotNull BuildTypeTemplate template, @NotNull T entity, @NotNull Map<String,String> genOptions)
Generates configuration for given build entity- Parameters:
template- build configuration templategenOptions-- Returns:
- Since:
- 2018.2
-
getBuildTypeConfigPaths
@NotNull Set<String> getBuildTypeConfigPaths(@NotNull SBuildType buildType, @NotNull ProjectSettingsPaths projectSettingsPaths)
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- Parameters:
buildType- buildType of interestprojectSettingsPaths- custom project settings paths in VCS- Returns:
- see above
-
getTemplateConfigPaths
@NotNull Set<String> getTemplateConfigPaths(@NotNull BuildTypeTemplate template, @NotNull ProjectSettingsPaths projectSettingsPaths)
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- Parameters:
template- template of interestprojectSettingsPaths- custom project settings paths in VCS- Returns:
- see above
-
getVcsRootConfigPaths
@NotNull Set<String> getVcsRootConfigPaths(@NotNull SVcsRoot root, @NotNull ProjectSettingsPaths projectSettingsPaths)
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- Parameters:
root- VCS root of interestprojectSettingsPaths- custom project settings paths in VCS- Returns:
- see above
-
getProjectConfigPaths
@NotNull Set<String> getProjectConfigPaths(@NotNull SProject project, @NotNull ProjectSettingsPaths projectSettingsPaths)
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- Parameters:
project- project of interestprojectSettingsPaths- custom project settings paths in VCS- Returns:
- see above
-
writeProjectConfigs
void writeProjectConfigs(@NotNull SProject project, @NotNull File dstDir, @NotNull ProjectSettingsGeneratorConfig config)Writes project settings of the given project to the specified dir- Parameters:
project- project of interestdstDir- destination dirconfig- options for settings generator
-
isGenerateFullProject
default boolean isGenerateFullProject()
Returns true if generator is able to generate full project settings which can be committed to VCS- Returns:
- see above
-
getCommitFilePredicate
@NotNull default BiPredicate<String,File> getCommitFilePredicate()
Returns predicate for file and its path relative to project root to be committed in VCS. If the predicate returns false, the file won't be committed.- Returns:
- see above
-
isSupportProjectDirRemove
default boolean isSupportProjectDirRemove()
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.- Returns:
- see above
-
isExtIdChangeSupported
default boolean isExtIdChangeSupported()
Returns true if format supports external id change- Returns:
- see above
-
isMoveEntitiesSupported
default boolean isMoveEntitiesSupported(@NotNull SProject project)Returns true if format supports move of entities in projects hierarchy- Returns:
- see above
-
isProjectCreateSupported
default boolean isProjectCreateSupported()
Returns true if format supports new project creation- Returns:
- see above
-
isProjectMoveSupported
default boolean isProjectMoveSupported(@NotNull SProject project)Returns true if move operation is supported for the project and all its entities- Returns:
- see above
-
isProjectDeleteSupported
default boolean isProjectDeleteSupported(@NotNull SProject project)Returns true if format supports project deletion- Parameters:
project- project of interest- Returns:
- see above
-
isVersionedSettingsRootUpdateSupported
default boolean isVersionedSettingsRootUpdateSupported(@NotNull SVcsRoot root)Returns true if update in UI of the specified versioned settings VCS root is supported- Returns:
- see above
-
isVersionedSettingsConfigUpdateSupported
default boolean isVersionedSettingsConfigUpdateSupported(@NotNull SProject project)Returns true if versioned settings config update in UI is supported in the given project
-
isVersionedSettingsConfigStoredInVCS
default boolean isVersionedSettingsConfigStoredInVCS(@NotNull SProject project)Returns true if versioned settings config is stored in VCS and can be edited there (if not - we have to allow to edit it in UI)
-
getReadOnlyReason
@Nullable default String getReadOnlyReason(@NotNull SProject project)
Returns a reason why UI editing is disabled for a project or null if project is not read-only.- Parameters:
project- project of interest
-
getEditableSettingsNote
@Nullable default String getEditableSettingsNote(@NotNull String entityDescription)
Returns admin area header note text to be shown in editable projects which use this format or null if no note should be shown- Parameters:
entityDescription- e.g. "Project", "Build configuration", or "Template"
-
isSupportsRelativeIds
default boolean isSupportsRelativeIds()
Returns true if this format supports settings with relative ids
-
isSupportsRelativeIds
default boolean isSupportsRelativeIds(@NotNull String version)Returns true if the specified version of this format supports settings with relative ids
-
getRootScriptName
@Nullable default String getRootScriptName()
Returns name of the root script or null if root script is not supported
-
getProjectScriptName
@Nullable default String getProjectScriptName()
Returns name of per-project root script or null if per-project script is not supported
-
getZipReadme
@Nullable default String getZipReadme()
Returns contents of the README file to be written to the root of settings archive or null if no README should be written
-
ensureConfigCompatibility
void ensureConfigCompatibility(@NotNull SProject project, @NotNull List<String> errors, @NotNull Map<String,Map<String,String>> idsToSubstitute, @NotNull Map<String,String> options)Checks if this generator can produce settings for the given project. Fills theidsToSubstitutemap for entities where extId should be changed. Reports errors viaerrors.Optionscontains generator specific options which can affect how extIds are mapped to the names in produced settings.
-
isCustomFormat
default boolean isCustomFormat()
Indicates whether this project settings generator returns values in custom format that requires additional processing (i.e. DSL)- Returns:
- see above
- Since:
- 2018.2
-
isVisible
default boolean isVisible()
Indicates whether this format should be hidden for users selection, e.g. on the Versioned Setting Configuration page- Returns:
- see above
-
getSettingsPathsProvider
@NotNull 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 formats- Returns:
- see above
-
-