Skip to content

Commit

Permalink
using fake.exe
Browse files Browse the repository at this point in the history
  • Loading branch information
mausch committed Nov 6, 2010
1 parent de729fe commit e5b21d0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Build.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msbuild solrnet.proj /m /t:SetRelease;Clean;Version;Build;Merge
lib\fake.exe build.fsx %*
4 changes: 1 addition & 3 deletions Test.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
msbuild solrnet.proj /m /t:test

pause
lib\fake target=Test
28 changes: 8 additions & 20 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,14 @@ open Fake

let version = "0.3.0"
let buildDir = "merged"
let (=.) a b = StringComparer.InvariantCultureIgnoreCase.Compare(a,b) = 0
let (.>) (a: #seq<XElement>) (b: string) = Extensions.Descendants(a, xname b)
let startsWith s (n: XElement) = n.Value.StartsWith s
let contains s (n: XElement) = n.Value.Contains s
let setValue s (n: XElement) = n.Value <- s
let replaceValue orig repl (n: XElement) = n.Value <- n.Value.Replace((orig:string), (repl:string))
let flip f x y = f y x
let def = flip defaultArg
let anyOf l e = l |> Seq.exists (fun i -> i =. e)

let config =
fsi.CommandLineArgs
|> Seq.tryFind (anyOf ["/debug"; "/release"])
|> def "/debug"
|> fun e -> e.Substring(1)

let target =
fsi.CommandLineArgs
|> Seq.skip 1
|> Seq.tryFind (fun c -> not(c.StartsWith "/"))
|> def "BuildAll"

let config = getBuildParamOrDefault "config" "debug"
let target = getBuildParamOrDefault "target" "BuildAll"

let slnBuild sln x =
sln |> build (fun p -> { p with
Expand Down Expand Up @@ -115,12 +102,11 @@ Target "PackageSampleApp" (fun _ ->
DeleteFile (outputSampleApp @@ "log.txt")
DeleteFile (outputSampleApp @@ "SampleSolrApp.sln.cache")
CreateDir (outputSampleApp @@ "lib")

!+ (outputSampleApp @@ "bin\\*") -- "**\\SampleSolrApp.*" -- "**\\SolrNet.*"
-- (outputSampleApp @@ "bin")
|> Scan
//|> Seq.iter (logf "scanned %s\n")
|> Copy (outputSampleApp @@ "lib")

["pingsolr.js"; "license.txt"; "runsample.bat"] |> Copy buildDir

let csproj = outputSampleApp @@ "SampleSolrApp.csproj"
Expand All @@ -134,7 +120,9 @@ Target "PackageSampleApp" (fun _ ->
|> Seq.iter (setValue @"..\SolrNet.dll")
xml.Save csproj

!+ (buildDir @@ "**\\*") |> Scan |> Zip buildDir (sprintf "SolrNet-%s-sample.zip" version)
!+ (buildDir @@ "**\\*")
|> Scan
|> Zip buildDir (sprintf "SolrNet-%s-sample.zip" version)

)

Expand Down
Binary file modified lib/FakeLib.dll
Binary file not shown.

0 comments on commit e5b21d0

Please sign in to comment.