Skip to content

Commit

Permalink
project: Update AppVeyor CI to use gitlink.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Jul 11, 2016
1 parent 5c7f017 commit f0240ff
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 25 deletions.
59 changes: 49 additions & 10 deletions SMP/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,51 @@ branches:
only:
- master
skip_non_tags: true
configuration: Release+ReleaseDLL
shallow_clone: true

configuration: Release+ReleaseDLL

platform: x86+x64

environment:
matrix:
- MSVC_VER: 14
- MSVC_VER: 12

- MSVC_VER: 14

install:
# Install GitLink
- cmd: choco install gitlink

before_build:
# Create build project to compile all configurations and platforms at once
- ps: >-
$script = @'
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build" ToolsVersion="4.0">
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="GitLink" ToolsVersion="4.0">
<ItemGroup>
<ConfigurationList Condition="'@(ConfigurationList)' == '' and $(Configuration) != ''" Include="$(Configuration.Split('+'))" />
<ConfigurationList Condition="'@(ConfigurationList)' == ''" Include="Release" />
<PlatformList Condition="'@(PlatformList)' == ''" Include="x64;Win32" />
<PlatformList Condition="'@(PlatformList)' == '' and $(Platform) != ''" Include="$(Platform.Split('+'))" />
<PlatformList Condition="'@(PlatformList)' == ''" Include="x64;x86" />
</ItemGroup>
<Target Name="Build" Outputs="%(PlatformList.Identity)">
<Target Name="List" Outputs="%(PlatformList.Identity)">
<PropertyGroup>
<CurrentPlatform>%(PlatformList.Identity)</CurrentPlatform>
</PropertyGroup>
<ItemGroup>
<ProjectToBuild Include="SMP/APPVEYOR_PROJECT_NAME.sln">
<Properties>Configuration=%(ConfigurationList.Identity);Platform=$(CurrentPlatform);OutDir=$(MSBuildThisFileDirectory)build_out\</Properties>
</ProjectToBuild>
</ItemGroup>
</Target>
<Target Name="Build" DependsOnTargets="List">
<MSBuild Projects="@(ProjectToBuild)" BuildInParallel="true" />
</Target>
<Target Name="GitLink" DependsOnTargets="Build" Outputs="%(PlatformList.Identity)">
<PropertyGroup>
<CurrentPlatform>%(PlatformList.Identity)</CurrentPlatform>
</PropertyGroup>
<MSBuild Projects="SMP/APPVEYOR_PROJECT_NAME.sln" Properties="Configuration=%(ConfigurationList.Identity);Platform=$(CurrentPlatform);OutDir=$(MSBuildThisFileDirectory)build_out\;" />
<Exec Command="GitLink . -f SMP/APPVEYOR_PROJECT_NAME.sln -c %(ConfigurationList.Identity) -p $(CurrentPlatform) -d $(MSBuildThisFileDirectory)build_out\lib\$(CurrentPlatform) -u https://github.com/APPVEYOR_REPO_NAME.git -s APPVEYOR_REPO_COMMIT"/>
</Target>
</Project>
Expand All @@ -35,16 +57,33 @@ before_build:
$script = $script -replace "APPVEYOR_PROJECT_NAME", "$env:APPVEYOR_PROJECT_NAME"
$script = $script -replace "APPVEYOR_REPO_NAME", "$env:APPVEYOR_REPO_NAME"
$script = $script -replace "APPVEYOR_REPO_COMMIT", "$env:APPVEYOR_REPO_COMMIT"
$script | Out-File build.vcxproj
# Backup platform so it is not affected by vcvars
- cmd: SET PLATFORMBACK=%PLATFORM%

# Setup msvc environment for required compiler version (specified by MSVC_VER)
- ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:MSVC_VER" + "0COMNTOOLS"))
- cmd: call "%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" amd64

# Reset platform
- cmd: SET PLATFORM=%PLATFORMBACK%

