Add AppVeyor. (#188)
This commit is contained in:
parent
746f578c3c
commit
051f13f17d
|
|
@ -0,0 +1,18 @@
|
||||||
|
init:
|
||||||
|
- git config --global core.autocrlf true
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
- release
|
||||||
|
- dev
|
||||||
|
- /^(.*\/)?ci-.*$/
|
||||||
|
build_script:
|
||||||
|
- ps: .\run.ps1 default-build
|
||||||
|
clone_depth: 1
|
||||||
|
environment:
|
||||||
|
global:
|
||||||
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
||||||
|
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
||||||
|
test: off
|
||||||
|
deploy: off
|
||||||
|
os: Visual Studio 2017
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE"
|
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' default-build %*; exit $LASTEXITCODE"
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
@ECHO OFF
|
||||||
|
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' %*; exit $LASTEXITCODE"
|
||||||
|
|
@ -3,10 +3,13 @@
|
||||||
|
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Build this repository
|
Executes KoreBuild commands.
|
||||||
|
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
Downloads korebuild if required. Then builds the repository.
|
Downloads korebuild if required. Then executes the KoreBuild command. To see available commands, execute with `-Command help`.
|
||||||
|
|
||||||
|
.PARAMETER Command
|
||||||
|
The KoreBuild command to run.
|
||||||
|
|
||||||
.PARAMETER Path
|
.PARAMETER Path
|
||||||
The folder to build. Defaults to the folder containing this script.
|
The folder to build. Defaults to the folder containing this script.
|
||||||
|
|
@ -24,31 +27,32 @@ The base url where build tools can be downloaded. Overrides the value from the c
|
||||||
Updates KoreBuild to the latest version even if a lock file is present.
|
Updates KoreBuild to the latest version even if a lock file is present.
|
||||||
|
|
||||||
.PARAMETER ConfigFile
|
.PARAMETER ConfigFile
|
||||||
The path to the configuration file that stores values. Defaults to version.xml.
|
The path to the configuration file that stores values. Defaults to korebuild.json.
|
||||||
|
|
||||||
.PARAMETER MSBuildArgs
|
.PARAMETER Arguments
|
||||||
Arguments to be passed to MSBuild
|
Arguments to be passed to the command
|
||||||
|
|
||||||
.NOTES
|
.NOTES
|
||||||
This function will create a file $PSScriptRoot/korebuild-lock.txt. This lock file can be committed to source, but does not have to be.
|
This function will create a file $PSScriptRoot/korebuild-lock.txt. This lock file can be committed to source, but does not have to be.
|
||||||
When the lockfile is not present, KoreBuild will create one using latest available version from $Channel.
|
When the lockfile is not present, KoreBuild will create one using latest available version from $Channel.
|
||||||
|
|
||||||
The $ConfigFile is expected to be an XML file. It is optional, and the configuration values in it are optional as well.
|
The $ConfigFile is expected to be an JSON file. It is optional, and the configuration values in it are optional as well. Any options set
|
||||||
|
in the file are overridden by command line parameters.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Example config file:
|
Example config file:
|
||||||
```xml
|
```json
|
||||||
<!-- version.xml -->
|
{
|
||||||
<Project>
|
"$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json",
|
||||||
<PropertyGroup>
|
"channel": "dev",
|
||||||
<KoreBuildChannel>dev</KoreBuildChannel>
|
"toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools"
|
||||||
<KoreBuildToolsSource>https://aspnetcore.blob.core.windows.net/buildtools</KoreBuildToolsSource>
|
}
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
```
|
```
|
||||||
#>
|
#>
|
||||||
[CmdletBinding(PositionalBinding = $false)]
|
[CmdletBinding(PositionalBinding = $false)]
|
||||||
param(
|
param(
|
||||||
|
[Parameter(Mandatory=$true, Position = 0)]
|
||||||
|
[string]$Command,
|
||||||
[string]$Path = $PSScriptRoot,
|
[string]$Path = $PSScriptRoot,
|
||||||
[Alias('c')]
|
[Alias('c')]
|
||||||
[string]$Channel,
|
[string]$Channel,
|
||||||
|
|
@ -58,9 +62,9 @@ param(
|
||||||
[string]$ToolsSource,
|
[string]$ToolsSource,
|
||||||
[Alias('u')]
|
[Alias('u')]
|
||||||
[switch]$Update,
|
[switch]$Update,
|
||||||
[string]$ConfigFile = (Join-Path $PSScriptRoot 'version.xml'),
|
[string]$ConfigFile,
|
||||||
[Parameter(ValueFromRemainingArguments = $true)]
|
[Parameter(ValueFromRemainingArguments = $true)]
|
||||||
[string[]]$MSBuildArgs
|
[string[]]$Arguments
|
||||||
)
|
)
|
||||||
|
|
||||||
Set-StrictMode -Version 2
|
Set-StrictMode -Version 2
|
||||||
|
|
@ -147,10 +151,20 @@ function Get-RemoteFile([string]$RemotePath, [string]$LocalPath) {
|
||||||
|
|
||||||
# Load configuration or set defaults
|
# Load configuration or set defaults
|
||||||
|
|
||||||
|
$Path = Resolve-Path $Path
|
||||||
|
if (!$ConfigFile) { $ConfigFile = Join-Path $Path 'korebuild.json' }
|
||||||
|
|
||||||
if (Test-Path $ConfigFile) {
|
if (Test-Path $ConfigFile) {
|
||||||
[xml] $config = Get-Content $ConfigFile
|
try {
|
||||||
if (!($Channel)) { [string] $Channel = Select-Xml -Xml $config -XPath '/Project/PropertyGroup/KoreBuildChannel' }
|
$config = Get-Content -Raw -Encoding UTF8 -Path $ConfigFile | ConvertFrom-Json
|
||||||
if (!($ToolsSource)) { [string] $ToolsSource = Select-Xml -Xml $config -XPath '/Project/PropertyGroup/KoreBuildToolsSource' }
|
if ($config) {
|
||||||
|
if (!($Channel) -and (Get-Member -Name 'channel' -InputObject $config)) { [string] $Channel = $config.channel }
|
||||||
|
if (!($ToolsSource) -and (Get-Member -Name 'toolsSource' -InputObject $config)) { [string] $ToolsSource = $config.toolsSource}
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Write-Warning "$ConfigFile could not be read. Its settings will be ignored."
|
||||||
|
Write-Warning $Error[0]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$DotNetHome) {
|
if (!$DotNetHome) {
|
||||||
|
|
@ -169,9 +183,9 @@ $korebuildPath = Get-KoreBuild
|
||||||
Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1')
|
Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1')
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Install-Tools $ToolsSource $DotNetHome
|
Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile
|
||||||
Invoke-RepositoryBuild $Path @MSBuildArgs
|
Invoke-KoreBuildCommand $Command @Arguments
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
Remove-Module 'KoreBuild' -ErrorAction Ignore
|
Remove-Module 'KoreBuild' -ErrorAction Ignore
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue