Skip to content

Commit 8e159bf

Browse files
committed
Initial commit
0 parents  commit 8e159bf

File tree

11 files changed

+378
-0
lines changed

11 files changed

+378
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/projects/

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "LRDB"]
2+
path = LRDB
3+
url = https://github.com/danielga/LRDB.git
4+
[submodule "asio"]
5+
path = asio
6+
url = https://github.com/chriskohlhoff/asio.git
7+
[submodule "picojson"]
8+
path = picojson
9+
url = https://github.com/kazuho/picojson.git

LRDB

Submodule LRDB added at 7f4e0a2

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# gm_lrdb
2+
3+
[![Build Status](https://metamann.visualstudio.com/GitHub%20danielga/_apis/build/status/danielga.gm_lrdb?branchName=master)](https://metamann.visualstudio.com/GitHub%20danielga/_build/latest?definitionId=16&branchName=master)
4+
5+
A Garry's Mod module that creates a Lua Remote DeBugger server.
6+
7+
## Compiling
8+
9+
The only supported compilation platform for this project on Windows is **Visual Studio 2017**. However, it's possible it'll work with *Visual Studio 2015* and *Visual Studio 2019* because of the unified runtime.
10+
11+
On Linux, everything should work fine as is.
12+
13+
For macOS, any **Xcode (using the GCC compiler)** version *MIGHT* work as long as the **Mac OSX 10.7 SDK** is used.
14+
15+
These restrictions are not random; they exist because of ABI compatibility reasons.
16+
17+
If stuff starts erroring or fails to work, be sure to check the correct line endings (`\n` and such) are present in the files for each OS.
18+
19+
## Requirements
20+
21+
This project requires [garrysmod\_common][1], 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=path` to the path of your local copy of [garrysmod\_common][1].
22+
23+
[1]: https://github.com/danielga/garrysmod_common

asio

Submodule asio added at b84e6c1

azure-pipelines.yml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
variables:
2+
MODULE_NAME: lrdb
3+
DEPENDENCIES: $(System.DefaultWorkingDirectory)/dependencies
4+
GARRYSMOD_COMMON: $(System.DefaultWorkingDirectory)/dependencies/garrysmod_common
5+
GARRYSMOD_COMMON_BRANCH: master
6+
GARRYSMOD_COMMON_REPOSITORY: https://github.com/danielga/garrysmod_common.git
7+
PROJECT_GENERATOR_VERSION: 2
8+
REPOSITORY_DIR: $(System.DefaultWorkingDirectory)
9+
trigger:
10+
tags:
11+
include:
12+
- '*'
13+
jobs:
14+
- job: windows
15+
displayName: Windows
16+
pool:
17+
name: Azure Pipelines
18+
vmImage: windows-2019
19+
timeoutInMinutes: 10
20+
variables:
21+
BOOTSTRAP_URL: https://raw.githubusercontent.com/danielga/garrysmod_common/master/build/bootstrap.ps1
22+
BUILD_SCRIPT: $(System.DefaultWorkingDirectory)/dependencies/garrysmod_common/build/build.ps1
23+
COMPILER_PLATFORM: vs2019
24+
PROJECT_OS: windows
25+
PREMAKE5: $(System.DefaultWorkingDirectory)/dependencies/windows/premake-core/premake5.exe
26+
PREMAKE5_URL: https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-windows.zip
27+
steps:
28+
- checkout: self
29+
clean: true
30+
fetchDepth: 1
31+
submodules: recursive
32+
- powershell: 'Invoke-Expression ((New-Object System.Net.WebClient).DownloadString("$env:BOOTSTRAP_URL"))'
33+
displayName: Bootstrap
34+
- powershell: '& "$env:BUILD_SCRIPT"'
35+
displayName: Build
36+
- task: CopyFiles@2
37+
displayName: 'Copy files to $(Build.ArtifactStagingDirectory)'
38+
inputs:
39+
SourceFolder: '$(System.DefaultWorkingDirectory)/projects/windows/vs2019'
40+
Contents: '*/Release/*.dll'
41+
TargetFolder: '$(Build.ArtifactStagingDirectory)'
42+
CleanTargetFolder: true
43+
flattenFolders: true
44+
preserveTimestamp: true
45+
- task: PublishBuildArtifacts@1
46+
displayName: 'Publish build artifacts'
47+
inputs:
48+
ArtifactName: windows
49+
- job: linux
50+
displayName: Linux
51+
pool:
52+
name: Azure Pipelines
53+
vmImage: ubuntu-16.04
54+
timeoutInMinutes: 10
55+
variables:
56+
BOOTSTRAP_URL: https://raw.githubusercontent.com/danielga/garrysmod_common/master/build/bootstrap.sh
57+
BUILD_SCRIPT: $(System.DefaultWorkingDirectory)/dependencies/garrysmod_common/build/build.sh
58+
COMPILER_PLATFORM: gmake
59+
PREMAKE5: $(System.DefaultWorkingDirectory)/dependencies/linux/premake-core/premake5
60+
PROJECT_OS: linux
61+
PREMAKE5_URL: https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-linux.tar.gz
62+
CC: gcc-9
63+
CXX: g++-9
64+
AR: gcc-ar-9
65+
NM: gcc-nm-9
66+
RANLIB: gcc-ranlib-9
67+
steps:
68+
- checkout: self
69+
clean: true
70+
fetchDepth: 1
71+
submodules: recursive
72+
- bash: 'curl -s -L "$BOOTSTRAP_URL" | bash'
73+
displayName: Bootstrap
74+
- bash: |
75+
sudo apt-get update && sudo apt-get install -y g++-9-multilib
76+
$BUILD_SCRIPT
77+
displayName: Build
78+
- task: CopyFiles@2
79+
displayName: 'Copy files to $(Build.ArtifactStagingDirectory)'
80+
inputs:
81+
SourceFolder: '$(System.DefaultWorkingDirectory)/projects/linux/gmake'
82+
Contents: '*/Release/*.dll'
83+
TargetFolder: '$(Build.ArtifactStagingDirectory)'
84+
CleanTargetFolder: true
85+
flattenFolders: true
86+
preserveTimestamp: true
87+
- task: PublishBuildArtifacts@1
88+
displayName: 'Publish build artifacts'
89+
inputs:
90+
ArtifactName: linux
91+
- job: macosx
92+
displayName: macOS
93+
pool:
94+
name: Azure Pipelines
95+
vmImage: macOS-10.15
96+
timeoutInMinutes: 10
97+
variables:
98+
BOOTSTRAP_URL: https://raw.githubusercontent.com/danielga/garrysmod_common/master/build/bootstrap.sh
99+
BUILD_SCRIPT: $(System.DefaultWorkingDirectory)/dependencies/garrysmod_common/build/build.sh
100+
COMPILER_PLATFORM: gmake
101+
PREMAKE5: $(System.DefaultWorkingDirectory)/dependencies/macosx/premake-core/premake5
102+
PROJECT_OS: macosx
103+
PREMAKE5_URL: https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-macosx.tar.gz
104+
MACOSX_SDK_URL: https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.7.sdk.tar.xz
105+
MACOSX_SDK_DIRECTORY: $(System.DefaultWorkingDirectory)/dependencies/macosx/MacOSX10.7.sdk
106+
SDKROOT: $(System.DefaultWorkingDirectory)/dependencies/macosx/MacOSX10.7.sdk
107+
steps:
108+
- checkout: self
109+
clean: true
110+
fetchDepth: 1
111+
submodules: recursive
112+
- bash: 'curl -s -L "$BOOTSTRAP_URL" | bash'
113+
displayName: Bootstrap
114+
- bash: |
115+
sudo xcode-select -s "/Applications/Xcode_11.4.1.app/Contents/Developer"
116+
$BUILD_SCRIPT
117+
displayName: Build
118+
- task: CopyFiles@2
119+
displayName: 'Copy files to $(Build.ArtifactStagingDirectory)'
120+
inputs:
121+
SourceFolder: '$(System.DefaultWorkingDirectory)/projects/macosx/gmake'
122+
Contents: '*/Release/*.dll'
123+
TargetFolder: '$(Build.ArtifactStagingDirectory)'
124+
CleanTargetFolder: true
125+
flattenFolders: true
126+
preserveTimestamp: true
127+
- task: PublishBuildArtifacts@1
128+
displayName: 'Publish build artifacts'
129+
inputs:
130+
ArtifactName: macosx
131+
- job: publish
132+
displayName: Publish to GitHub Releases
133+
pool:
134+
name: Azure Pipelines
135+
vmImage: ubuntu-18.04
136+
timeoutInMinutes: 5
137+
dependsOn:
138+
- windows
139+
- linux
140+
- macosx
141+
steps:
142+
- task: DownloadBuildArtifacts@0
143+
displayName: 'Download build artifacts'
144+
inputs:
145+
downloadType: specific
146+
parallelizationLimit: 12
147+
- task: GitHubRelease@1
148+
displayName: 'Publish GitHub release $(build.sourceBranchName)'
149+
inputs:
150+
gitHubConnection: 'GitHub danielga'
151+
releaseNotesSource: inline
152+
assets: '$(System.ArtifactsDirectory)/**'
153+
addChangeLog: false

launch.example.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"configurations": [
3+
{
4+
"type": "lrdb",
5+
"request": "attach",
6+
"name": "Attach to Garry's Mod",
7+
"stopOnEntry": true,
8+
// If debugging directly on a Garry's Mod server or client instance, "sourceRoot" pointing to Garry's Mod "garrysmod" directory should be enough
9+
"sourceRoot": "${workspaceFolder}",
10+
// Host to connect to, can be localhost (127.0.0.1) or any remote host
11+
"host": "localhost",
12+
// Port to connect to, in case you change it with lrdb.activate(port_number)
13+
"port": 21110,
14+
"sourceFileMap": {
15+
// This is an example for a remote setup
16+
// Local directory -> remote directory (as is announced by debug.getinfo)
17+
"${workspaceFolder}": "addons/addon_name_here",
18+
"{FULL PATH TO GARRY'S MOD CONTENT DIRECTORY}": "."
19+
}
20+
}
21+
]
22+
}

license.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
gm_lrdb
2+
A Garry's Mod module that creates a Lua Remote DeBugger server.
3+
-----------------------------------------------------------------------
4+
Copyright (c) 2021, Daniel Almeida
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without
8+
modification, are permitted provided that the following conditions
9+
are met:
10+
11+
1. Redistributions of source code must retain the above copyright
12+
notice, this list of conditions and the following disclaimer.
13+
14+
2. Redistributions in binary form must reproduce the above copyright
15+
notice, this list of conditions and the following disclaimer in the
16+
documentation and/or other materials provided with the distribution.
17+
18+
3. Neither the name of the copyright holder nor the names of its
19+
contributors may be used to endorse or promote products derived from
20+
this software without specific prior written permission.
21+
22+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

picojson

Submodule picojson added at 111c9be

premake5.lua

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
PROJECT_GENERATOR_VERSION = 2
2+
3+
newoption({
4+
trigger = "gmcommon",
5+
description = "Sets the path to the garrysmod_common (https://github.com/danielga/garrysmod_common) directory",
6+
value = "path to garrysmod_common directory"
7+
})
8+
9+
include(assert(_OPTIONS.gmcommon or os.getenv("GARRYSMOD_COMMON"),
10+
"you didn't provide a path to your garrysmod_common (https://github.com/danielga/garrysmod_common) directory"))
11+
12+
CreateWorkspace({name = "lrdb"})
13+
filter("system:windows")
14+
defines("_WIN32_WINNT=0x0601")
15+
16+
CreateProject({serverside = true})
17+
sysincludedirs({
18+
"LRDB/include",
19+
"asio/asio/include",
20+
"picojson"
21+
})
22+
IncludeLuaShared()
23+
24+
CreateProject({serverside = false})
25+
sysincludedirs({
26+
"LRDB/include",
27+
"asio/asio/include",
28+
"picojson"
29+
})
30+
IncludeLuaShared()

0 commit comments

Comments
 (0)