# Download and install yasm integration
- ps: (New-Object Net.WebClient).DownloadFile('http://www.tortall.net/projects/yasm/releases/vsyasm-1.3.0-win64.zip', "$pwd\yasm.zip")
- ps: Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory("$pwd\yasm.zip", "$pwd\TempYASMUnpack");
- ps: Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory("$pwd\yasm.zip", "$pwd\TempYASMUnpack")
- ps: Move-Item -Force "TempYASMUnpack\*.exe" "$env:VSCOMNTOOLS\..\..\VC\bin"
- ps: $env:MSBUILDDIR=((Get-Command msbuild.exe).Path | Split-Path -parent)
- ps: (Get-Content "$pwd\TempYASMUnpack\vsyasm.props") -replace '\$\(Platform\)', 'win$(PlatformArchitecture)' | Set-Content "$pwd\TempYASMUnpack\vsyasm.props"
- ps: Move-Item -Force "TempYASMUnpack\*.*" "$env:MSBUILDDIR\..\..\..\Microsoft.Cpp\v4.0\V${env:MSVC_VER}0\BuildCustomizations"

- ps: Copy-Item -Force "TempYASMUnpack\*.*" "$env:MSBUILDDIR\..\..\..\Microsoft.Cpp\v4.0\V${env:MSVC_VER}0\BuildCustomizations"
# Make additional copy so its available to GitLink (which currently looks in the wrong location)
- ps: Copy-Item -Force "TempYASMUnpack\*.*" "$env:MSBUILDDIR\..\..\..\Microsoft.Cpp\v4.0\BuildCustomizations"
- ps: Copy-Item -Force "TempYASMUnpack\*.*" "$env:MSBUILDDIR\..\..\..\Microsoft.Cpp\v4.0\V120\BuildCustomizations"

build:
project: build.vcxproj
parallel: true
Expand Down
30 changes: 15 additions & 15 deletions SMP/libxvidcore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,38 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxvidcore", "libxvidcore.
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
DebugDLL|Win32 = DebugDLL|Win32
Debug|x86 = Debug|x86
DebugDLL|x64 = DebugDLL|x64
Release|Win32 = Release|Win32
DebugDLL|x86 = DebugDLL|x86
Release|x64 = Release|x64
ReleaseDLL|Win32 = ReleaseDLL|Win32
Release|x86 = Release|x86
ReleaseDLL|x64 = ReleaseDLL|x64
ReleaseLTO|Win32 = ReleaseLTO|Win32
ReleaseDLL|x86 = ReleaseDLL|x86
ReleaseLTO|x64 = ReleaseLTO|x64
ReleaseLTO|x86 = ReleaseLTO|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.Debug|Win32.ActiveCfg = Debug|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.Debug|Win32.Build.0 = Debug|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.Debug|x64.ActiveCfg = Debug|x64
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.Debug|x64.Build.0 = Debug|x64
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.Debug|x86.ActiveCfg = Debug|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.Debug|x86.Build.0 = Debug|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.DebugDLL|x64.Build.0 = DebugDLL|x64
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.Release|Win32.ActiveCfg = Release|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.Release|Win32.Build.0 = Release|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.DebugDLL|x86.ActiveCfg = DebugDLL|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.DebugDLL|x86.Build.0 = DebugDLL|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.Release|x64.ActiveCfg = Release|x64
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.Release|x64.Build.0 = Release|x64
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.Release|x86.ActiveCfg = Release|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.Release|x86.Build.0 = Release|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.ReleaseLTO|Win32.ActiveCfg = ReleaseLTO|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.ReleaseLTO|Win32.Build.0 = ReleaseLTO|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.ReleaseDLL|x86.ActiveCfg = ReleaseDLL|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.ReleaseDLL|x86.Build.0 = ReleaseDLL|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.ReleaseLTO|x64.ActiveCfg = ReleaseLTO|x64
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.ReleaseLTO|x64.Build.0 = ReleaseLTO|x64
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.ReleaseLTO|x86.ActiveCfg = ReleaseLTO|Win32
{E0889360-2F17-4D9C-A185-A5C51EA8073B}.ReleaseLTO|x86.Build.0 = ReleaseLTO|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 2 additions & 0 deletions SMP/libxvidcore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ del /f /q $(OutDir)\licenses\xvid.txt
</AddModuleNamesToAssembly>
<ModuleDefinitionFile>..\build\generic\libxvidcore.def</ModuleDefinitionFile>
<LargeAddressAware>true</LargeAddressAware>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>mkdir $(OutDir)\include
Expand Down Expand Up @@ -751,6 +752,7 @@ del /f /q $(OutDir)\licenses\xvid.txt
<AddModuleNamesToAssembly>
</AddModuleNamesToAssembly>
<ModuleDefinitionFile>..\build\generic\libxvidcore.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>mkdir $(OutDir)\include
Expand Down

0 comments on commit f0240ff

Please sign in to comment.