Skip to content

Commit

Permalink
Fix build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
DDoSolitary committed Jul 6, 2018
1 parent f744810 commit ef425b6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions LxRunOffline/LxRunOffline.vcxproj
Expand Up @@ -55,7 +55,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;$(DefineVersion);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
Expand All @@ -75,7 +75,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;$(DefineVersion);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
Expand Down
3 changes: 3 additions & 0 deletions LxRunOffline/main.cpp
Expand Up @@ -163,6 +163,9 @@ int wmain(int argc, wchar_t **argv) {
<< L" set-kernelcmd Set the default kernel command line of a distribution." << std::endl
<< L" get-flags Get some flags of a distribution. See https://msdn.microsoft.com/en-us/library/windows/desktop/mt826872(v=vs.85).aspx for details." << std::endl
<< L" set-flags Set some flags of a distribution. See https://msdn.microsoft.com/en-us/library/windows/desktop/mt826872(v=vs.85).aspx for details." << std::endl;
#ifdef LXRUNOFFLINE_VERSION
std::wcerr << L" version Get version information about this LxRunOffline.exe." << std::endl;
#endif
}
return 1;
} catch (const po::error &e) {
Expand Down
17 changes: 10 additions & 7 deletions appveyor.yml
Expand Up @@ -5,24 +5,27 @@ cache:
- C:\tools\vcpkg\installed
configuration: Release
before_build:
- ps: Update-AppveyorBuild -Version (git describe --tags)
- ps: $Env:VERSION=(git describe --tags)
- ps: Update-AppveyorBuild -Version $Env:VERSION
- ps: |
pushd C:\tools\vcpkg
git pull
git pull -q
.\bootstrap-vcpkg.bat
popd
vcpkg integrate install
vcpkg install libarchive boost-program-options boost-format
vcpkg upgrade --no-dry-run
popd
build_script:
- ps: msbuild /p:Configuration=$Env:CONFIGURATION /p:DefineVersion=LXRUNOFFLINE_VERSION=\`"$Env:VERSION\`"
after_build:
- ps: |
$project = $Env:APPVEYOR_PROJECT_NAME
$name = "$project-$(git describe --tags).zip"
$dir = "x64\$Env:CONFIGURATION"
7z a $name "$dir\$project.exe" "$dir\*.dll" "$project\LICENSE" "$project\LICENSE-3RD-PARTY"
$name = "$project-$Env:VERSION.zip"
$dir = ".\x64\$Env:CONFIGURATION"
7z a $name "$dir\$project.exe" "$dir\*.dll" 'LICENSE' 'LICENSE-3RD-PARTY'
if ($Env:APPVEYOR_REPO_TAG -eq 'true') {
$hash = (Get-FileHash $name -Algorithm SHA256).Hash
$version = (git describe --tags).Substring(1)
$version = $Env:VERSION.Substring(1)
cd choco
(cat "$project.nuspec") -replace '{VERSION}', $version | sc "$project.nuspec" -Encoding Ascii
(cat tools\chocolateyInstall.ps1) -replace '{VERSION}', $version | sc tools\chocolateyInstall.ps1 -Encoding Ascii
Expand Down

0 comments on commit ef425b6

Please sign in to comment.