Skip to content

Commit 1cb0280

Browse files
authored
Merge pull request #27 from danielga/add-support-for-new-build-system
Add support for new build system Improved premake5 script Updated license and README with new links
2 parents b4dafaa + 5d916be commit 1cb0280

File tree

5 files changed

+16
-36
lines changed

5 files changed

+16
-36
lines changed

.appveyor.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,21 @@ environment:
1010
DEPENDENCIES: $(APPVEYOR_BUILD_FOLDER)/dependencies
1111
GARRYSMOD_COMMON: $(APPVEYOR_BUILD_FOLDER)/dependencies/garrysmod_common
1212
SOURCE_SDK: $(APPVEYOR_BUILD_FOLDER)/dependencies/sourcesdk-minimal
13+
PREMAKE5_URL: https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-windows.zip
1314
PREMAKE5_EXECUTABLE: premake5.exe
1415
PREMAKE5: $(APPVEYOR_BUILD_FOLDER)/dependencies/windows/premake-core/premake5.exe
15-
BUILD_SCRIPT: $(APPVEYOR_BUILD_FOLDER)/dependencies/garrysmod_common/build/ci.ps1
16+
BUILD_SCRIPT: $(APPVEYOR_BUILD_FOLDER)/dependencies/garrysmod_common/build/build.ps1
1617
GARRYSMOD_COMMON_REPOSITORY: https://github.com/danielga/garrysmod_common.git
18+
BOOTSTRAP_URL: https://raw.githubusercontent.com/danielga/garrysmod_common/master/build/bootstrap.ps1
1719
PROJECT_OS: windows
1820
TARGET_OS: win32
1921
COMPILER_PLATFORM: vs2017
2022
install:
21-
- cmd: >-
22-
if not exist "%DEPENDENCIES%/" mkdir "%DEPENDENCIES%"
23-
24-
if exist "%GARRYSMOD_COMMON%/premake5.lua" (echo "garrysmod_common directory is good, pulling any latest changes" & git -C "%GARRYSMOD_COMMON%" pull & git -C "%GARRYSMOD_COMMON%" submodule update --init --recursive)
25-
26-
if not exist "%GARRYSMOD_COMMON%/premake5.lua" (echo "garrysmod_common directory is empty, doing git clone of the remote repo" & git clone --recursive "%GARRYSMOD_COMMON_REPOSITORY%" "%GARRYSMOD_COMMON%")
23+
- ps: 'Invoke-Expression ((New-Object System.Net.WebClient).DownloadString("$env:BOOTSTRAP_URL"))'
2724
cache:
2825
- $(APPVEYOR_BUILD_FOLDER)/dependencies/
29-
- $(APPVEYOR_BUILD_FOLDER)/projects/
3026
build_script:
31-
- cmd: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" && powershell -File "%BUILD_SCRIPT%"'
27+
- ps: '& "$env:BUILD_SCRIPT"'
3228
test: off
3329
artifacts:
3430
- path: projects/$(PROJECT_OS)/$(COMPILER_PLATFORM)/release/gmsv_$(MODULE_NAME)_$(TARGET_OS).dll

