4

I have a TeamCity settings.kts file where it consists of the Root Project and hence all subsequent sub project. Currently, it's one big massive file and I am trying to split up the KTS file based on projects.

What's the best practice to split up the settings file? Should I do a file per project and how do I reference them from the main settings file?

SamIAm
  • 2,241
  • 6
  • 32
  • 51

1 Answers1

1

TeamCity generates a singe settings.kts file only for small projects.

You can try and play with some big project, download settings in Kotlin format for it.

E.g., here is how generated by TeamCity big project settings look like:

nadias-mbp:projectSettings 2 nburnasheva$ tree
.
├── README
├── ServiceMessages
│   ├── Project.kt
│   └── buildTypes
│       ├── ServiceMessagesChangeBuildStatus.kt
│       ├── ServiceMessages_BuildProgressServiceMessage.kt
│       ├── ServiceMessages_ErrorParsingServiceMessage.kt
│       ├── ServiceMessages_FailBuild.kt
│       └── ServiceMessages_ReportBuildParameterDoNotReport.kt
├── ServiceMessages_ReportBuildParametersChar
│   ├── Project.kt
│   └── buildTypes
│       ├── ServiceMessages_ReportBuildParametersChar_ReportBuildParameter.kt
│       ├── ServiceMessages_ReportBuildParametersChar_ReportBuildParameterWaitReasonWithTooLongValue.kt
│       └── ServiceMessages_ReportBuildParametersChar_ThreadSleep.kt
├── ServiceMessages_ReportBuildParametersChartCopy
│   ├── Project.kt
│   └── buildTypes
│       └── ServiceMessages_ReportBuildParametersChartCopy_ReportBuildPara.kt
├── _Self
│   ├── Project.kt
│   ├── buildTypes
│   │   ├── AnsiParseAnsiColorLoggerOutput.kt
│   │   ├── BuildStepsAutodetection.kt
│   │   ├── CheckPromptParameter.kt
│   │   ├── EchoBuildIdToFile.kt
│   │   ├── EchoParametersToConsole.kt
│   │   ├── EchoUmlaut.kt
│   │   ├── FailBuildOnTextInTheLogs.kt
│   │   ├── MpsQuottingTest.kt
│   │   ├── RunGitCommand.kt
│   │   ├── RunMavenFromCommandLine.kt
│   │   ├── SetPasswordParameterInServiceMessages.kt
│   │   ├── SimpleWindowsEcho.kt
│   │   ├── SparseFile.kt
│   │   └── StderrRunAsOnMacOS.kt
│   └── vcsRoots
│       ├── HttpsGithubComBanadigaPhotoBackupGitRefsHeadsMaster.kt
│       └── HttpsGithubComBurnashevaCommandLineRunnerGitRefsHeadsMaster.kt
├── pom.xml
└── settings.kts

9 directories, 32 files

And here is the content of settings.kts:

import jetbrains.buildServer.configs.kotlin.v2018_2.*

version = "2019.1"
project(_Self.Project)
  • My teamcity seems to generate a single Settings.kts file? I'm not sure how big the project needs to be to generate multiple files? However I do have several build steps and configurations with multiple projects. – SamIAm Dec 17 '19 at 03:58
  • 2
    The default value is 20 entities. If you want to change it please specify "teamcity.configsDsl.singleSettingsKts.maxNumberOfEntities" internal property on the server. For more information - [the related issue](https://youtrack.jetbrains.com/issue/TW-63641) in YouTrack. – Nadia Burnasheva Dec 17 '19 at 10:53
  • Setting the `maxNumberOfEntities` was a great help as I worked to understand the project layout and how to properly package and reference objects. Thank you @Nadia Burnasheva! – sfuqua Feb 25 '20 at 21:13
  • Can someone maybe explain where this property can be set please? The linked issue just mentions that it is an "internal property" but I have no idea where to set this "internal property". Do I need to be admin on TC cloud? I'm still learning my way through TC :) – Eitel Dagnin Nov 10 '22 at 09:57