Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,14 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

# Ignore some files when exporting to a ZIP.
/.github/ export-ignore
/godot-cpp/ export-ignore
/godot-git-plugin/ export-ignore
/thirdparty/ export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.gitmodules export-ignore
/api.ci.json export-ignore
/build_openssl_universal_oxs.sh export-ignore
/SConstruct export-ignore
27 changes: 21 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ jobs:
run: |
pip3 install scons
scons platform=linux arch=x86_64 target=editor generate_bindings=yes
ldd demo/addons/godot-git-plugin/linux/*.so
ldd addons/godot-git-plugin/linux/*.so
- name: Prepare artifact
run: |
mkdir out
mv addons out/
- uses: actions/upload-artifact@v4
with:
name: libgit_plugin.linux.x86_64.editor.so-${{ github.sha }}
if-no-files-found: error
path: |
demo/
out/

windows-x64:
runs-on: windows-2022
Expand All @@ -48,13 +52,20 @@ jobs:
run: |
pip3 install scons
scons platform=windows arch=x86_64 target=editor generate_bindings=yes
dumpbin /dependents .\demo\addons\godot-git-plugin\win64\*.dll
dumpbin /dependents .\addons\godot-git-plugin\windows\*.dll
- name: Prepare artifact
shell: bash
run: |
# Not needed to use the plugin.
rm -f addons/godot-git-plugin/windows/*.{exp,lib}
mkdir out
mv addons out/
- uses: actions/upload-artifact@v4
with:
name: libgit_plugin.windows.x86_64.editor.dll-${{ github.sha }}
if-no-files-found: error
path: |
demo/
out/

macos-universal:
runs-on: macos-15
Expand All @@ -70,10 +81,14 @@ jobs:
run: |
pip install scons
scons platform=macos arch=universal target=editor generate_bindings=yes macos_deployment_target=10.13
otool -L demo/addons/godot-git-plugin/macos/*.dylib
otool -L addons/godot-git-plugin/macos/*.dylib
- name: Prepare artifact
run: |
mkdir out
mv addons out/
- uses: actions/upload-artifact@v4
with:
name: libgit_plugin.macos.universal.editor.dylib-${{ github.sha }}
if-no-files-found: error
path: |
demo/
out/
2 changes: 1 addition & 1 deletion .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
with:
source: "godot-git-plugin/src"
extensions: "h,cpp"
clangFormatVersion: 11
clangFormatVersion: 18
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# SConstruct db
*.dblite

# Godot ignores
demo/.godot/

# Godot Serialisations
extension_api.json
!/ci/extension_api.json
Expand Down Expand Up @@ -34,3 +31,7 @@ win64/
*.ilk
*.pdb
*.pyc
*.zip

# Misc
*.log
34 changes: 12 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,28 @@

Git implementation of the Godot Engine VCS interface in Godot. We use [libgit2](https://libgit2.org) as our backend to simulate Git in code.

> Planned for the upcoming version of Godot. Look for other branches for support in other Godot releases.
## Installation

## Installation Instructions

1. Grab the platform binaries here: <https://github.com/godotengine/godot-git-plugin/releases>
1. Grab the platform binaries here: https://github.com/godotengine/godot-git-plugin/releases
2. Then read the installation instructions: https://github.com/godotengine/godot-git-plugin/wiki

## Build Instructions
## Build

This section onwards is only meant to be used if you intend to compile the plugin from source.

### Required Tools
### Required tools

- Full copy of the source code. Remember to use `git clone --recursive`.
- [SCons](https://scons.org/pages/download.html) (v3.0.1+)
- Full copy of the source code. Remember to use `git clone --recursive`, or initialize submodules with `git submodule update --init`.
- [SCons](https://scons.org/pages/download.html) (v3.1.2+), CMake, and Perl.
- C++17 and C90 compilers detectable by SCons and present in `PATH`.
- Platforms Specific Setup
- Windows
- No extra steps required other than setting up the compilers.
- MacOS
- For making universal builds targeting both Apple Silicon and x86_64, you can optionally run `build_openssl_universal_macos.sh` to build OpenSSL yourself and replace the already prebuilt libraries provided inside `thirdparty/openssl/`, otherwise, just run `brew install [email protected]` to use the prebuilt libraries provided in this repository.
- Linux
- Run `sudo apt-get install libssl-dev`, or your local package manager's equivalent.

### Release Build
### Release build

```
scons platform=<platform> target=editor -j 6
scons platform=<platform> target=editor
```

> You may get the gdextension dump yourself from Godot using the instructions in the next section, or use the ones provided in `godot-cpp/gdextension` or `ci/`.
> You may get the GDExtension dump yourself from Godot using the instructions in the next section, or use the ones provided in `godot-cpp`.

For more build options, run `scons platform=<platform> -h`

Expand All @@ -49,19 +40,18 @@ If you need to use a custom GDExtension API:
1. Dump the new bindings from the custom Godot build.

```shell
cd local/copy/of/godot/source
.\bin\godot.xxx --headless --dump-gdextension-interface --dump-extension-api
./path/to/godot/bin/godot.<platform>.editor.<arch> --headless --dump-gdextension-interface --dump-extension-api
```

2. Build the plugin along with the godot-cpp library.

```
scons platform=<platform> target=editor generate_bindings=yes dev_build=yes -j 6
scons platform=<platform> target=editor generate_bindings=yes dev_build=yes
```

> You only need to build godot-cpp once every change in the GDExtension API, hence, `generate_bindings=yes` should only be passed in during the first time after generating a new GDExtension API dump.

3. Open the project provided inside `demo/` in the custom Godot build.
3. To test the plugin, set up a testing project with Godot, and copy or symlink the `addons` folder.

To view more options available while recompiling godot-git-plugin, run `scons platform=<platform> -h`.

Expand Down
6 changes: 3 additions & 3 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

import os

EnsureSConsVersion(3, 0, 0)
EnsurePythonVersion(3, 5)
EnsureSConsVersion(3, 1, 2)
EnsurePythonVersion(3, 6)

opts = Variables([], ARGUMENTS)

env = Environment(ENV=os.environ)

# Define our options
opts.Add(PathVariable("target_path",
"The path where the lib is installed.", "demo/addons/godot-git-plugin/"))
"The path where the lib is installed.", "addons/godot-git-plugin/"))
opts.Add(PathVariable("target_name", "The library name.",
"libgit_plugin", PathVariable.PathAccept))

Expand Down
2 changes: 1 addition & 1 deletion THIRDPARTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The Godot Git Plugin source code uses the following third-party source code:
1. godotengine/godot-cpp - MIT License - https://github.com/godotengine/godot-cpp/tree/02336831735fd6affbe0a6fa252ec98d3e78120c
2. libgit2/libgit2 - GPLv2 with a special Linking Exception - https://github.com/libgit2/libgit2/tree/b7bad55e4bb0a285b073ba5e02b01d3f522fc95d
3. libssh2/libssh2 - BSD-3-Clause License - https://github.com/libssh2/libssh2/tree/635caa90787220ac3773c1d5ba11f1236c22eae8
4. openssl (only on Linux and MacOS) - OpenSSL License - https://github.com/openssl/openssl/tree/26baecb28ce461696966dac9ac889629db0b3b96
4. openssl - OpenSSL License - https://github.com/openssl/openssl/tree/26baecb28ce461696966dac9ac889629db0b3b96

## License Texts

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
[configuration]

entry_symbol = "git_plugin_init"
compatibility_minimum = "4.1.0"
compatibility_minimum = "4.2.0"

[libraries]

macos.editor = "macos/libgit_plugin.macos.editor.universal.dylib"
windows.editor.x86_64 = "win64/libgit_plugin.windows.editor.x86_64.dll"
linux.editor.x86_64 = "linux/libgit_plugin.linux.editor.x86_64.so"
linux.editor.arm64 = "linux/libgit_plugin.linux.editor.arm64.so"
linux.editor.rv64 = ""
macos.editor = "macos/libgit_plugin.macos.editor.universal.dylib"
windows.editor.x86_64 = "windows/libgit_plugin.windows.editor.x86_64.dll"
20 changes: 0 additions & 20 deletions build_openssl_universal_macos.sh

This file was deleted.

2 changes: 0 additions & 2 deletions demo/.gitattributes

This file was deleted.

2 changes: 0 additions & 2 deletions demo/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions demo/addons/godot-git-plugin/plugin.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions demo/demo.tscn

This file was deleted.

12 changes: 0 additions & 12 deletions demo/new_script.gd

This file was deleted.

22 changes: 0 additions & 22 deletions demo/project.godot

This file was deleted.

21 changes: 2 additions & 19 deletions godot-git-plugin/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,21 @@ env = {}
Import("env")
Import("ssl")

# Process some arguments
if env["use_llvm"]:
env["CC"] = "clang"
env["CXX"] = "clang++"

if env["platform"] == "":
print("No valid target platform selected.")
quit()

env["target_path"] = "../" + env["target_path"]

if not os.path.isdir(env["target_path"]):
os.mkdir(env["target_path"])

# Check our platform specifics
if env["platform"] == "macos":
env["target_path"] += "macos/"

# Force static linkage (https://stackoverflow.com/a/2995999/7370948)
env["target_path"] += env["platform"] + "/"

if env["platform"] == "macos":
if env["macos_deployment_target"] != "default":
env.Append(CCFLAGS=["-mmacosx-version-min=" +
env["macos_deployment_target"]])
env.Append(LINKFLAGS=["-mmacosx-version-min=" +
env["macos_deployment_target"]])

elif env["platform"] == "linux":
env["target_path"] += "linux/"

elif env["platform"] == "windows":
env["target_path"] += "win64/"

env.Append(LIBS=["advapi32", "winhttp", "rpcrt4", "crypt32",
"ole32", "user32", "wsock32", "ws2_32", "bcrypt"])

Expand Down
22 changes: 12 additions & 10 deletions release.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
echo "Enter the new version number (e.g. 1.2.1):"
read version

echo "Enter the Windows x64 release ZIP URL:"
read windowsZIPURL
echo "Enter the Windows x64 release ZIP artifact ID or URL:"
read windowsArtifactID

echo "Enter the Linux x64 release ZIP URL:"
read linuxZIPURL
echo "Enter the Linux x64 release ZIP artifact ID or URL:"
read linuxArtifactID

echo "Enter the MacOS universal release ZIP URL:"
read macZIPURL
echo "Enter the MacOS universal release ZIP artifact ID or URL:"
read macArtifactID

# wget-ing the github.com URL gives a 404, so we use the method proposed here - https://github.com/actions/upload-artifact/issues/51#issuecomment-735989475
windowsZIPURL=${windowsZIPURL/github.com/nightly.link}
linuxZIPURL=${linuxZIPURL/github.com/nightly.link}
macZIPURL=${macZIPURL/github.com/nightly.link}
# The ${foo##*/} syntax extracts the string after the last '/' in case it's a full artifact URL.
baseURL=https://nightly.link/godotengine/godot-git-plugin/actions/artifacts/
windowsZIPURL=${baseURL}${windowsArtifactID##*/}.zip
linuxZIPURL=${baseURL}${linuxArtifactID##*/}.zip
macZIPURL=${baseURL}${macArtifactID##*/}.zip

wget -O windows.zip $windowsZIPURL
wget -O linux.zip $linuxZIPURL
Expand All @@ -43,7 +45,7 @@ sed -i "s/version=\"[^\"]*\"/version=\"v${version}\"/g" $pluginPath/plugin.cfg
cp LICENSE $pluginPath/LICENSE
cp THIRDPARTY.md $pluginPath/THIRDPARTY.md

zip -r $releasePath.zip $addonsPath
zip -r $releasePath.zip $addonsPath

rm -rf $releasePath
rm -rf windows
Expand Down