anchor.diff:      testAssemblies |> Gallio.Run (fun p -> { p with Filters = "exclude Category: Integration" })
   )
   
  +let libs = ["SolrNet"; "SolrNet.DSL"; "HttpWebAdapters"; "Castle.Facilities.SolrNetIntegration"; "Ninject.Integration.SolrNet"; "NHibernate.SolrNet"; "Structuremap.SolrNetIntegration"]
  +let dlls = libs |> List.map (fun l -> l + ".dll")
  +let dirs = libs |> List.map (fun l -> l @@ "bin" @@ config)
  +
   Target "Merge" (fun _ ->
  -    DeleteDir "merged"
  -    CreateDir "merged"
  -    let libs = ["SolrNet"; "SolrNet.DSL"; "HttpWebAdapters"; "Castle.Facilities.SolrNetIntegration"; "Ninject.Integration.SolrNet"; "NHibernate.SolrNet"; "Structuremap.SolrNetIntegration"]
  -    let dlls = libs |> List.map (fun l -> l + ".dll")
  -    let dirs = libs |> List.map (fun l -> l @@ "bin" @@ config)
  +    DeleteDir buildDir
  +    CreateDir buildDir
       let main = "SolrNet\\bin" @@ config @@ "SolrNet.dll"
  -    let output = "merged" @@ dlls.[0]
  +    let output = buildDir @@ dlls.[0]
       ILMerge (fun p -> { p with 
                               ToolPath = "lib\\ilmerge.exe"
  -                            Libraries = dlls |> Seq.skip 1 |> Seq.toList
  +                            Libraries = dlls |> Seq.skip 1
                               SearchDirectories = dirs
                               Internalize = InternalizeExcept "ilmerge.exclude"
                               XmlDocs = true
                          }) output main
   )
   
  +Target "Version" (fun _ ->
  +    libs 
  +    |> Seq.iter (fun l ->
  +        AssemblyInfo (fun p -> { p with
  +                                    OutputFileName = l @@ "Properties\\AssemblyInfo.cs"
  +                                    CLSCompliant = true
  +                                    AssemblyTitle = l
  +                                    AssemblyDescription = l
  +                                    AssemblyProduct = l
  +                                    AssemblyCopyright = sprintf "Copyright Mauricio Scheffer 2007-%d" DateTime.Now.Year
  +                                    Guid = "6688f9b4-5f2d-4fd6-aafc-3a81c84a69f1"
  +                                    AssemblyVersion = version
  +                                    AssemblyFileVersion = version }))
  +)
  +
  +Target "PackageSampleApp" (fun _ ->
  +    let solr = "solr-1.4.0"
  +    let outputSolr = buildDir @@ solr
  +    CopyDir outputSolr solr allFiles
  +    DeleteDir (outputSolr @@ "solr\\data")
  +    let logs = outputSolr @@ "solr\\logs"
  +    DeleteDir logs
  +    CreateDir logs
  +
  +    let sampleApp = "SampleSolrApp"
  +    let outputSampleApp = buildDir @@ sampleApp
  +    CopyDir outputSampleApp sampleApp allFiles
  +    DeleteDir (outputSampleApp @@ "obj")
  +    DeleteFile (outputSampleApp @@ "log.txt")
  +    DeleteFile (outputSampleApp @@ "SampleSolrApp.sln.cache")
  +    // TODO fix csproj reference
  +    // zip
  +)
  +
   "Test" <== ["BuildAll"]
   "BuildAll" <== ["Build";"Merge";"BuildSample"]
   
  -
  -// start build
   Run target
positive.code: #r "Fake.Gallio.dll"
  
  open System
  open System.Linq
  open Fake
  
  let (=.) a b = StringComparer.InvariantCultureIgnoreCase.Compare(a,b) = 0
  let flip f x y = f y x
  let def = flip defaultArg
  
negative.code: Target "Clean" (fun _ -> 
      mainSln "Clean"
      sampleSln "Clean"
      DeleteDir buildDir
  )
  
  Target "Build" (fun _ -> mainSln "Rebuild")
  