1 Star 0 Fork 0

苏小逝/xmake

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
.appveyor.yml 5.94 KB
一键复制 编辑 原始数据 按行查看 历史
ruki 提交于 2020-01-19 11:35 . revert root xmake.lua
#version: v2.1.8.{build}
image:
- Visual Studio 2013
- Visual Studio 2015
- Visual Studio 2017
platform:
- x86
- x64
install:
# prepare tools
- ps: Push-Location C:/
- ps: (New-Item ./winenv/bin -ItemType Directory).FullName
# nsis
- ps: Invoke-WebRequest "https://github.com/xmake-mirror/nsis/releases/download/v30b3/nsis-3.04.zip" -UseBasicParsing -OutFile ./nsis.zip
- ps: Invoke-WebRequest "https://github.com/xmake-mirror/nsis/releases/download/v30b3/nsis-3.04-strlen_8192.zip" -UseBasicParsing -OutFile ./nsis-longstr.zip
- ps: Invoke-WebRequest "https://github.com/xmake-mirror/nsis/releases/download/v30b3/UAC.zip" -UseBasicParsing -OutFile ./nsis-uac.zip
- ps: Expand-Archive ./nsis.zip -DestinationPath ./nsis
- ps: Move-Item ./nsis/*/* ./nsis
- ps: Expand-Archive ./nsis-longstr.zip -DestinationPath ./nsis -Force
- ps: Expand-Archive ./nsis-uac.zip -DestinationPath ./nsis -Force
- ps: Move-Item ./nsis/UAC.nsh ./nsis/Include/
# unzip
- ps: Invoke-WebRequest "https://github.com/xmake-mirror/gnuwin32-unzip/releases/download/5.51.1/unzip-5.51-1-bin.zip" -UseBasicParsing -OutFile .\unzip.zip
- ps: Expand-Archive ./unzip.zip -DestinationPath ./unzip
- ps: Copy-Item ./unzip/bin/unzip.exe ./winenv/bin
# curl
- ps: Invoke-WebRequest "https://github.com/xmake-io/xmake-win$(if ($env:platform -eq 'x64') { '64' } else { '32' })env/raw/master/bin/curl.exe" -UseBasicParsing -OutFile .\curl.exe
- ps: Invoke-WebRequest "https://raw.githubusercontent.com/xmake-io/xmake-win$(if ($env:platform -eq 'x64') { '64' } else { '32' })env/master/bin/curl-ca-bundle.crt" -UseBasicParsing -OutFile .\curl-ca-bundle.crt
- ps: Copy-Item ./curl.exe ./winenv/bin
- ps: Copy-Item ./curl-ca-bundle.crt ./winenv/bin
#
- ps: Pop-Location
# install xmake
- ps: git submodule -q update --init --recursive
- ps: ./scripts/get.ps1 -branch master
before_build:
- ps: (Get-Command xmake).FileVersionInfo.ProductVersion
build_script:
# self build
- ps: Push-Location ./core
- ps: xmake config --arch=$env:platform
- ps: xmake build
- ps: Pop-Location
# use new xmake
- ps: Set-AppveyorBuildVariable -Name XMAKE_PROGRAM_DIR -Value $(Resolve-Path ./xmake)
- ps: Copy-Item -Force .\core\build\xmake.exe $(Get-Command xmake).Path
- ps: (Get-Command xmake).FileVersionInfo.ProductVersion
# use bitcodes
- ps: xmake l -v private.utils.bcsave --rootname='@programdir' -x 'scripts/**|templates/**' xmake
- ps: (Get-Command xmake).FileVersionInfo.ProductVersion
after_build:
# publish exe
- ps: Push-AppveyorArtifact .\core\build\xmake.exe -FileName xmake.exe -DeploymentName "xmake-executable"
- ps: (Get-FileHash .\core\build\xmake.exe -Algorithm SHA256).Hash.ToLower() + " *xmake.exe`n" | Out-File ./shafile -Encoding ASCII -NoNewLine
# compose & publish installer
- ps: Copy-Item C:\winenv\ . -Recurse
- ps: $version = (Get-Command xmake).FileVersionInfo
- ps: C:\nsis\makensis.exe
/DMAJOR=$($version.ProductMajorPart)
/DMINOR=$($version.ProductMinorPart)
/DALTER=$($version.ProductBuildPart)
/DBUILD=$($($version.ProductVersion -split '\+')[1])
/D$($env:platform)
.\scripts\installer.nsi
- ps: Push-AppveyorArtifact .\scripts\xmake.exe -FileName xmake-installer.exe -DeploymentName "xmake-installer"
- ps: (Get-FileHash .\scripts\xmake.exe -Algorithm SHA256).Hash.ToLower() + " *xmake-installer.exe`n" | Out-File ./shafile -Encoding ASCII -NoNewLine -Append
# publish zip archive
- ps: Copy-Item .\*.md .\xmake
- ps: Copy-Item C:\winenv\ .\xmake -Recurse
- ps: Copy-Item .\core\build\xmake.exe .\xmake
- ps: |-
Add-Type -AssemblyName System.Text.Encoding
Add-Type -AssemblyName System.IO.Compression.FileSystem
class FixedEncoder : System.Text.UTF8Encoding {
FixedEncoder() : base($true) { }
[byte[]] GetBytes([string] $s)
{
$s = $s.Replace("\", "/")
return ([System.Text.UTF8Encoding]$this).GetBytes($s)
}
}
Copy-Item .\xmake .\archive\xmake -Recurse
[System.IO.Compression.ZipFile]::CreateFromDirectory("$PWD\archive", "$PWD\archive.zip", [System.IO.Compression.CompressionLevel]::Optimal, $false, [FixedEncoder]::new())
- ps: Push-AppveyorArtifact .\archive.zip -FileName xmake.zip -DeploymentName "xmake-archive"
- ps: (Get-FileHash .\archive.zip -Algorithm SHA256).Hash.ToLower() + " *xmake.zip`n" | Out-File ./shafile -Encoding ASCII -NoNewLine -Append
# publish sha file
- ps: Push-AppveyorArtifact ./shafile -FileName xmake.sha256 -DeploymentName "xmake-shafile"
test_script:
- ps: xmake --version
- ps: Push-Location ./tests
- ps: |-
$tests = Get-ChildItem test.lua -Recurse | ForEach-Object {
$testname = "$(Resolve-Path $_.Directory -Relative)"
$filename = "$(Resolve-Path $_ -Relative)"
$fullname = "$($_.FullName)"
Add-AppveyorTest -Name $testname -Framework "xmake-test" -FileName $filename -Outcome None
return @{ testname = $testname; filename = $filename; fullname = $fullname }
}
- ps: $all_success = $true
- ps: |-
$tests | ForEach-Object {
$testname = $_.testname
$filename = $_.filename
Update-AppveyorTest -Name $testname -Framework "xmake-test" -FileName $filename -Outcome Running
$time = Measure-Command {
xmake lua --verbose --diagnosis runner.lua $_.fullname >stdout_file 2>stderr_file
$outcome = if ($?) { "Passed" } else { $all_success = $false; "Failed" }
}
Get-Content stdout_file | Out-Host
Get-Content stderr_file | Out-Host
Update-AppveyorTest -Name $testname -Framework "xmake-test" -FileName $filename -Outcome $outcome -Duration $time.TotalMilliseconds -StdOut (Get-Content -Raw stdout_file) -StdErr (Get-Content -Raw stderr_file)
}
- ps: Pop-Location
- ps: if ($all_success) { Write-Host "All tests passed!" } else { Write-Error "Some tests failed!" }
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kimbeaur/xmake.git
git@gitee.com:kimbeaur/xmake.git
kimbeaur
xmake
xmake
master

搜索帮助