Skip to content

Commit

Permalink
lots more docs for the templating
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydmiller committed Dec 19, 2013
1 parent 48c6440 commit dc288f7
Show file tree
Hide file tree
Showing 9 changed files with 174 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/Fubu/Generation/AddCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public TemplateChoices ToChoices()
}
}

[CommandDescription("Adds new projects to an existing solution")]
public class AddCommand : FubuCommand<AddInput>
{
public AddCommand()
Expand Down
7 changes: 0 additions & 7 deletions src/fubu.Docs/2.templating.spark

This file was deleted.

110 changes: 110 additions & 0 deletions src/fubu.Docs/2.templating/1.new-solutions-and-code-trees.spark
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<!--Title: New Solutions and Code Trees-->
<!--Url: new-solutions-and-code-trees-->

<Section title="Solution Layout" id="layout">
Let's say you open a command prompt and type <code>fubu new MyNewApp</code>.
At the end of the command you should have a new <code>MyNewApp</code> folder that looks like this:

* rakefile
* .gitignore
* Gemfile - we use a handful of command line tools and Ruby libraries in the build that are distributed as gems
* instructions.txt
* ripple.config - configures the Nuget feeds and policies for this solution
* VERSION.txt - crude way we use to declare the current version of the libraries and applications in the codebase
* /src - you can change this, but we typically use "src" to hold all the source code for a code repository
* /src/MyNewApp.sln
* /src/MyNewApp
* /src/MyNewApp.Testing - testing library for the MyNewApp application
</Section>

TODO(Link to FubuTestingSupport somewhere here.)

<Section title="FubuMVC Applications" id="fubumvc-app">
The default for <code>fubu new</code> is a brand new FubuMVC application, so the basic usage is:

<pre>
fubu new MyApp
</pre>

The default choices will build out a new FubuMVC application that uses <ProjectLink name="StructureMap /> as the IoC container,
*no view engines*, and the VS.Net web server as your "F5" development server. You will however, get rake tasks in your build
script for running your new application with Katana hosting.

See <TopicLink name="hosting" /> for more information.

The rake tasks for your newly generated FubuMVC solution should be:

<pre>
rake ci # Target used for the CI server
rake clean # Prepares the working directory for a new build
rake compile # Compiles the solution src/MyApp.sln
rake default # **Default**, compiles and runs tests
rake docs:bottle # 'Bottles' up a single project in the solution with...
rake docs:run # Runs a documentation project hosted in FubuWorld
rake docs:run_chrome # Runs the documentation projects in this solution i...
rake docs:run_firefox # Runs the documentation projects in this solution i...
rake docs:snippets # Gathers up code snippets from the solution into th...
rake myapp:alias # Add the alias for src/MyApp
rake myapp:chrome # run the application with Katana hosting and 'watch...
rake myapp:firefox # run the application with Katana hosting and 'watch...
rake myapp:restart # touch the web.config file to force ASP.Net hosting...
rake myapp:run # run the application with Katana hosting
rake ripple:history # creates a history file for nuget dependencies
rake ripple:package # packages the nuget files from the nuspec files in ...
rake ripple:restore # Restores nuget package files and updates all float...
rake ripple:update # Updates nuget package files to the latest
rake sln # Open solution src/MyApp.sln
rake unit_test # Runs unit tests for MyApp.Testing
rake version # Update the version information for the build
</pre>

When you look in the code for the new <ProjectLink name="FubuMVC" /> application, you'll see these things:
* An <code>IApplicationSource</code> class that specifies how your application is bootstrapped
* A <code>FubuRegistry</code> class
* A StructureMap Registry class
* A class named <code>HomeEndpoint</code> that represents the root url or home page of your new application
* <code>Global.asax.cs</code> to bootstrap FubuMVC for ASP.Net hosting

At this point, you should be able to simply press _F5_ and run the application with the home page coming up as text with instructions about how to get started with the code in your new application.
</Section>

<Section title="FubuMVC Application with the Spark View Engine" id="spark">
<pre>
fubu new MyApp --options spark
</pre>
</Section>

<Section title="FubuMVC Application with the Razor View Engine" id="spark">
<pre>
fubu new MyApp --options razor
</pre>
</Section>

<Section title="FubuMVC Bottles" id="fubumvc-bottle">
You can generate a new solution for an <ProjectLink name="FubuMVC" /> Bottle with this usage:

<pre>
fubu new MyFeatureBottle web-bottle
</pre>

This generation will add an


</Section>

<Section title="Simple Class Libraries" id="library">

</Section>

<Section title="FubuTransportation Service" id="service">

</Section>

<markdown>
TODO(Write some content!)
</markdown>

<Command app="fubu" command="new">

</Command>

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!--Title: Adding Projects to Existing Solutions-->
<!--Url: adding-projects-to-existing-solutions-->

<markdown>
TODO(Write some content!)
</markdown>


<Command app="fubu" command="add">

</Command>
11 changes: 11 additions & 0 deletions src/fubu.Docs/2.templating/3.enhancing-existing-projects.spark
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!--Title: Enhancing Existing Projects-->
<!--Url: enhancing-existing-projects-->

<markdown>
TODO(Write some content!)
</markdown>

<Command app="fubu" command="enhance">

</Command>

37 changes: 37 additions & 0 deletions src/fubu.Docs/2.templating/index.spark
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!--Title: Project and Solution Templating-->
<!--Url: templating-->

<Info>The project templating is very new and will be growing in choices soon. See <a href="https://github.com/DarthFubuMVC/fubu/issues?state=open">the Fubu issue list</a> to see what's on the horizon.</Info>

<markdown>



Using the <ProjectLink name="FubuCsProjFile" /> library, the fubu tool provides the ability to quickly create all new code repositories and C# projects for common fubu community tools.
*If* you're willing to just use our common codebase idioms and tooling choices for build automation, you can rapidly stand up all new code solutions with working
build scripts, development servers, and test harnesses from a single command line command.

The templating and generation will:

1. Set up build scripts based on <ProjectLink name="FubuRake" /> and using <ProjectLink name="Ripple" /> for nuget dependency management
1. Add appropriate file patterns to your <code>.gitignore</code> file. Using Git is *not* mandatory.
1. Build new Visual Studio.Net solution files
1. Generate Visual Studio.Net project files and attach them to solution files
1. Add code files
1. Add Nuget references
1. Add gem references for tools used from the build script
1. Add miscellaneous files and folders

<Info>We chose to build and use our own templating engine to gain the ability to make the templating both composable and reentrant. Most of the existing alternatives seem to be "record and replay" tools that didn't give us this flexibility. We do support Visual Studio.Net project templates as well though.</Info>

<TableOfContents />

</markdown>








2 changes: 1 addition & 1 deletion src/fubu.Docs/fubu.cli.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
</CommandReport>
<CommandReport>
<Name>add</Name>
<Description>AddCommand</Description>
<Description>Adds new projects to an existing solution</Description>
<Arguments>
<ArgumentReport>
<Name>projectname</Name>
Expand Down
3 changes: 3 additions & 0 deletions src/fubu.Docs/index.spark
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<!--Title: fubu-->
<ProjectSummary />

<Gem name="fubu" />

<TableOfContents />
Binary file modified src/fubu.Docs/pak-WebContent.zip
Binary file not shown.

0 comments on commit dc288f7

Please sign in to comment.