代码拉取完成,页面将自动刷新
cov-configure --cs
cov-build.exe --dir cov-int build.bat compile
# Compress results.
"Compressing Coverity results..."
$zipEncoderDef = @'
namespace AnalyseCode {
public class PortableFileNameEncoder: System.Text.UTF8Encoding {
public PortableFileNameEncoder() {}
public override byte[] GetBytes(string entry) {
return base.GetBytes(entry.Replace("\\", "/"));
}
}
}
'@
Add-Type -TypeDefinition $zipEncoderDef
[IO.Compression.ZipFile]::CreateFromDirectory(
"$env:APPVEYOR_BUILD_FOLDER\cov-int",
"$env:APPVEYOR_BUILD_FOLDER\$env:APPVEYOR_PROJECT_NAME.zip",
[IO.Compression.CompressionLevel]::Optimal,
$true, # include root directory
(New-Object AnalyseCode.PortableFileNameEncoder))
# Upload results to Coverity server.
"Uploading Coverity results..."
Add-Type -AssemblyName "System.Net.Http"
$client = New-Object Net.Http.HttpClient
$client.Timeout = [TimeSpan]::FromMinutes(20)
$form = New-Object Net.Http.MultipartFormDataContent
# Fill token field.
[Net.Http.HttpContent]$formField =
New-Object Net.Http.StringContent($env:COVERITY_TOKEN)
$form.Add($formField, '"token"')
# Fill email field.
$formField = New-Object Net.Http.StringContent($env:COVERITY_EMAIL)
$form.Add($formField, '"email"')
# Fill file field.
$fs = New-Object IO.FileStream(
"$env:APPVEYOR_BUILD_FOLDER\$env:APPVEYOR_PROJECT_NAME.zip",
[IO.FileMode]::Open,
[IO.FileAccess]::Read)
$formField = New-Object Net.Http.StreamContent($fs)
$form.Add($formField, '"file"', "$env:APPVEYOR_PROJECT_NAME.zip")
# Fill version field.
$formField = New-Object Net.Http.StringContent($env:APPVEYOR_BUILD_VERSION)
$form.Add($formField, '"version"')
# Fill description field.
$formField = New-Object Net.Http.StringContent("AppVeyor scheduled build.")
$form.Add($formField, '"description"')
# Submit form.
$url = "https://scan.coverity.com/builds?project=$env:APPVEYOR_REPO_NAME"
$task = $client.PostAsync($url, $form)
try {
$task.Wait() # throws AggregateException on timeout
} catch [AggregateException] {
throw $_.Exception.InnerException
}
$task.Result
$fs.Close()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。