anchor.diff:  open Fake
   
   let version = "0.3.0"
  +let solr = "solr-1.4.0"
   let buildDir = "merged"
   let config = getBuildParamOrDefault "config" "debug"
   let target = getBuildParamOrDefault "target" "BuildAll"
  
positive.code: 
  Target "PackageSampleApp" (fun _ ->
      //System.Diagnostics.Debugger.Break()
      let solr = "solr-1.4.0"
      let outputSolr = buildDir @@ solr
      CopyDir outputSolr solr allFiles
      DeleteDir (outputSolr @@ "solr\\data")
  
negative.code: Target "BuildAll" DoNothing
  
  let testAssemblies = !+ "**/bin/**/*Tests.dll" |> Scan
  let noIntegrationTests = "exclude Category: Integration"
  let onlyIntegrationTests = "Category: Integration"
  
  Target "Test" (fun _ ->
      testAssemblies |> Gallio.Run (fun p -> { p with Filters = noIntegrationTests })
  )
  
  Target "Coverage" (fun _ ->
      testAssemblies |> Gallio.Run (fun p -> { p with 
                                                  Filters = noIntegrationTests
                                                  RunnerType = "NCover"
                                                  PluginDirectories = ["lib"] })
  )
  
  Target "IntegrationTest" (fun _ ->
      asyncShellExec {
          WorkingDirectory = solr
          Program = "java"
          CommandLine = "-DSTOP.PORT=8079 -DSTOP.KEY=secret -jar start.jar"
          Args = []
      } |> Async.StartAsTask |> ignore
      waitFor 
          (fun () -> httpGet "http://localhost:8983/solr/admin/ping" <> null)
          (TimeSpan.FromSeconds 10.)
          500 // half a sec
          (fun () -> failwith "Solr test instance didn't work")
          |> ignore
      try
          testAssemblies |> Gallio.Run (fun p -> { p with Filters = onlyIntegrationTests })
      finally
          shellExec {
              WorkingDirectory = solr
              Program = "java"
              CommandLine = "-DSTOP.PORT=8079 -DSTOP.KEY=secret -jar start.jar --stop"
              Args = []
          } |> ignore
  )
  
  let libs = ["SolrNet"; "SolrNet.DSL"; "HttpWebAdapters"; "Castle.Facilities.SolrNetIntegration"; "Ninject.Integration.SolrNet"; "NHibernate.SolrNet"; "Structuremap.SolrNetIntegration"]
  