diff --git a/CrashRpt2.autopkg b/CrashRpt2.autopkg new file mode 100644 index 0000000..261a6b8 --- /dev/null +++ b/CrashRpt2.autopkg @@ -0,0 +1,56 @@ +configurations { + Toolset { + key : "PlatformToolset"; + choices: { v120, v140, v141 }; + }; + + Platform { + key : "Platform"; + choices: { Win32, x64 }; + }; +} + +nuget { + nuspec { + id = CrashRpt2.CPP; + version : appveyor_build_version; // replaced by appveyor deploy script + title: CrashRpt2.CPP; + authors: {Oleg Krivtsov, QbProg}; + requireLicenseAcceptance:false; + summary: @"CrashRpt is a free open-source library designed for intercepting exceptions in your C++ program"; + description: @"This package corresponds to the github repo with fixes and new features collected from various places. It is not bound to any third-party online service and can be freely configured, including the email address to receive crash reports."; + projectUrl: "https://github.com/QbProg/crashrpt2"; + licenseUrl: "https://github.com/QbProg/crashrpt2/blob/master/License.txt"; + iconUrl: "http://crashrpt.sourceforge.net/images/logo.png"; + releaseNotes: @"Nuget package may be incomplete, e.g. does not contain language files yet"; + copyright: Copyright 2019; + tags: { CrashRpt2, CrashRpt }; + }; + + files { + + #defines { + CRASHRPT_VER = 1500; + }; + + include: { + include/CrashRpt.h + }; + + ("Win32,x64", "v120,v140,v141") => { + [${0},${1}] { + lib: { ${0}\${1}\lib\CrashRpt${CRASHRPT_VER}.lib }; + symbols: {${0}\${1}\bin\CrashRpt${CRASHRPT_VER}.pdb}; + bin: { ${0}\${1}\bin\CrashRpt${CRASHRPT_VER}.dll, + ${0}\${1}\bin\CrashSender${CRASHRPT_VER}.exe, + ${0}\${1}\bin\crashrpt_lang.ini + }; + } + } + }; + + targets { + Defines += "_LATER"; + } + +} \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index ca1263f..5513daa 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: '{build}' +version: '1.5.{build}' branches: only: @@ -7,46 +7,72 @@ branches: clone_folder: c:\projects\crashrpt2 image: -- Visual Studio 2017 -- Visual Studio 2015 - Visual Studio 2013 +- Visual Studio 2015 +- Visual Studio 2017 configuration: - RelWithDebInfo platform: - x64 - Win32 -environment: - matrix: - - arch: Win32 - - arch: Win64 matrix: - exclude: - - platform: x64 - arch: Win32 - - platform: Win32 - arch: Win64 fast_finish: false init: -- echo %APPVEYOR_BUILD_WORKER_IMAGE% -- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set vs=Visual Studio 15 2017) -- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" ( set vs=Visual Studio 14 2015) -- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2013" ( set vs=Visual Studio 12 2013) -- if "%arch%"=="Win64" ( set generator="%vs% Win64" ) -- if "%arch%"=="Win32" ( set generator="%vs%" ) -- echo %arch% -- echo %generator% - + - ps: | + $ms = @{ "2013"=("12","v120"); "2015"=("14","v140"); "2017"=("15","v141") } + $key = $env:APPVEYOR_BUILD_WORKER_IMAGE -replace "Visual Studio " + $env:generator = "Visual Studio $($ms[$key][0]) $key" + if ($env:PLATFORM -Match "64") { $env:generator += " Win64" } + $env:outputpath = "$env:PLATFORM/$($($ms[$key][1]))" + echo $key $env:generator $env:outputpath + $env:api = "https://ci.appveyor.com/api" + $env:apiproj = "$env:api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG" + # deploy only for last job of the build + if (((Irm $env:apiproj).build.jobs | Select-Object -Last 1).jobId -eq $env:APPVEYOR_JOB_ID) { $env:dodeploy = "true" } before_build: -- cmd: |- - mkdir build - cd build - cmake --version - cmake .. -G %generator% + - ps: cd (mkdir build\$env:outputpath) + - 'cmake --version' + - 'cmake ..\..\.. -G "%generator%"' build: - project: c:\projects\crashrpt2\build\CrashRpt.sln + project: $(APPVEYOR_BUILD_FOLDER)\build\$(outputpath)\CrashRpt.sln verbosity: minimal parallel: true +after_build: + - 'cd %APPVEYOR_BUILD_FOLDER%\build' + - '7z a package.zip %outputpath%\lib\CrashRpt*.lib %outputpath%\bin\CrashRpt*.pdb %outputpath%\bin\CrashRpt*.dll %outputpath%\bin\CrashSender*.exe %outputpath%\bin\crashrpt_lang.ini' test_script: - - c:\projects\crashrpt2\build\bin\Tests.exe /all + - '%APPVEYOR_BUILD_FOLDER%\build\%outputpath%\bin\Tests.exe /all' +artifacts: + - path: 'build/package.zip' +before_deploy: + - ps: | + cd $env:APPVEYOR_BUILD_FOLDER + # TODO: wait for other jobs to finish, needed only on parallel build: + # while ((Irm $env:apiproj).build.jobs | Where-Object {$_.jobId -ne $env:APPVEYOR_JOB_ID -and $_.status -ne "success"}) { Start-sleep 15 } + # download all artifacts and extract, including this job's one + foreach ($job in (Irm $env:apiproj).build.jobs) { + Start-FileDownload "$env:api/buildjobs/$($job.jobId)/artifacts/build/package.zip" + 7z x package.zip + } + # Download the CoApp tools. + $msiPath = "$($env:USERPROFILE)\CoApp.Tools.Powershell.msi" + (New-Object Net.WebClient).DownloadFile('http://coapp.org/files/CoApp.Tools.Powershell.msi', $msiPath) + # Install the CoApp tools from the downloaded .msi. + Start-Process -FilePath msiexec -ArgumentList /i, $msiPath, /quiet -Wait + # Make the tools available for later PS scripts to use. + $env:PSModulePath = $env:PSModulePath + ';C:\Program Files (x86)\Outercurve Foundation\Modules' + Import-Module CoApp + # Write version to autopkg + $autopkg = "CrashRpt2.autopkg" + (Gc $autopkg).replace('appveyor_build_version', $env:APPVEYOR_BUILD_VERSION) | Sc $autopkg + # Write Nuget and create artifact + Write-NuGetPackage $autopkg + Get-ChildItem .\*.nupkg | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } +deploy: + - provider: NuGet + on: + dodeploy: true + api_key: + secure: 1mWOwXfu1vQrBoct+pfNXDybBT9jwrTEzPqHlITiAoTljQPedQ/njJeB6hbShXB3