Skip to content

Commit 4372188

Browse files
committed
Misc fixes and cleanup
- Remove the `demo` project which isn't really useful. * Instead the `addons` subfolder is made top-level and that's where stuff gets written. - Update the README following recent PRs (godotengine#191, godotengine#199) as OpenSSL is now compiled from source for all platforms. * Also remove obsolete `build_openssl_universal_macos.sh` script. - Remove the bogus `plugin.cfg` which isn't necessary, and was confusing users who tried to enable it. * Fixes godotengine#267. - Bump min SCons version to 3.1.2 and Python to 3.6. - Bump `compatibility_minimum` to `4.2.0` following godotengine#196. - Remove some code in `godot-git-plugin/SCsub` that seems redundant with `godot-cpp` config. - Remove unnecessary `.exp` and `.lib` files in Windows artifact, rename its folder to `windows`. - Remove `export-ignore`s in `.gitattributes`, they're incomplete and not actually doing anything usable. - Fix artifacts URL handling in `release.sh`, make it executable. - CI: Update clang-format check to version 18.
1 parent fd85a8e commit 4372188

17 files changed

+58
-150
lines changed

.gitattributes

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,2 @@
11
# Normalize EOL for all files that Git considers text files.
22
* text=auto eol=lf
3-
4-
# Ignore some files when exporting to a ZIP.
5-
/.github/ export-ignore
6-
/godot-cpp/ export-ignore
7-
/godot-git-plugin/ export-ignore
8-
/thirdparty/ export-ignore
9-
/.gitattributes export-ignore
10-
/.gitignore export-ignore
11-
/.gitmodules export-ignore
12-
/api.ci.json export-ignore
13-
/build_openssl_universal_oxs.sh export-ignore
14-
/SConstruct export-ignore

.github/workflows/build.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@ jobs:
2323
run: |
2424
pip3 install scons
2525
scons platform=linux arch=x86_64 target=editor generate_bindings=yes
26-
ldd demo/addons/godot-git-plugin/linux/*.so
26+
ldd addons/godot-git-plugin/linux/*.so
27+
- name: Prepare artifact
28+
run: |
29+
mkdir out
30+
mv addons out/
2731
- uses: actions/upload-artifact@v4
2832
with:
2933
name: libgit_plugin.linux.x86_64.editor.so-${{ github.sha }}
3034
if-no-files-found: error
3135
path: |
32-
demo/
36+
out/
3337
3438
windows-x64:
3539
runs-on: windows-2022
@@ -48,13 +52,19 @@ jobs:
4852
run: |
4953
pip3 install scons
5054
scons platform=windows arch=x86_64 target=editor generate_bindings=yes
51-
dumpbin /dependents .\demo\addons\godot-git-plugin\win64\*.dll
55+
dumpbin /dependents .\addons\godot-git-plugin\windows\*.dll
56+
- name: Prepare artifact
57+
run: |
58+
# Not needed to use the plugin.
59+
rm -f addons/godot-git-plugin/windows/*.exp addons/godot-git-plugin/windows/*.lib
60+
mkdir out
61+
mv addons out/
5262
- uses: actions/upload-artifact@v4
5363
with:
5464
name: libgit_plugin.windows.x86_64.editor.dll-${{ github.sha }}
5565
if-no-files-found: error
5666
path: |
57-
demo/
67+
out/
5868
5969
macos-universal:
6070
runs-on: macos-15
@@ -70,10 +80,14 @@ jobs:
7080
run: |
7181
pip install scons
7282
scons platform=macos arch=universal target=editor generate_bindings=yes macos_deployment_target=10.13
73-
otool -L demo/addons/godot-git-plugin/macos/*.dylib
83+
otool -L addons/godot-git-plugin/macos/*.dylib
84+
- name: Prepare artifact
85+
run: |
86+
mkdir out
87+
mv addons out/
7488
- uses: actions/upload-artifact@v4
7589
with:
7690
name: libgit_plugin.macos.universal.editor.dylib-${{ github.sha }}
7791
if-no-files-found: error
7892
path: |
79-
demo/
93+
out/

.github/workflows/clang-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
with:
1313
source: "godot-git-plugin/src"
1414
extensions: "h,cpp"
15-
clangFormatVersion: 11
15+
clangFormatVersion: 18

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# SConstruct db
22
*.dblite
33

4-
# Godot ignores
5-
demo/.godot/
6-
74
# Godot Serialisations
85
extension_api.json
96
!/ci/extension_api.json
@@ -34,3 +31,7 @@ win64/
3431
*.ilk
3532
*.pdb
3633
*.pyc
34+
*.zip
35+
36+
# Misc
37+
*.log

README.md

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,28 @@
66

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

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

11-
## Installation Instructions
12-
13-
1. Grab the platform binaries here: <https://github.com/godotengine/godot-git-plugin/releases>
11+
1. Grab the platform binaries here: https://github.com/godotengine/godot-git-plugin/releases
1412
2. Then read the installation instructions: https://github.com/godotengine/godot-git-plugin/wiki
1513

16-
## Build Instructions
14+
## Build
1715

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

20-
### Required Tools
18+
### Required tools
2119

22-
- Full copy of the source code. Remember to use `git clone --recursive`.
23-
- [SCons](https://scons.org/pages/download.html) (v3.0.1+)
20+
- Full copy of the source code. Remember to use `git clone --recursive`, or initialize submodules with `git submodule update --init`.
21+
- [SCons](https://scons.org/pages/download.html) (v3.1.2+), CMake, and Perl.
2422
- C++17 and C90 compilers detectable by SCons and present in `PATH`.
25-
- Platforms Specific Setup
26-
- Windows
27-
- No extra steps required other than setting up the compilers.
28-
- MacOS
29-
- 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.
30-
- Linux
31-
- Run `sudo apt-get install libssl-dev`, or your local package manager's equivalent.
3223

33-
### Release Build
24+
### Release build
3425

3526
```
36-
scons platform=<platform> target=editor -j 6
27+
scons platform=<platform> target=editor
3728
```
3829

39-
> 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/`.
30+
> You may get the GDExtension dump yourself from Godot using the instructions in the next section, or use the ones provided in `godot-cpp`.
4031
4132
For more build options, run `scons platform=<platform> -h`
4233

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

5142
```shell
52-
cd local/copy/of/godot/source
53-
.\bin\godot.xxx --headless --dump-gdextension-interface --dump-extension-api
43+
./path/to/godot/bin/godot.<platform>.editor.<arch> --headless --dump-gdextension-interface --dump-extension-api
5444
```
5545

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

5848
```
59-
scons platform=<platform> target=editor generate_bindings=yes dev_build=yes -j 6
49+
scons platform=<platform> target=editor generate_bindings=yes dev_build=yes
6050
```
6151

6252
> 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.
6353
64-
3. Open the project provided inside `demo/` in the custom Godot build.
54+
3. To test the plugin, set up a testing project with Godot, and copy or symlink the `addons` folder.
6555

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

SConstruct

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
import os
44

5-
EnsureSConsVersion(3, 0, 0)
6-
EnsurePythonVersion(3, 5)
5+
EnsureSConsVersion(3, 1, 2)
6+
EnsurePythonVersion(3, 6)
77

88
opts = Variables([], ARGUMENTS)
99

1010
env = Environment(ENV=os.environ)
1111

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

THIRDPARTY.md

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

1010
## License Texts
1111

Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
[configuration]
22

33
entry_symbol = "git_plugin_init"
4-
compatibility_minimum = "4.1.0"
4+
compatibility_minimum = "4.2.0"
55

66
[libraries]
77

8-
macos.editor = "macos/libgit_plugin.macos.editor.universal.dylib"
9-
windows.editor.x86_64 = "win64/libgit_plugin.windows.editor.x86_64.dll"
108
linux.editor.x86_64 = "linux/libgit_plugin.linux.editor.x86_64.so"
11-
linux.editor.arm64 = "linux/libgit_plugin.linux.editor.arm64.so"
12-
linux.editor.rv64 = ""
9+
macos.editor = "macos/libgit_plugin.macos.editor.universal.dylib"
10+
windows.editor.x86_64 = "windows/libgit_plugin.windows.editor.x86_64.dll"

build_openssl_universal_macos.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

demo/.gitattributes

Lines changed: 0 additions & 2 deletions
This file was deleted.

demo/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

demo/addons/godot-git-plugin/plugin.cfg

Lines changed: 0 additions & 7 deletions
This file was deleted.

demo/demo.tscn

Lines changed: 0 additions & 3 deletions
This file was deleted.

demo/new_script.gd

Lines changed: 0 additions & 12 deletions
This file was deleted.

demo/project.godot

Lines changed: 0 additions & 22 deletions
This file was deleted.

godot-git-plugin/SCsub

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,21 @@ env = {}
66
Import("env")
77
Import("ssl")
88

9-
# Process some arguments
10-
if env["use_llvm"]:
11-
env["CC"] = "clang"
12-
env["CXX"] = "clang++"
13-
14-
if env["platform"] == "":
15-
print("No valid target platform selected.")
16-
quit()
17-
189
env["target_path"] = "../" + env["target_path"]
1910

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

2314
# Check our platform specifics
24-
if env["platform"] == "macos":
25-
env["target_path"] += "macos/"
26-
27-
# Force static linkage (https://stackoverflow.com/a/2995999/7370948)
15+
env["target_path"] += env["platform"] + "/"
2816

17+
if env["platform"] == "macos":
2918
if env["macos_deployment_target"] != "default":
3019
env.Append(CCFLAGS=["-mmacosx-version-min=" +
3120
env["macos_deployment_target"]])
3221
env.Append(LINKFLAGS=["-mmacosx-version-min=" +
3322
env["macos_deployment_target"]])
34-
35-
elif env["platform"] == "linux":
36-
env["target_path"] += "linux/"
37-
3823
elif env["platform"] == "windows":
39-
env["target_path"] += "win64/"
40-
4124
env.Append(LIBS=["advapi32", "winhttp", "rpcrt4", "crypt32",
4225
"ole32", "user32", "wsock32", "ws2_32", "bcrypt"])
4326

release.sh

100644100755
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@
55
echo "Enter the new version number (e.g. 1.2.1):"
66
read version
77

8-
echo "Enter the Windows x64 release ZIP URL:"
9-
read windowsZIPURL
8+
echo "Enter the Windows x64 release ZIP artifact ID or URL:"
9+
read windowsArtifactID
1010

11-
echo "Enter the Linux x64 release ZIP URL:"
12-
read linuxZIPURL
11+
echo "Enter the Linux x64 release ZIP artifact ID or URL:"
12+
read linuxArtifactID
1313

14-
echo "Enter the MacOS universal release ZIP URL:"
15-
read macZIPURL
14+
echo "Enter the MacOS universal release ZIP artifact ID or URL:"
15+
read macArtifactID
1616

1717
# 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
18-
windowsZIPURL=${windowsZIPURL/github.com/nightly.link}
19-
linuxZIPURL=${linuxZIPURL/github.com/nightly.link}
20-
macZIPURL=${macZIPURL/github.com/nightly.link}
18+
# The ${foo##*/} syntax extracts the string after the last '/' in case it's a full artifact URL.
19+
baseURL=https://nightly.link/godotengine/godot-git-plugin/actions/artifacts/
20+
windowsZIPURL=${baseURL}${windowsArtifactID##*/}.zip
21+
linuxZIPURL=${baseURL}${linuxArtifactID##*/}.zip
22+
macZIPURL=${baseURL}${macArtifactID##*/}.zip
2123

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

46-
zip -r $releasePath.zip $addonsPath
48+
zip -r $releasePath.zip $addonsPath
4749

4850
rm -rf $releasePath
4951
rm -rf windows

0 commit comments

Comments
 (0)