views:

403

answers:

2

This is a continuation question from a previous question I have asked

I now have a /externals directory in the root of my project tree. Inside this I have a reference to another project. I'm able to script the build of all my externals in the main project NAnt script. The result of these builds are as follows:

/externals/external-project1/build/buildartifacts/{dlls|html|js}

/externals/external-project2/build/buildartifacts/{dlls|html|js}

This is all well and good, but now I'm curious as to how my main project should reference these build artifacts. For example, let's say that external project builds a DLL that some of my codebase depends on. Should I simply reference the DLL in the build artifacts directory or should I implement another NAnt task that copies these to a /thirdparty/libs/ folder?

This means that my build is now dependent on the ability to build this external project (which could either be internal, or thirdparty). Is it a good idea to check in the latest set of build artifacts to ensure that the main build won't break because of dependent builds breaking?

Hope that's clear enough. Just writing this down has a least clarified the problem for me :-).

--Edit--

Thanks guys. I think I'm going to implement the "checkout a revision", but since the builds are so quick I'm not going to check in any build artifiacts. Also going to have to figure out how to deal with the dependencies of the external project (eg: prototype, swfobject, etc).

+1  A: 

I'd say build them once and check the build artifacts in /public/ext/some_dependency/ref (obviously, the naming of that folder is up to you :-)) and reference them from there.

My main reason is that you seldom need to build external dependencies every time you do a build of your product. In general external dependencies should be changing rarely. Plus, you want strict control over when you pick external dependency changes, to avoid introducing instability during the coding phase.

As a extension to this, I would add a separate CI task that would build the external dependencies only and check them in the aforementioned folder upon some external condition - a commit in the dependency source folder or something else.

Franci Penov
+1  A: 

One of the recommendations I had (which I think came from the Pragmatic Version Control book by Mike Mason) to refer to particular revision in your external, so that you always get the same version of the external dependency until you explicitly choose to change it.

At this point, you have probably interactively built it once to make sure it works, so relying on it to build every time isn't really an issue, which avoids the need to add some indirection in your build tasks.

If you choose to have the indirection, and for some reason a build does fail on an external, it is possible this will be missed as the next nant task will pick up the previous binary.

marcj