lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhern...@apache.org
Subject [1/2] git commit: adding F# FAKE build script. works on windows.
Date Fri, 18 Jul 2014 06:35:52 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/pcl 707345f46 -> dbcfacc57


adding F# FAKE build script. works on windows.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/bd8eb2e1
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/bd8eb2e1
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/bd8eb2e1

Branch: refs/heads/pcl
Commit: bd8eb2e1516b59deab5c22745106ab71b774657a
Parents: 707345f
Author: Michael Herndon <mherndon@michaelherndon.com>
Authored: Fri Jul 18 01:32:16 2014 -0400
Committer: Michael Herndon <mherndon@michaelherndon.com>
Committed: Fri Jul 18 01:32:16 2014 -0400

----------------------------------------------------------------------
 build.cmd |  8 +++++++
 build.fsx | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 build.sh  |  6 ++++++
 3 files changed, 82 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/bd8eb2e1/build.cmd
----------------------------------------------------------------------
diff --git a/build.cmd b/build.cmd
new file mode 100644
index 0000000..1d214ec
--- /dev/null
+++ b/build.cmd
@@ -0,0 +1,8 @@
+@echo off
+cls
+
+if not exist packages\FAKE\tools\Fake.exe (
+    .nuget\nuget.exe install FAKE -OutputDirectory packages -ExcludeVersion
+)
+packages\FAKE\tools\FAKE.exe build.fsx %*
+pause
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/bd8eb2e1/build.fsx
----------------------------------------------------------------------
diff --git a/build.fsx b/build.fsx
new file mode 100644
index 0000000..46995d0
--- /dev/null
+++ b/build.fsx
@@ -0,0 +1,68 @@
+#r @"packages/FAKE/tools/FakeLib.dll"
+
+open Fake
+
+let buildDir = "./build"
+
+// from SO http://stackoverflow.com/questions/3065409/starting-a-process-synchronously-and-streaming-the-output
+type ProcessResult = { exitCode : int; stdout : string; stderr : string }
+
+let executeProcess (exe, cmdline, wd) =
+    let psi = new System.Diagnostics.ProcessStartInfo(exe,cmdline) 
+    psi.UseShellExecute <- false
+    psi.RedirectStandardOutput <- true
+    psi.RedirectStandardError <- true
+    psi.CreateNoWindow <- true
+    if wd <> null then psi.WorkingDirectory <- wd    
+    let p = System.Diagnostics.Process.Start(psi) 
+    let output = new System.Text.StringBuilder()
+    let error = new System.Text.StringBuilder()
+    p.OutputDataReceived.Add(fun args -> output.Append(args.Data) |> ignore)
+    p.ErrorDataReceived.Add(fun args -> error.Append(args.Data) |> ignore)
+    p.BeginErrorReadLine()
+    p.BeginOutputReadLine()
+    p.WaitForExit()
+    { exitCode = p.ExitCode; stdout = output.ToString(); stderr = error.ToString() }
+
+Target "Clean" (fun _ -> 
+    trace "Clean"
+    CleanDir buildDir
+)
+
+Target "Build:Core" (fun _ ->
+    //let errorCode = Shell.Exec "cmd","/c k build ./src/Lucene.Net.Core"
+    //do something with the error code
+    //()
+    let result = executeProcess("cmd", "/c k build ./src/Lucene.Net.Core/", null)
+    trace result.stdout;
+)
+
+Target "Build:TestFramework" (fun _ ->
+    let result = executeProcess("cmd", "/c k build ./test/Lucene.Net.TestFramework/", null)
+    trace result.stdout;
+)
+
+Target "Build:Core:Tests" (fun _ ->
+    let result = executeProcess("cmd", "/c k build ./test/Lucene.Net.Core.Tests/", null)
+    trace result.stdout;
+)
+
+Target "Test:Core" (fun _ ->
+    let result = executeProcess("cmd", "/c k test", "./test/Lucene.Net.Core.Tests/")
+    trace ""
+    trace result.stdout
+    trace result.stderr
+)
+
+Target "Default" (fun _ ->
+    trace "Hello Word"
+)
+
+"Clean"
+    ==> "Build:Core"
+    ==> "Build:TestFramework"
+    ==> "Build:Core:Tests"
+    ==> "Test:Core"
+    ==> "Default"
+
+RunTargetOrDefault "Default"

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/bd8eb2e1/build.sh
----------------------------------------------------------------------
diff --git a/build.sh b/build.sh
new file mode 100644
index 0000000..bb098fe
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+if [ ! -f packages/FAKE/tools/FAKE.exe]; then
+	mono --runtime=v4.5 .nuget\nuget.exe install FAKE -OutputDirectory packages -ExcludeVersion
+fi
+mono --runtume=v4.5 packages/FAKE/tools/FAKE.exe build.fsx $@
\ No newline at end of file


Mime
View raw message