Need help configuring dependencies

I have a very basic configuration:

1) Compile Java
2) JUnit
3) CheckStyle
4) Findbugs

Even though this seems like a pretty vanilla configuration, it's not clear to me how I should configure the dependencies for this project. I assumed the "compile" would do the label, get, and build, of the code. Then, each of the subsequent items would just depend on the output of that first step. If that's true, then is this achieved by simply making all the downstream build configuration dependent on this first item? And, does that mean each of these dependent items will use the results of the get that was done in the first step? Or, will each of these do it's own get from the VCS repository?

Also, if they each do their own get and I tell the compile configuration to do a custom build against and older label, how will those downstream configuration know that they are also supposed to do their get using this older label? For example, if I tell the compile configuration to use the old "1.1" label, while the CheckStyle build configuration examine the source from this older label or will use the source that was retrieved using the old "1.1" label.

Overall, it would just be nice to understand how and when TeamCity does its get from VCS, how and when it labels (before or after the build), and how custom build againt old labels factor into this? I'm sure it's all very simple, but there's nothing I find in the docs that seems to explain this general policy.

Also, your live demo has an example that's already out there that seems like it would serve as a great reference for what I'm trying to do. It includes most of the same configurations I am using. Is there any way you can provide the Ant scripts and underlying build configuration files for that example? That would be a tremendous help. Right now, while the documentation for the product is very good, it tries so hard to generalize that it avoids providing any good contextual examples that would at least cover some of the common scenarios.

1 comment
Comment actions Permalink

Are you trying to make each step a separate build configuration, or just have one single Ant call that does everything?  I've found that the simplest method is just to have a single Ant call that performs the build and JUnit tests.  Putting everything in one chain gives you the most control over the dependencies.

So far as using the same sources goes, you can guarantee that the same revision from your VCS will be used by configuring Snapshot dependencies from one step to the next.  In this case, if the flow is in the order you specify and you set JUnit to have a snapshot dependency on Compile, Checkstyle to depend on JUnit, and Findbugs to depend on  Checkstyle, then running Findbugs would force each of the prior three to run in order and all would run on the same rev of the sources.  You can't guarantee that they'll run on the same copy of the sources, however, AFAIK, especially since it's possible for them to run on different agents.

I really haven't used TC's labelling much, so I can't give you advice there.

So far as how the gets work, it depends on whether you do checkout on Server or checkout on Agent; I'll use Subversion terminology since it's what I am used to using with TC.  In "checkout on server" TC performs the checkout in the .buildServer working directory, forms a patch and passes that to the agent.  The agent effectively has an exported copy of the tree, not a working copy.  In "checkout on agent" the agent creates its own working copy with all the svn metadata.

HTH

0

Please sign in to leave a comment.