Splitting TeamCity Kotlin into multiple files and subfolders
Answered
What a good practice? Maybe there are some examples for big projects? How to separate project with subfolders?
Please sign in to leave a comment.
Hi M Rublev,
When a project becomes large enough, TeamCity will automatically split it into multiple files and subfolders. Below you can see an example of my test project's structure.
You can see the '_Self' package that contains the original project where I have versioned settings enabled on the screenshot. It has its 'Project.kt' file that describes the entire project and multiple Kotlin objects in corresponding packages that describe VCS Roots and Build Configurations (buildTypes). You can also see multiple subprojects with a similar structure.
Keep in mind that you don't have to follow this particular style. You can create your own structure. Just make sure to correctly import everything from the corresponding packages (see the highlight in the imports section).
Can I build same structure folder with Kotlin DSL?
Sure, this structure doesn't conflict with my above example. But again, you can use any structure you like. Just don't forget to import everything you need from the corresponding places.
Thank you, maybe there some examples on GitHub?
We don't have anything like that, unfortunately. But you can start by checking Kotlin DSL documentation here: https://www.jetbrains.com/help/teamcity/kotlin-dsl.html
And also, you can check Kotlin DSL docs on your TeamCity server by accessing this endpoint /app/dsl-documentation/index.html on it.
Ok, thank you for help!
Happy to help :)