Some notes on the new Build Process and Project Structure

3 views
Skip to first unread message

G. Richard Bellamy

unread,
Oct 13, 2009, 3:13:01 AM10/13/09
to castle-pro...@googlegroups.com
I thought I'd put down some notes and thoughts on the new Build Process and Project Structure.

I'm not quite sure where to start, or what I should cover, so please excuse any rambling, or duplication. John Simons has gone over this before, as well. Any errors or omissions are my own. Kudos to Jono and John for setting this up.

VS.NET and MSBuild do not work on /trunk once a project has been moved and converted to the new structure. Mostly, this is because the directory which holds the SNK and libs has moved, and is no longer at the same level as before (e.g. the old method of finding binary dependencies could use a relative path of "..\..\..\SharedLibs", while the new structure uses "..\..\lib"). This is important because even were we to use the $(Configuration) replacement variable in our VS.NET project files, we would still have to do some on-the-fly manipulation of the XML to make them work in both trees.

NAnt will continue to build /trunk, because each project will be placed back into the old tree using svn:externals. For instance the Binder Component used to reside in /trunk/Components/Binder, and now resides in /Components/Binder/trunk/src, with the /Components/Binder/trunk/src folder being added back into /trunk/Components as an svn:externals entry. The property value for this is: "^/Components/Binder/trunk/src Binder". This means that as long as the Binder project does not drift too far away from it's old NAnt build files, it will continue to build in /trunk because the components.build file will still find it within the working copy. The working copy ends up looking identical to the old structure.

Here's the the step-by-step I used (note that the examples for the Mono libs assume that the net-3.5 IL will work in the mono-3.5 world - there are some projects that this is not true. You know who you are.):
  1. "Create folder" (e.g. /Components/Binder).
  2. Create subfolders for trunk, branches and tags (e.g. /Components/Binder/trunk).
  3. Create a lib folder (e.g. /Components/Binder/trunk/lib).
  4. "Copy to..." from the old folder to a new folder called src (e.g. from /trunk/Components/Binder to /Components/Binder/trunk/src).
  5. "Delete" the old folder (e.g. /trunk/Components/Binder).
  6. Add an svn:externals entry to the parent directory of the old structure (e.g. svn:externals "^/Components/Binder/trunk/src Transaction" to /trunk/Services).
  7. Add an svn:externals to the new trunk from /buildscripts. Ignore the build directory. (e.g. svn:externals "^/buildscripts buildscripts" to /Components/Binder/trunk).
  8. Populate the lib folder with dependencies, including Castle binaries. Make a subdirectory for each framework target. This requires that you have a set handy - hence the necessity of ensuring the old /trunk compiles in NAnt. (e.g. Look at the references in the Castle.Components.Binder and Castle.Components.Binder.Tests projects, and copy the necessary assemblies from the build artifacts directory /trunk/build/net-3.5/release to /Components/Binder/trunk/lib/net-3.5 and  /Components/Binder/trunk/lib/mono-3.5, respectively).
  9. Replace all project-based dependencies in the primary project(s) (e.g. replace all project-based dependencies in the Castle.Components.Binder VS.NET project with binary references, targeting the assemblies in /Components/Binder/trunk/lib/net-3.5).
  10. Do the same with the Test project, but leave the reference to the primary project(s) (e.g. in the Castle.Components.Binder.Tests project, leave the project-based dependency to Castle.Components.Binder. Replace all other project-based dependencies with binary dependencies).
  11. Modify the projects to find the SNK file located in the buildscripts folder (e.g. /Components/Binder/trunk/src/buildscripts).
  12. Create and add AssemblyInfo.cs files to each project.
  13. Add a default.build file to trunk/src and subdirectories (e.g. /Components/Binder/trunk/src, /Components/Binder/src/Castle.Components.Binder and /Components/Binder/src/Castle.Components.Binder.Tests)
  14. Configure the default.build files. Look at the projects already migrated for an example.
  15. Configure the TeamCity Project with Build Configurations. Make sure the VCS Checkout Rule always points to a path that exists. If the project doesn't have a release branch or tag yet, point the rule at the trunk.
  16. Build Goodness locally and on TeamCity.
Once the project has been moved and converted, it will build standalone. This is a first for Castle, and in my mind very desirable.

