-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci.ps1
executable file
·77 lines (66 loc) · 2.43 KB
/
ci.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
mkdir "$env:DEPENDENCIES" -ErrorAction SilentlyContinue
cd "$env:DEPENDENCIES"
if( !( ( Get-Item "$env:GARRYSMOD_COMMON/premake5.lua" -ErrorAction SilentlyContinue ) -is [System.IO.FileInfo] ) )
{
echo "garrysmod_common directory is empty, doing git clone of the remote repo"
git clone --recursive https://github.com/danielga/garrysmod_common.git
}
else
{
echo "garrysmod_common directory is good, pulling any latest changes"
cd "$env:GARRYSMOD_COMMON"
git pull
git submodule update --init --recursive
}
cd "$env:DEPENDENCIES"
if( !( ( Get-Item "$env:SOURCE_SDK/LICENSE" -ErrorAction SilentlyContinue ) -is [System.IO.FileInfo] ) )
{
echo "sourcesdk-minimal directory is empty, doing git clone of the remote repo"
git clone https://github.com/danielga/sourcesdk-minimal.git
}
else
{
echo "sourcesdk-minimal directory is good, pulling any latest changes"
cd "$env:SOURCE_SDK"
git pull
}
cd "$env:DEPENDENCIES"
if( !( ( Get-Item "$env:DEPENDENCIES/premake-core/premake5.lua" -ErrorAction SilentlyContinue ) -is [System.IO.FileInfo] ) )
{
echo "premake-core directory is empty, doing git clone of the remote repo"
git clone --recursive https://github.com/premake/premake-core.git
}
else
{
echo "premake-core directory is good, pulling any latest changes"
cd "$env:DEPENDENCIES/premake-core"
git pull
git submodule update --init --recursive
}
mkdir "$env:DEPENDENCIES/windows" -ErrorAction SilentlyContinue
pushd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools"
cmd /c "VsDevCmd.bat&set" |
foreach {
if( $_ -match "=" )
{
$v = $_.split( "=" )
Set-Item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
Write-Host "`nVisual Studio 2017 command prompt variables set." -ForegroundColor Yellow
if( !( ( Get-Item "$env:PREMAKE5" -ErrorAction SilentlyContinue ) -is [System.IO.FileInfo] ) )
{
echo "premake-core directory is empty, bootstrapping"
cd "$env:DEPENDENCIES/premake-core"
nmake -f Bootstrap.mak windows
cd "$env:DEPENDENCIES"
mkdir "$env:DEPENDENCIES/windows/premake-core" -ErrorAction SilentlyContinue
cp "$env:DEPENDENCIES/premake-core/bin/release/premake5.exe" "$env:DEPENDENCIES/windows/premake-core"
}
cd "$env:REPOSITORY_DIR/projects"
& "$env:PREMAKE5" vs2017
cd "$env:REPOSITORY_DIR/projects/windows/vs2017"
msbuild "$env:MODULE_NAME.sln" /p:Configuration=Release
cp "$env:REPOSITORY_DIR/projects/windows/vs2017/release/gm*_${env:MODULE_NAME}_win32.dll" "$env:REPOSITORY_DIR"
cd "$env:REPOSITORY_DIR"