lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhern...@apache.org
Subject [2/2] git commit: getting build scripts to work on mono on ubuntu
Date Sat, 19 Jul 2014 03:38:58 GMT
getting build scripts to work on mono on ubuntu


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

Branch: refs/heads/pcl
Commit: 4e39850605319942618e0b6fb2345f1c8182e875
Parents: 7f3ff91
Author: Michael Herndon <mherndon@michaelherndon.com>
Authored: Fri Jul 18 23:28:45 2014 -0400
Committer: Michael Herndon <mherndon@michaelherndon.com>
Committed: Fri Jul 18 23:28:45 2014 -0400

----------------------------------------------------------------------
 build.fsx | 86 ++++++++++++++++++++++++++++++++++++++++++----------------
 build.sh  |  7 +++--
 2 files changed, 66 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4e398506/build.fsx
----------------------------------------------------------------------
diff --git a/build.fsx b/build.fsx
index 3603a47..fb707fe 100644
--- a/build.fsx
+++ b/build.fsx
@@ -4,36 +4,61 @@ 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 exe = 
+    if isMono then "/bin/bash"
+        else "cmd"
 
 
-    
-
 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
-    //()
+Target "Restore" (fun _ ->
+    
+    let exe = 
+        if isMono then "/bin/bash"
+        else "cmd"
+    
+    let command = 
+        if isMono then "-c 'kpm restore -s https://www.myget.org/F/aspnetvnext'"
+        else "/c kpm restore -s https://www.myget.org/F/aspnetvnext"
+
     let out = (ExecProcessAndReturnMessages(fun info ->
-                info.FileName <- "cmd"
-                info.Arguments <- "/c k build ./src/Lucene.Net.Core/"
+                info.FileName <- exe
+                info.Arguments <- command
             ) (TimeSpan.FromMinutes 5.0))
     let code = sprintf "%i" out.ExitCode
     trace code
 )
 
-Target "Build:TestFramework" (fun _ ->
+Target "Build:Core" (fun _ ->
+
+    let command = 
+        if isMono then "-c 'cd ./src/Lucene.Net.Core/ && k build'"
+        else "/c k build ./src/Lucene.Net.Core/"
 
+    // Shell.Exec(exe, )
     let out =  (ExecProcessAndReturnMessages(fun info ->
-                info.FileName <- "cmd"
-                info.Arguments <- "/c k build ./test/Lucene.Net.TestFramework/"
+                info.FileName <- exe
+                info.Arguments <- command.ToString()
             ) (TimeSpan.FromMinutes 5.0))
 
+    trace "done"
+)
+
+Target "Build:TestFramework" (fun _ ->
+
+    
+    let command = 
+        if isMono then "-c 'cd ./test/Lucene.Net.TestFramework/ && k build'"
+        else "/c k build ./test/Lucene.Net.TestFramework/"
+
+    // Shell.Exec(exe, )
+    let out =  (ExecProcessAndReturnMessages(fun info ->
+                info.FileName <- exe
+                info.Arguments <- command.ToString()
+            ) (TimeSpan.FromMinutes 5.0))
    
     let code = sprintf "%i" out.ExitCode
     trace code
@@ -41,25 +66,37 @@ Target "Build:TestFramework" (fun _ ->
 
 Target "Build:Core:Tests" (fun _ ->
 
-    let out = (ExecProcessAndReturnMessages(fun info ->
-                info.FileName <- "cmd"
-                info.Arguments <- "/c k build ./test/Lucene.Net.Core.Tests/"
+        
+    let command = 
+        if isMono then "-c 'cd ./test/Lucene.Net.Core.Tests/ && k build'"
+        else "/c k build ./test/Lucene.Net.Core.Tests/"
+
+    // Shell.Exec(exe, )
+    let out =  (ExecProcessAndReturnMessages(fun info ->
+                info.FileName <- exe
+                info.Arguments <- command.ToString()
             ) (TimeSpan.FromMinutes 5.0))
+
     let code = sprintf "%i" out.ExitCode
     trace code
 )
 
 Target "Test:Core" (fun _ ->
-    let out = (ExecProcessAndReturnMessages(fun info ->
-                info.FileName <- "cmd"
-                info.Arguments <- "/c k test"
-                info.WorkingDirectory <- "./test/Lucene.Net.Core.Tests/"
+
+    let command = 
+        if isMono then "-c 'cd ./test/Lucene.Net.Core.Tests/ && k test'"
+        else "/c cd ./test/Lucene.Net.Core.Tests/ & k test "
+
+    let out =  (ExecProcessAndReturnMessages(fun info ->
+                info.FileName <- exe
+                info.Arguments <- command.ToString()
             ) (TimeSpan.FromMinutes 5.0))
-   
+
     let code = sprintf "%i" out.ExitCode
-    trace code
-    //trace result.stdout
-    //trace result.stderr
+    let message = 
+        if out.ExitCode = 0 then "pass"
+        else "fail"
+    trace message
 )
 
 Target "Default" (fun _ ->
@@ -67,6 +104,7 @@ Target "Default" (fun _ ->
 )
 
 "Clean"
+    ==> "Restore"
     ==> "Build:Core"
     ==> "Build:TestFramework"
     ==> "Build:Core:Tests"

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4e398506/build.sh
----------------------------------------------------------------------
diff --git a/build.sh b/build.sh
index bb098fe..032f743 100644
--- a/build.sh
+++ b/build.sh
@@ -1,6 +1,7 @@
 #!/bin/bash
 
-if [ ! -f packages/FAKE/tools/FAKE.exe]; then
-	mono --runtime=v4.5 .nuget\nuget.exe install FAKE -OutputDirectory packages -ExcludeVersion
+if [ ! -f packages/FAKE/tools/FAKE.exe ]
+	then
+		mono --runtime=v4.0 .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
+mono --runtime=v4.0 packages/FAKE/tools/FAKE.exe build.fsx $@


Mime
View raw message