- rb

John Simons

unread,
Oct 13, 2009, 3:33:02 AM10/13/09
to Castle Project Development List
Richard, Thanks a lot for clarifying my mess!

A few extra things:
On step 11 you can optionally remove the snk, because we use nant to
build and the nant script ensures that all assemblies get signed
regardless.
Step 7 is a bit different for tagged versions (release versions), what
you have to do is modify the svn:external to point to a pegged
revision of the buildscript so that if we modify the buildscript the
tagged version doesn't get affected by that change. eg ^/
buildscripts@6082 buildscripts

Just one observation:
Builds work fine in .net-3.5 but for some bizarre reasons some tests
are failing on the mono build, and sometimes the tests pass on windows
mono but fail on linux mono.


Cheers
John


On Oct 13, 6:13 pm, "G. Richard Bellamy" <rbell...@pteradigm.com>
wrote:
>    1. "Create folder" (e.g. /Components/Binder).
>    2. Create subfolders for trunk, branches and tags (e.g.
>    /Components/Binder/trunk).
>    3. Create a lib folder (e.g. /Components/Binder/trunk/lib).
>    4. "Copy to..." from the old folder to a new folder called src (e.g. from
>    /trunk/Components/Binder to /Components/Binder/trunk/src).
>    5. "Delete" the old folder (e.g. /trunk/Components/Binder).
>    6. Add an svn:externals entry to the parent directory of the old
>    structure (e.g. svn:externals "^/Components/Binder/trunk/src Transaction" to
>    /trunk/Services).
>    7. Add an svn:externals to the new trunk from /buildscripts. Ignore the
>    build directory. (e.g. svn:externals "^/buildscripts buildscripts" to
>    /Components/Binder/trunk).
>    8. Populate the lib folder with dependencies, including Castle binaries.
>    Make a subdirectory for each framework target. This requires that you have a
>    set handy - hence the necessity of ensuring the old /trunk compiles in NAnt.
>    (e.g. Look at the references in the Castle.Components.Binder and
>    Castle.Components.Binder.Tests projects, and copy the necessary assemblies
>    from the build artifacts directory /trunk/build/net-3.5/release to
>    /Components/Binder/trunk/lib/net-3.5 and
>     /Components/Binder/trunk/lib/mono-3.5, respectively).
>    9. Replace all project-based dependencies in the primary project(s) (e.g.
>    replace all project-based dependencies in the Castle.Components.Binder
>    VS.NET project with binary references, targeting the assemblies in
>    /Components/Binder/trunk/lib/net-3.5).
>    10. Do the same with the Test project, but leave the reference to the
>    primary project(s) (e.g. in the Castle.Components.Binder.Tests project,
>    leave the project-based dependency to Castle.Components.Binder. Replace all
>    other project-based dependencies with binary dependencies).
>    11. Modify the projects to find the SNK file located in the buildscripts
>    folder (e.g. /Components/Binder/trunk/src/buildscripts).
>    12. Create and add AssemblyInfo.cs files to each project.
>    13. Add a default.build file to trunk/src and subdirectories (e.g.
>    /Components/Binder/trunk/src,
>    /Components/Binder/src/Castle.Components.Binder and
>    /Components/Binder/src/Castle.Components.Binder.Tests)
>    14. Configure the default.build files. Look at the projects already
>    migrated for an example.
>    15. Configure the TeamCity Project with Build Configurations. Make sure
>    the VCS Checkout Rule always points to a path that exists. If the project
>    doesn't have a release branch or tag yet, point the rule at the trunk.
>    16. Build Goodness locally and on TeamCity.

Krzysztof Koźmic (2)

unread,
Oct 13, 2009, 3:36:07 AM10/13/09
to Castle Project Development List
Richard,

