Interface ProjectSettingsGenerator

    • 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 interest
        effectiveProject - 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
      • 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 interest
        projectSettingsPaths - 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 interest
        projectSettingsPaths - 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 interest
        projectSettingsPaths - 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 interest
        projectSettingsPaths - 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 interest
        dstDir - destination dir
        config - 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 the idsToSubstitute map for entities where extId should be changed. Reports errors via errors. Options contains 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