Kotlin DSL - "This script is not supposed to be inside source root"

Hi,

I'm evaluating moving our project settings to source control.

I followed the instructions at https://www.jetbrains.com/help/teamcity/kotlin-dsl.html.
To get started, I downloaded one of our project settings in Kotlin format:

When I open the directory inside IntelliJ as indicated in the docs, I get a warning that reads “This script is not supposed to be inside source root”, the result being that I don't get the nice autocompletion.

I'm not familiar with this toolchain, I didn't find other reports of a similar issue, and I couldn't get it to work no matter what I tried.

Has anyone encountered this? Any clue as to how we could get it to work?

0
3 comments
Hi,

The error message suggests that the settings.kts file should be placed in a subdirectory rather than directly in the project root.

I recommend checking out this Kotlin tutorial series to deepen your understanding:
https://www.youtube.com/watch?v=YIS7syghJFk&list=PLQ176FUIyIUaW-RqAJLbSZe59l6r7t8wp&index=2

Best Regards,
Tom
0

Thanks Tom,

For anyone in the same position, I asked for support on the public TeamCity issue tracker: https://youtrack.jetbrains.com/issue/TW-95032/VCS-controlled-project-settings-with-Kotlin-DSL-This-script-is-not-supposed-to-be-inside-source-root.
It worked in the end, but I'm not sure if it was putting the `projectSettings` directory inside a `.teamcity` directory or the IntelliJ upgrade that was installed.
 

0
Hi,

Glad to hear you’ve fixed the issue.

It should be related to placing the setting in the .teamcity directory.

Best Regards,
Tom
0

Please sign in to leave a comment.