.travis.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ env:
99
DEPENDENCIES="$TRAVIS_BUILD_DIR/dependencies"
1010
GARRYSMOD_COMMON="$TRAVIS_BUILD_DIR/dependencies/garrysmod_common"
1111
SOURCE_SDK="$TRAVIS_BUILD_DIR/dependencies/sourcesdk-minimal"
12+
BUILD_SCRIPT="$TRAVIS_BUILD_DIR/dependencies/garrysmod_common/build/build.sh"
13+
GARRYSMOD_COMMON_REPOSITORY="https://github.com/danielga/garrysmod_common.git"
14+
BOOTSTRAP_URL="https://raw.githubusercontent.com/danielga/garrysmod_common/master/build/bootstrap.sh"
1215
TARGET_OS="$TRAVIS_OS_NAME"
1316
COMPILER_PLATFORM=gmake
14-
BUILD_SCRIPT="$TRAVIS_BUILD_DIR/dependencies/garrysmod_common/build/ci.sh"
15-
GARRYSMOD_COMMON_REPOSITORY="https://github.com/danielga/garrysmod_common.git"
16-
PREMAKE5_EXECUTABLE=premake5
1717
matrix:
1818
include:
1919
- os: linux
@@ -29,6 +29,7 @@ matrix:
2929
env:
3030
- PREMAKE5="$TRAVIS_BUILD_DIR/dependencies/linux/premake-core/premake5"
3131
PROJECT_OS=linux
32+
PREMAKE5_URL="https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz"
3233
before_install:
3334
- export CC=gcc-8
3435
export CXX=g++-8
@@ -37,20 +38,11 @@ matrix:
3738
env:
3839
- PREMAKE5="$TRAVIS_BUILD_DIR/dependencies/macosx/premake-core/premake5"
3940
PROJECT_OS=macosx
41+
PREMAKE5_URL="https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-macosx.tar.gz"
4042
cache:
4143
directories:
4244
- "$TRAVIS_BUILD_DIR/dependencies"
43-
- "$TRAVIS_BUILD_DIR/projects"
44-
install:
45-
- mkdir -p "$DEPENDENCIES"
46-
- if [ ! -f "$GARRYSMOD_COMMON/premake5.lua" ]; then
47-
echo "garrysmod_common directory is empty, doing git clone of the remote repo";
48-
git clone --recursive "$GARRYSMOD_COMMON_REPOSITORY" "$GARRYSMOD_COMMON";
49-
else
50-
echo "garrysmod_common directory is good, pulling any latest changes";
51-
git -C "$GARRYSMOD_COMMON" pull;
52-
git -C "$GARRYSMOD_COMMON" submodule update --init --recursive;
53-
fi
45+
install: "curl -s -L \"$BOOTSTRAP_URL\" | bash"
5446
script: "$BUILD_SCRIPT"
5547
deploy:
5648
provider: releases

license.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ gm_sourcenet
22
A module for Garry's Mod that provides interfaces to many systems
33
of VALVe's engine.
44
-----------------------------------------------------------------------
5-
Copyright (c) 2015-2018, Daniel Almeida
5+
Copyright (c) 2015-2019, Daniel Almeida
66
All rights reserved.
77

88
Redistribution and use in source and binary forms, with or without

projects/premake5.lua

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@ newoption({
44
value = "path to garrysmod_common directory"
55
})
66

7-
local gmcommon = _OPTIONS.gmcommon or os.getenv("GARRYSMOD_COMMON")
8-
if gmcommon == nil then
9-
error("you didn't provide a path to your garrysmod_common (https://github.com/danielga/garrysmod_common) directory")
10-
end
11-
12-
include(gmcommon)
7+
include(assert(_OPTIONS.gmcommon or os.getenv("GARRYSMOD_COMMON"),
8+
"you didn't provide a path to your garrysmod_common (https://github.com/danielga/garrysmod_common) directory"))
139

1410
CreateWorkspace({name = "sourcenet", abi_compatible = true})
1511
CreateProject({serverside = true})
@@ -42,7 +38,3 @@ CreateWorkspace({name = "sourcenet", abi_compatible = true})
4238
["Header files"] = "../source/lzma/*.h",
4339
["Source files"] = "../source/lzma/*.c"
4440
})
45-
46-
filter("system:macosx")
47-
buildoptions("-mmacosx-version-min=10.5")
48-
linkoptions("-mmacosx-version-min=10.5")

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# gm\_sourcenet
22

3-
A module for Garry's Mod that provides interfaces to many systems of VALVe's engine, based on [gm\_sourcenet3][1].
3+
A module for Garry's Mod that provides interfaces to many systems of VALVe's engine, based on [gm\_sourcenet3][1], created by Chrisaster.
44

55
## Compiling
66

@@ -15,6 +15,6 @@ If stuff starts erroring or fails to work, be sure to check the correct line end
1515
This project requires [garrysmod\_common][2], a framework to facilitate the creation of compilations files (Visual Studio, make, XCode, etc). Simply set the environment variable '**GARRYSMOD\_COMMON**' or the premake option '**gmcommon**' to the path of your local copy of [garrysmod\_common][2].
1616
We also use [SourceSDK2013][3], so set the environment variable '**SOURCE\_SDK**' or the premake option '**sourcesdk**' to the path of your local copy of [SourceSDK2013][3]. The previous links to [SourceSDK2013][3] point to my own fork of VALVe's repo and for good reason: Garry's Mod has lots of backwards incompatible changes to interfaces and it's much smaller, being perfect for automated build systems like Travis-CI.
1717

18-
[1]: http://christopherthorne.googlecode.com/svn/trunk/gm_sourcenet3
18+
[1]: https://github.com/AlexSwift/GMod13-Modules/tree/master/gm_sourcenet3
1919
[2]: https://github.com/danielga/garrysmod_common
2020
[3]: https://github.com/danielga/sourcesdk-minimal

0 commit comments

Comments
 (0)