How to use custom resharper CLT from server

Answered

Hello!

Our users were trying to use several versions of Resharper Command Line Tools in one of their builds for different branches. But if you define CLT home i.e. %teamcity.agent.tools.dir%\jetbrains.resharper-clt.%resharper-cli-version% the build dont find nor update resharper tool on agent anymore. Is there any way to define resharper CLT version for different branches or configure build to force server to upload defined version of tool?

Teamcity 2019.1 in production, but we are moving to 2020.1.3

1
1 comment

Hi Cheperr. One of the ways you can do it is via Kotlin DSL. When using configuration as code in Kotlin, you can have different build steps in different branches of the Versioned Settings repository. As long as the VCS root of your project code has the same branch specification as the VCS Root of TeamCity settings, running a build in a branch will also use the build steps from that branch.

So you can have different R# CTL version in different branches, e.g. in branch1 the build steps can look like this:

step {
type = "dotnet-tools-inspectcode"
param("dotnet-tools-inspectcode.solution", "BankSol/Bank.sln")
param("jetbrains.resharper-clt.platform", "x64")
param("jetbrains.resharper-clt.clt-path", "%teamcity.tool.jetbrains.resharper-clt.2020.1.1%")
}

and in branch2 it can look like this:

step {
type = "dotnet-tools-inspectcode"
param("dotnet-tools-inspectcode.solution", "BankSol/Bank.sln")
param("jetbrains.resharper-clt.platform", "x64")
param("jetbrains.resharper-clt.clt-path", "%teamcity.tool.jetbrains.resharper-clt.2019.3.1%")
}

Thus when you run the build configuration in branch1, R# CTL version 2020.1.1 will be used, and when you run the configuration in branch2 - 2019.3.1. Make sure both CTL versions are installed though (Administration > Tools > JetBrains ReSharper Command Line Tools).

Would that help in your use case?

0

Please sign in to leave a comment.