let me see if I got this straight - we won't be able to build for VS
after the change?
>    1. "Create folder" (e.g. /Components/Binder).
>    2. Create subfolders for trunk, branches and tags (e.g.
>    /Components/Binder/trunk).
>    3. Create a lib folder (e.g. /Components/Binder/trunk/lib).
>    4. "Copy to..." from the old folder to a new folder called src (e.g. from
>    /trunk/Components/Binder to /Components/Binder/trunk/src).
>    5. "Delete" the old folder (e.g. /trunk/Components/Binder).
>    6. Add an svn:externals entry to the parent directory of the old
>    structure (e.g. svn:externals "^/Components/Binder/trunk/src Transaction" to
>    /trunk/Services).
>    7. Add an svn:externals to the new trunk from /buildscripts. Ignore the
>    build directory. (e.g. svn:externals "^/buildscripts buildscripts" to
>    /Components/Binder/trunk).
>    8. Populate the lib folder with dependencies, including Castle binaries.
>    Make a subdirectory for each framework target. This requires that you have a
>    set handy - hence the necessity of ensuring the old /trunk compiles in NAnt.
>    (e.g. Look at the references in the Castle.Components.Binder and
>    Castle.Components.Binder.Tests projects, and copy the necessary assemblies
>    from the build artifacts directory /trunk/build/net-3.5/release to
>    /Components/Binder/trunk/lib/net-3.5 and
>     /Components/Binder/trunk/lib/mono-3.5, respectively).
>    9. Replace all project-based dependencies in the primary project(s) (e.g.
>    replace all project-based dependencies in the Castle.Components.Binder
>    VS.NET project with binary references, targeting the assemblies in
>    /Components/Binder/trunk/lib/net-3.5).
>    10. Do the same with the Test project, but leave the reference to the
>    primary project(s) (e.g. in the Castle.Components.Binder.Tests project,
>    leave the project-based dependency to Castle.Components.Binder. Replace all
>    other project-based dependencies with binary dependencies).
>    11. Modify the projects to find the SNK file located in the buildscripts
>    folder (e.g. /Components/Binder/trunk/src/buildscripts).
>    12. Create and add AssemblyInfo.cs files to each project.
>    13. Add a default.build file to trunk/src and subdirectories (e.g.
>    /Components/Binder/trunk/src,
>    /Components/Binder/src/Castle.Components.Binder and
>    /Components/Binder/src/Castle.Components.Binder.Tests)
>    14. Configure the default.build files. Look at the projects already
>    migrated for an example.
>    15. Configure the TeamCity Project with Build Configurations. Make sure
>    the VCS Checkout Rule always points to a path that exists. If the project
>    doesn't have a release branch or tag yet, point the rule at the trunk.
>    16. Build Goodness locally and on TeamCity.

John Simons

unread,
Oct 13, 2009, 3:42:50 AM10/13/09
to Castle Project Development List
You are able to build in VS, but not the /trunk version.
so eg. TemplateEngine has been migrated so if you want to open it in
vs, do a get from https://svn.castleproject.org/svn/castle/Components/TemplateEngine/trunk
and then open it in vs src/TemplateEngine.sln

Cheers
John

G. Richard Bellamy

unread,
Oct 14, 2009, 5:37:21 PM10/14/09
to castle-pro...@googlegroups.com
Why do we call our mono libs folder "mono-3.5"? Shouldn't it be something more like "mono-2.4" or "mono-2.0"?

2009/10/13 John Simons <johnsi...@yahoo.com.au>

John Simons

unread,
Oct 14, 2009, 6:29:08 PM10/14/09
to Castle Project Development List
Because that is what nant calls it. It could be changes.


On Oct 15, 8:37 am, "G. Richard Bellamy" <rbell...@pteradigm.com>
wrote:
> Why do we call our mono libs folder "mono-3.5"? Shouldn't it be something
> more like "mono-2.4" or "mono-2.0"?
>
> 2009/10/13 John Simons <johnsimons...@yahoo.com.au>

G. Richard Bellamy

unread,
Oct 14, 2009, 6:49:24 PM10/14/09
to castle-pro...@googlegroups.com
Oh, yeah... now I see. It must be that Mono 2.4 is targeting compatibility with .NET 3.5 (which is the 2.0 runtime, yes?).

That's not confusing at all. :)

2009/10/14 John Simons <johnsi...@yahoo.com.au>

Daniel Hölbling

unread,
Oct 14, 2009, 6:51:14 PM10/14/09
to castle-pro...@googlegroups.com
Yes.. 3.0 and 3.5 are all targeting the 2.0 runtime just with more BCL classes and compiler extensions.

2009/10/15 G. Richard Bellamy <rbel...@pteradigm.com>
Reply all
Reply to author
Forward
0 new messages