build\build.ps1: Added tasks for InstallSDK and Restore to ensure dependencies 
are available during testing on TeamCity. Reversed order of tests so .NET Core 
runs first (since it is most likely to fail).


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

Branch: refs/heads/master
Commit: 41c6191fdf9bb21f1c241ae757bee57d4b92fab3
Parents: c2bf370
Author: Shad Storhaug <[email protected]>
Authored: Wed May 10 06:10:54 2017 +0700
Committer: Shad Storhaug <[email protected]>
Committed: Wed May 10 06:10:54 2017 +0700

----------------------------------------------------------------------
 build/build.ps1 | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/41c6191f/build/build.ps1
----------------------------------------------------------------------
diff --git a/build/build.ps1 b/build/build.ps1
index 0db9bc1..d0cd4e1 100644
--- a/build/build.ps1
+++ b/build/build.ps1
@@ -43,7 +43,7 @@ properties {
        [string]$product_name = "Lucene.Net"
        
        #test paramters
-       [string]$frameworks_to_test = "net451,netcoreapp1.0"
+       [string]$frameworks_to_test = "netcoreapp1.0,net451"
        [string]$where = ""
 }
 
@@ -56,7 +56,7 @@ task Clean -description "This task cleans up the build 
directory" {
        Get-ChildItem $base_directory -Include *.bak -Recurse | foreach ($_) 
{Remove-Item $_.FullName}
 }
 
-task Init -description "This task makes sure the build environment is 
correctly setup" {
+task InstallSDK -description "This task makes sure the correct SDK version is 
installed" {
        & where.exe dotnet.exe
        $sdkVersion = ""
 
@@ -77,7 +77,9 @@ task Init -description "This task makes sure the build 
environment is correctly
        if ($LASTEXITCODE -ne 0) {
                throw "Could not find dotnet CLI in PATH. Please install the 
.NET Core 1.1 SDK version 1.0.0-preview2-1-003177."
        }
+}
 
+task Init -depends InstallSDK -description "This task makes sure the build 
environment is correctly setup" {
        #Update TeamCity or MyGet with packageVersion
        Write-Output "##teamcity[buildNumber '$packageVersion']"
        Write-Output "##myget[buildNumber '$packageVersion']"
@@ -98,6 +100,12 @@ task Init -description "This task makes sure the build 
environment is correctly
        Ensure-Directory-Exists "$release_directory"
 }
 
+task Restore -description "This task restores the dependencies" {
+       Exec {
+               & dotnet.exe restore $base_directory
+       }
+}
+
 task Compile -depends Clean, Init -description "This task compiles the 
solution" {
        try {
                pushd $base_directory
@@ -109,9 +117,7 @@ task Compile -depends Clean, Init -description "This task 
compiles the solution"
                        Prepare-For-Build $projects
                }
 
-               Exec {
-                       & dotnet.exe restore $base_directory
-               }
+               Invoke-Task Restore
 
                Build-Assemblies $projects
 
@@ -139,7 +145,7 @@ task Pack -depends Compile -description "This task creates 
the NuGet packages" {
        }
 }
 
-task Test -description "This task runs the tests" {
+task Test -depends InstallSDK, Restore -description "This task runs the tests" 
{
        Write-Host "Running tests..." -ForegroundColor DarkCyan
 
        pushd $base_directory

Reply via email to