Skip to content

Commit

Permalink
Worked on AppVeyor test configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Mar 27, 2016
1 parent a25b881 commit 2a25b0f
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
22 changes: 22 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
environment:
VisualStudioVersion: 11.0

# TODO: add x64, fix issue: LNK1158: cannot run 'cvtres.exe'
platform:
- Win32

# TODO: add VSDebug
configuration:
- Release

install:
- cmd: git clone https://github.com/libyal/libyal

before_build:
- ps: .\synclibs.ps1
- ps: .\autogen.ps1
- cmd: C:\Python27\python.exe libyal\msvscpp-convert.py --to 2010 msvscpp\libevtx.sln

build:
project: vs2010\libevtx.sln

15 changes: 15 additions & 0 deletions autogen.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Script to generate the necessary files for a msvscpp build
#
# Version: 20150105

$Library = Get-Content -Path configure.ac | select -skip 3 -first 1 | % { $_ -Replace " \[","" } | % { $_ -Replace "\],","" }
$Version = Get-Content -Path configure.ac | select -skip 4 -first 1 | % { $_ -Replace " \[","" } | % { $_ -Replace "\],","" }

Get-Content -Path include\${Library}.h.in > include\${Library}.h
Get-Content -Path include\${Library}\definitions.h.in | % { $_ -Replace "@VERSION@",${Version} } > include\${Library}\definitions.h
Get-Content -Path include\${Library}\features.h.in | % { $_ -Replace "@[A-Z0-9_]*@","0" } > include\${Library}\features.h
Get-Content -Path include\${Library}\types.h.in | % { $_ -Replace "@[A-Z0-9_]*@","0" } > include\${Library}\types.h
Get-Content -Path common\types.h.in | % { $_ -Replace "@PACKAGE@",${Library} } > common\types.h
Get-Content -Path ${Library}\${Library}_definitions.h.in | % { $_ -Replace "@VERSION@",${Version} } > ${Library}\${Library}_definitions.h
Get-Content -Path ${Library}\${Library}.rc.in | % { $_ -Replace "@VERSION@",${Version} } > ${Library}\${Library}.rc

32 changes: 32 additions & 0 deletions synclibs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Script that synchronizes the local library dependencies
#
# Version: 20150105

$GitUrlPrefix = "https://github.com/libyal"
$LocalLibs = @("libbfio","libcdata","libcdirectory","libcerror","libcfile","libclocale","libcnotify","libcpath","libcsplit","libcstring","libcsystem","libcthreads","libexe","libfcache","libfdata","libfdatetime","libfguid","libfvalue","libfwevt","libfwnt","libregf","libuna","libwrc")

foreach (${LocalLib} in ${LocalLibs})
{
# PowerShell will raise NativeCommandError if git writes to stdout or stderr
# therefore 2>&1 is added and the output is stored in a variable.
$Output = Invoke-Expression -Command "git clone ${GitUrlPrefix}/${LocalLib}.git ${LocalLib}-${pid} 2>&1"

if (Test-Path ${LocalLib}-${pid})
{
$LocalLibVersion = Get-Content -Path ${LocalLib}-${pid}\configure.ac | select -skip 4 -first 1 | % { $_ -Replace " \[","" } | % { $_ -Replace "\],","" }

if (Test-Path ${LocalLib})
{
Remove-Item -Path ${LocalLib} -Force -Recurse
}
New-Item -ItemType directory -Path ${LocalLib} -Force | Out-Null

if (Test-Path ${LocalLib})
{
Copy-Item -Path ${LocalLib}-${pid}\${LocalLib}\*.[ch] -Destination ${LocalLib}\
Get-Content -Path ${LocalLib}-${pid}\${LocalLib}\${LocalLib}_definitions.h.in | % { $_ -Replace "@VERSION@",${LocalLibVersion} } > ${LocalLib}\${LocalLib}_definitions.h
}
Remove-Item -Path ${LocalLib}-${pid} -Force -Recurse
}
}

0 comments on commit 2a25b0f

Please sign in to comment.