Can't run gradle task of snapshot dependency - TC9.0.4

Perhaps this is a bug, perhaps it's me misunderstanding the documentation/user interface/concepts.

I have a build 'B' with a snapshot dependency on build A. (A → B).

Build A is a gradle project which runs a gradle task that produces artifacts, which build B also depends on. (A ⇢ B)

This gradle project has several tasks that can be run. As mentioned, Build A runs one of these tasks. But build B also needs to run one of these tasks. The task that build B needs to run does not produce any artifacts.

Both A and B are being built by the same agent, each using the default build directory.

'A' Checkout Dir: /teamcity/buildAgent/work/3d6c12a154d9c771
'B' Checkout Dir: /teamcity/buildAgent/work/edb34a39234114f1

B's Build Step: "Setup Database"
Runner type: Gradle
Gradle tasks: restoreData
Gradle build file: build.gradle
Working directory: %dep.build_a.teamcity.build.default.checkoutDir%   (this should = /teamcity/buildAgent/work/3d6c12a154d9c771)
Gradle Wrapper: (yes)

When I try to run build B, I get a 'Failed to start build' error:

Gradle wrapper script gradlew can not be found in /teamcity/buildAgent/work/edb34a39234114f1/3d6c12a154d9c771/gradlew
Please, provide path to wrapper script in build configuration settings.


When I've specified the working directory as build A's, why is TC injecting build B's? More often than not, I seem to find the %dep.___% references to be unreliable. What can I do to work around this problem?

The only other solution I've come up with is to build 'A' into a static path and set up a build property that references it.

1 comment
Comment actions Permalink

Hi Blaine,

Sorry for delay. Parameter teamcity.build.default.checkoutDir is calculated on server, when actual agent is not known yet, and as such it cannot have absolute path. So path to Working Directory is considered as relative to the build checkout directory.
Why do you need to run build B in the same folder?

0

Please sign in to leave a comment.