Features and Usage

0 views
Skip to first unread message

jmarnold

unread,
Jan 25, 2010, 3:11:54 PM1/25/10
to Project Composer Development Group
Hey guys,

So far my idea is to follow something similar to topshelf (as
discussed here: http://codebetter.com/blogs/dru.sellers/archive/2009/01/11/topshelf.aspx)
in that there is a configuration and a runner for that configuration.

There's nothing too fancy planned yet, other than what's demonstrated
in my first snippet:
http://pastie.org/792754

The major things to note are:

1) Property usage (global and per task - only global is illustrated in
that snippet)
a) Global
b) Per task
c) IPropertySetter - I figured a ConsolePropertySetter would be
nice to defer to user input
d) Explicit property setting: TheValueIs or IsSetWith(Func<string>
function)
e) NAnt-like variable syntax support ("${root.namespace}")

2) Task configuration (With(i => i.Name("MyTask"))

3) Task result storage
a) So far I'm thinking that the "Registry" (see line 18 and 19)
will help facilitate sharing data between tasks. I'd like all tasks to
be constructed via some IoC strategy and this is my first stab at
allowing tasks to depend on the result of another. If anybody has any
ideas I'm MORE than open to them.

4) Explicit task dependencies (DependsOn("task.name"))

5) Support for pre/post execution (see line 30)

I definitely want to have some NAnt support in there. I'm thinking
about wrapping it with a task rather than have an explicit
"ExecuteNAntTask" although the explicit route would be more
predictable. What do you guys think?

Chad Myers

unread,
Jan 25, 2010, 3:23:48 PM1/25/10
to project-...@googlegroups.com
Looking good. You're on the right path here, but a few things come to mind:

This would be much nicer as a rake thing if you're already using Rake. But I understand that basically amounts to a "do over" of all your current work, so I won't push this further. Think about it, though.

Back to C#, I'm curious: How would I execute this thing?  I'm thinking it'll be nice to drop a .cs file in a folder and run:

composer chadproject.cs

And it'll compile chadproject.cs and execute it.

-Chad

jmarnold

unread,
Jan 25, 2010, 3:29:18 PM1/25/10
to Project Composer Development Group
Sadly I'm a little unfamiliar w/ Rake. One thing I don't want to do is
truly reinvent the wheel here and leverage what's out there already.
Can you elaborate on what you mean by "this would be much nicer as a
rake thing"?

Yeah, I envisioned either specifying a *.cs file via a "default host"
or allowing people to build it as an executable.

Chad Myers

unread,
Jan 25, 2010, 3:47:18 PM1/25/10
to project-...@googlegroups.com
For starters, templating and string manip are a lot easier in Ruby.

Rake isn't that much different than NAnt in concept, but in practice it's a lot easier to use, write extensions for, etc.

If you were just getting started with this, I would advise you to look at what Derick Bailey did with Albacore (http://albacorebuild.net/) and either add this as another task to Albacore, or use Albacore as a frame of reference for writing rake tasks.

Basically, what I'd like to do is, from my rake script do something like:

rake newproject "ProjectName" --base-folder:c:\code  --use-template:fubu_and_structuremap_and_nhibernate.yaml

And it'll generate me c:\code\ProjectName with src, lib, etc subfolders.  It'll create a ProjectName.sln as well as a ProjectName.Core subfolder with a csproj in it, etc, etc, etc.

It'll use the yaml file (or json or xml or whatever format you want, yaml is nice, terse, and easy for humans to understand) to control the details (what projects do you want in the SLN file?  What libs/dependencies will you need [i.e. StructureMap, FubuMVC, NHibernate, FluentNHibernate, etc]?).

Eventually it'd be nice to host "packages" somewhere that have a pre-defined yaml and pre-built binaries of dependencies so I could do something like:

rake newproject "ProjectName" --base-folder:c:\code --use-template:http://somecoolsite.com/fubu-getting-started.zip

Or maybe:

rake newproject fubu-getting-started  -name:"ProjectName" --base-folder:c:\code


For more info on YAML, check this:  http://www.yaml.org/start.html

Now, if Rake/Ruby is a stumbling block for you, then forget that, think instead of the usage/workflow. This could be done in C# or whatever.

I guess the more I think about it, I'm not sure how useful having a one-time use fluent API would be.

As I understand from your blog post, you were trying to get away from XML which is good, but I'm not sure that having a one-time Fluent API is useful either.   Unless this was the template itself and you'd use this repeatedly, but plug in new values each time you ran it?  Instead of the YAML file you'd have the project spec/template composed in C# with replaceable parameters? Hrm... I can see that. Sorry I'm thinking out loud.

I still like the idea of YAML, though as opposed to runtime-compiled C# (essentially C#script) or pre-compiled C# (look for DLL's in the bin dir?)

-Chad

Chad Myers

unread,
Jan 25, 2010, 7:09:43 PM1/25/10
to project-...@googlegroups.com
I hope I didn't anger or offend you by this post.

I was just dumping on you what I wanted for FubuMVC and it sounds like you are close to this in general.

If you had other visions, that's cool. I may snag what you've got and use it in FubuMVC the way I was talking about.

-Chad

jmarnold

unread,
Jan 25, 2010, 8:26:42 PM1/25/10
to Project Composer Development Group
No, no, not at all. I'm excited about creating something helpful more
than I am married to a specific implementation. I'm going to look into
Rake/YAML tonight and get a better feel for what you're talking about.

jmarnold

unread,
Jan 26, 2010, 12:05:18 PM1/26/10
to Project Composer Development Group
Looks like Albacore is VERY close to what I had originally planned on
creating. It was really a platform for me to roll up my sleeves and
learn some deeper FI skills but I'm much more interested in the
concept of "packages". This is exactly what I had envisioned using
this for.

I'm going to play around with Albacore and see if I can get it to do
something similar rather than reinventing the wheel (I had only gotten
to the VERY preliminary stages of implementation of this beyond simply
getting it to compile).

Derick Bailey

unread,
Jan 26, 2010, 1:50:28 PM1/26/10
to Project Composer Development Group
Hi Josh / Chad / everyone else.

this project startup seems to be a rather fortuitous event as we were
discussing something very similar on the AlbacoreDev group a few days
ago. I think there is a lot of potential value in doing this, and I'm
glad to see that the idea has it's own vision and leader!

I don't think albacore is the right place for this to live. that
project is all about build automation for .NET systems. Project
Composer seems to be all about project initialization - structure,
default architecture, common component usage, etc. It's a very
different problem space with very different needs. I'm very
interested in the direction of Project Composer, though, and would
love to help out (assuming i can find the time).

If you do decide to take this down the path of Ruby and you see some
components in Albacore that would be beneficial, we should talk about
extracting them from Albacore into a common gem that both projects can
use. i'm sure there's plenty of other great options available for
language choice, though. i think you and chad both have the right idea
in terms of figuring out what this thing should do before deciding on
what language it should run.

-derick

jmarnold

unread,
Jan 26, 2010, 2:33:53 PM1/26/10
to Project Composer Development Group
Hey Derick,

I agree. Perhaps we should focus the discussion in a way that
determines "what this thing should do" rather than "what methods do
people want?". I'll start up a new topic to kind of summarize what
we've come up with so far.

As a side note: I'm a fan of how Albacore is structured and would love
a chance to get my hands dirty with some Ruby work.

- Josh

Reply all
Reply to author
Forward
0 new messages