anchor.diff:  %%--------------------------------------------------------------------
   %% @doc
   %%  Run the build task. {@link sin_erl_builder}
  -%% @spec build(StartDir::startdir()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -build(StartDir) ->
  -    build(StartDir, []).
  +%% @spec build(BuildRef::buildRef(), StartDir::startdir()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +build(BuildRef, StartDir) ->
  +    build(BuildRef, StartDir, []).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  Run the build with the specified args. {@link sin_erl_builder}
  -%% @spec build(StartDir::startdir(), Args::args()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -build(StartDir, Args) ->
  -    do_task(build, StartDir, Args).
  +%% @spec build(BuildRef::buildRef(), StartDir::startdir(), Args::args()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +build(BuildRef, StartDir, Args) ->
  +    do_task(build, BuildRef, StartDir, Args).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  Run the analyze task. {@link sin_analyze}
  -%% @spec analyze(StartDir::startdir()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -analyze(StartDir) ->
  -    analyze(StartDir, []).
  +%% @spec analyze(BuildRef::buildRef(), StartDir::startdir()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +analyze(BuildRef, StartDir) ->
  +    analyze(BuildRef, StartDir, []).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  Run the analyze task. {@link sin_analyze}
  -%% @spec analyze(StartDir::startdir(), Args::args()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -analyze(StartDir, Args) ->
  -    do_task(analyze, StartDir, Args).
  +%% @spec analyze(BuildRef::buildRef(), StartDir::startdir(), Args::args()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +analyze(BuildRef, StartDir, Args) ->
  +    do_task(analyze, BuildRef, StartDir, Args).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the doc task. {@link sin_edoc}
  -%% @spec doc(StartDir::startdir()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -doc(StartDir) ->
  -    doc(StartDir, []).
  +%% @spec doc(BuildRef::buildRef(), StartDir::startdir()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +doc(BuildRef, StartDir) ->
  +    doc(BuildRef, StartDir, []).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the doc task. {@link sin_edoc}
  -%% @spec doc(StartDir::startdir(), Args::args()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -doc(StartDir, Args) ->
  -    do_task(doc, StartDir, Args).
  +%% @spec doc(BuildRef::buildRef(), StartDir::startdir(), Args::args()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +doc(BuildRef, StartDir, Args) ->
  +    do_task(doc, BuildRef, StartDir, Args).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the shell task. {@link sin_shell}
  -%% @spec shell(StartDir::startdir()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -shell(StartDir) ->
  -    shell(StartDir, []).
  +%% @spec shell(BuildRef::buildRef(), StartDir::startdir()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +shell(BuildRef, StartDir) ->
  +    shell(BuildRef, StartDir, []).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the shell task. {@link sin_shell}
  -%% @spec shell(StartDir::startdir(), Args::args()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -shell(StartDir, Args) ->
  -   do_task(shell, StartDir, Args).
  +%% @spec shell(BuildRef::buildRef(), StartDir::startdir(), Args::args()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +shell(BuildRef, StartDir, Args) ->
  +   do_task(shell, BuildRef,  StartDir, Args).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  Run the gen task. {@link sin_gen}
  -%% @spec gen(StartDir::startdir()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -gen(StartDir) ->
  -    gen(StartDir, []).
  +%% @spec gen(BuildRef::buildRef(), StartDir::startdir()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +gen(BuildRef, StartDir) ->
  +    gen(BuildRef StartDir, []).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  Run the gen task. {@link sin_gen}
  -%% @spec gen(StartDir::startdir(), Args::args()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -gen(StartDir, Args) ->
  -    do_task(singen, gen, StartDir, Args).
  +%% @spec gen(BuildRef::buildRef(), StartDir::startdir(), Args::args()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +gen(BuildRef, StartDir, Args) ->
  +    do_task(singen, gen, BuildRef, StartDir, Args).
   
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the clean task. {@link sin_clean}
  -%% @spec clean(StartDir::startdir()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -clean(StartDir) ->
  -    clean(StartDir, []).
  +%% @spec clean(BuildRef::buildRef(), StartDir::startdir()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +clean(BuildRef, StartDir) ->
  +    clean(BuildRef, StartDir, []).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the clean task. {@link sin_clean}
  -%% @spec clean(StartDir::startdir(), Args::args()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -clean(StartDir, Args) ->
  -    do_task(clean, StartDir, Args).
  +%% @spec clean(BuildRef::buildRef(), StartDir::startdir(), Args::args()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +clean(BuildRef, StartDir, Args) ->
  +    do_task(clean, BuildRef, StartDir, Args).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the help task. {@link sin_help}
  -%% @spec help(StartDir::startdir()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -help(StartDir) ->
  -    help(StartDir, []).
  +%% @spec help(BuildRef::buildRef(), StartDir::startdir()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +help(BuildRef, StartDir) ->
  +    help(BuildRef, StartDir, []).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the help task. {@link sin_help}
  -%% @spec help(StartDir::startdir(), Args::args()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -help(StartDir, Args) ->
  -    do_task(sinhelp, help, StartDir, Args).
  +%% @spec help(BuildRef::buildRef(), StartDir::startdir(), Args::args()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +help(BuildRef, StartDir, Args) ->
  +    do_task(sinhelp, help, BuildRef, StartDir, Args).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the depends task. {@link sin_depends}
  -%% @spec depends(StartDir::startdir()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -depends(StartDir) ->
  -    depends(StartDir, []).
  +%% @spec depends(BuildRef::buildRef(), StartDir::startdir()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +depends(BuildRef, StartDir) ->
  +    depends(BuildRef, StartDir, []).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the depends task. {@link sin_depends}
  -%% @spec depends(StartDir::startdir(), Args::args()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -depends(StartDir, Args) ->
  -    do_task(depends, StartDir, Args).
  +%% @spec depends(BuildRef::buildRef(), StartDir::startdir(), Args::args()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +depends(BuildRef, StartDir, Args) ->
  +    do_task(depends, BuildRef, StartDir, Args).
   
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the test task. {@link sin_test}
  -%% @spec test(StartDir::startdir()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -test(StartDir) ->
  -    test(StartDir, []).
  +%% @spec test(BuildRef::buildRef(), StartDir::startdir()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +test(BuildRef, StartDir) ->
  +    test(BuildRef, StartDir, []).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the test task. {@link sin_test}
  -%% @spec test(StartDir::startdir(), Args::args()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -test(StartDir, Args) ->
  -    do_task(test, StartDir, Args).
  +%% @spec test(BuildRef::buildRef(), StartDir::startdir(), Args::args()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +test(BuildRef, StartDir, Args) ->
  +    do_task(test, BuildRef, StartDir, Args).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the release task. {@link sin_release_builder}
  -%% @spec release(StartDir::startdir()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -release(StartDir) ->
  -    release(StartDir, []).
  +%% @spec release(BuildRef::buildRef(), StartDir::startdir()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +release(BuildRef, StartDir) ->
  +    release(BuildRef, StartDir, []).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the release task. {@link sin_release_builder}
  -%% @spec release(StartDir::startdir(), Args::args()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -release(StartDir, Args) ->
  -    do_task(release, StartDir, Args).
  +%% @spec release(BuildRef::buildRef(), StartDir::startdir(), Args::args()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +release(BuildRef, StartDir, Args) ->
  +    do_task(release, BuildRef, StartDir, Args).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the dist task. {@link sin_dist_builder}
  -%% @spec dist(StartDir::startdir()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -dist(StartDir) ->
  -    dist(StartDir, []).
  +%% @spec dist(BuildRef::buildRef(), StartDir::startdir()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +dist(BuildRef, StartDir) ->
  +    dist(BuildRef, StartDir, []).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the dist task. {@link sin_dist_builder}
  -%% @spec dist(StartDir::startdir(), Args::args()) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -dist(StartDir, Args) ->
  -    do_task(dist, StartDir, Args).
  +%% @spec dist(BuildRef::buildRef(), StartDir::startdir(), Args::args()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +dist(BuildRef, StartDir, Args) ->
  +    do_task(dist, BuildRef, StartDir, Args).
   
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the specified task, with the default chain
  -%% @spec do_task(Task, Args) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -do_task(Task, StartDir, Args) when is_atom(Task) ->
  -    do_task(sinan, StartDir, Task, Args).
  +%% @spec do_task(Task, BuildRef::buildRef(),
  +%%   StartDir::startdir(), Args::args()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +do_task(Task, BuildRef, StartDir, Args) when is_atom(Task) ->
  +    do_task(sinan, BuildRef, StartDir, Task, Args).
   
   %%--------------------------------------------------------------------
   %% @doc
   %%  run the specified task
  -%% @spec do_task(Chain, Task, Args) -> ok
  -%% @end
  -%%--------------------------------------------------------------------
  -do_task(Chain, StartDir, Task, Args) when is_atom(Task) ->
  -    BuildRef = eta_engine:make_run_id(),
  +%% @spec do_task(Chain, Task, BuildRef::buildRef(),
  +%%   Startdir::startdir(), Args::args()) -> ok
  +%% @end
  +%%--------------------------------------------------------------------
  +do_task(Chain, Task, BuildRef, StartDir, Args) when is_atom(Task) ->
       fconf:start_config(BuildRef,
                          fun sin_parse_handle:parse_config_file/1),
       fconf:store(BuildRef, "build.args", Args),
       fconf:store(BuildRef, "build.start_dir", StartDir),
       eta_engine:run(Chain, Task, BuildRef),
       fconf:stop_config(BuildRef).
  +
  +%%--------------------------------------------------------------------
  +%% @doc
  +%% Generate a new unique build ref for a run. This allows the
  +%% use to setup task handlers for the system.
  +%%
  +%% @spec get_build_ref() -> GeneratedBuildRef::string()
  +%% @end
  +%%--------------------------------------------------------------------
  +gen_build_ref() ->
  +    eta_engine:make_run_id().
   
   %%--------------------------------------------------------------------
   %% @doc
  
positive.code: %%%  Two possible arguments may be passed in. The start dir that should
  %%%  be somewhere inside a project and a list of args for the system.
  %%%
  %%%  @type startdir() = string(). A dir that is somewhere in a project
  %%%  @type args() = {[{TaskName, args}]}
  %%%    TaskName = string(). The name of the task the args apply too.
  
negative.code: -module(sinan).
  
  %% API
  -export([gen_build_ref/0,
           build/2, build/3,
           analyze/3, analyze/2,
           doc/3, doc/2,
           shell/2, shell/3,
           gen/3, gen/2,
           clean/2, clean/3,
           help/2, help/3,
           depends/2, depends/3,
           test/2, test/3,
           release/2, release/3,
           dist/2, dist/3,
           do_task/4,
           do_task/5,
           start/0]).
  
  %%====================================================================
  