I am trying to setup a TeamCity project configuration using Kotlin DSL https://blog.jetbrains.com/teamcity/2019/03/configuration-as-code-part-1-getting-started-with-kotlin-dsl/
I’ve created a sample project in TeamCity pointing to just an empty Android Studio project (which of course is Gradle based project) with empty Activity which I 've published in the Github. I’ve enabled Kotlin DSL configuration on the TeamCity for that project.
After that TeamCity has commited a .teamcity
folder containing pom.xml
to my Android Studio project. However, when I am inspecting the code in settings.kts
the IDE is not give me any hints and I cannot use the autocompletion for the Kotlin DSL configuration code. For example I cannot navigate to implementation of function triggers
, cannot use autocompletion etc.
I was trying to follow the above mentioned blog guidance but unfortunately I cannot right-click on the pom.xml
file and don’t see any option to Add as Maven
. In addition I cannot see any External Libraries added to my project related to TeamCity DSL
I am using Android Studio 4.0
Here is the project structure:
And this is a pom.xml
which TeamCity added to my Android Studio project (under .teamcity
folder):
<?xml version="1.0"?>
<project>
<modelVersion>4.0.0</modelVersion>
<name>KotlinTeamcityDSL Config DSL Script</name>
<groupId>KotlinTeamcityDSL</groupId>
<artifactId>KotlinTeamcityDSL_dsl</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>configs-dsl-kotlin-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<repositories>
<repository>
<id>jetbrains-all</id>
<url>https://download.jetbrains.com/teamcity-repository</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>teamcity-server</id>
<url>http://localhost:8111/app/dsl-plugins-repository</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>JetBrains</id>
<url>https://download.jetbrains.com/teamcity-repository</url>
</pluginRepository>
</pluginRepositories>
<build>
<sourceDirectory>${basedir}</sourceDirectory>
<plugins>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<configuration/>
<executions>
<execution>
<id>compile</id>
<phase>process-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>process-test-sources</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>teamcity-configs-maven-plugin</artifactId>
<version>${teamcity.dsl.version}</version>
<configuration>
<format>kotlin</format>
<dstDir>target/generated-configs</dstDir>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>configs-dsl-kotlin</artifactId>
<version>${teamcity.dsl.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>configs-dsl-kotlin-plugins</artifactId>
<version>1.0-SNAPSHOT</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-script-runtime</artifactId>
<version>${kotlin.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Is it possible to use such configuration in my case? If so, can you please help me how I should properly setup it in Android Studio to have such benefits in Android Studio Gradle? (Android Studio project uses Gradle by default)