Skip to content

Commit

Permalink
Updates AppVeyor build definition
Browse files Browse the repository at this point in the history
Instead of having a mix of batch scripts calling PowerShell and
PowerShell scripts calling batch scripts, let's just choose one or the
other. These days, PowerShell is the preferred scripting and automation
language on Windows. And with PowerShell Core, you can use most scripts
on Linux, too.
  • Loading branch information
fourpastmidnight committed May 8, 2020
1 parent baebbc1 commit a17824c
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 16 deletions.
28 changes: 28 additions & 0 deletions Build-DataDictionary.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Param (
[Parameter(HelpText='Generating a data dictionary uses Ruby. This parameter allows you to use an installation of Ruby in a WSL instance.')]
[switch]$UseWSL,

[Parameter(HelpText='Allows you to specify the WSL distribution to use. If not provided, the default distro will be used.')]
[string]$Distro
)

function Build-DataDictionary {
Params (
[switch]$UseWSL,

[string]$Distro
)

Process {
if ($UseWSL -and $UseWSL.IsPresent)
{
if ($Distro) {
wsl -d "$Distro" ruby ./generator/generate.rb
} else {
wsl ruby ./generator/generate.rb
}
} else {
ruby ./generator/generate.rb
}
}
}
8 changes: 4 additions & 4 deletions QuickFIXn.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2036
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QuickFix", "QuickFIXn\QuickFix.csproj", "{FADB01D8-AD9E-4DB5-BC0B-65DF0C5748C5}"
EndProject
Expand All @@ -19,10 +19,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
acceptance_test.ps1 = acceptance_test.ps1
appveyor.yml = appveyor.yml
appveyor_test.bat = appveyor_test.bat
Build-DataDictionary.ps1 = Build-DataDictionary.ps1
build.bat = build.bat
build.ps1 = build.ps1
CONTRIBUTING.md = CONTRIBUTING.md
generate.bat = generate.bat
LICENSE = LICENSE
New-Release.ps1 = New-Release.ps1
package_release.bat = package_release.bat
Expand Down
13 changes: 6 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
version: 1.0.{build}

install:
- cmd: >-
- ps: |
gem install --source http://rubygems.org nokogiri -v 1.6.8.1
ruby generator\generate.rb
generate.bat
build_script:
- cmd: build.bat
- ps: dotnet build -c Release

test_script:
- cmd: >-
unit_test.bat
appveyor_test.bat
- ps: |
dotnet test -c Release --no-build --no-restore UnitTests -l trx
.\acceptance_test.ps1
1 change: 0 additions & 1 deletion appveyor_test.bat

This file was deleted.

9 changes: 6 additions & 3 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set CONFIGURATION=%1

if "%1" == "" set CONFIGURATION=Release

set BUILD_CMD=dotnet build -c %CONFIGURATION%
echo Build command: %BUILD_CMD%
%BUILD_CMD%
pwsh -v >nul
if "%ERRORLEVEL%" == "0" (
pwsh .\build.ps1 %CONFIGURATION%
) else (
powershell .\build.ps1 %CONFIGURATION%
)
9 changes: 9 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Param (
[Parameter(Position=0, ValueFromPipeline)]
[ValidateSet('debug','release')]
[string[]]$Configuration = 'release'
)

foreach ($c in $Configuration) {
dotnet build -c $Configuration
}
1 change: 0 additions & 1 deletion generate.bat

This file was deleted.

0 comments on commit a17824c

Please sign in to comment.