From 2c3496b266d0848e34b7bd42da691aea35056f1d Mon Sep 17 00:00:00 2001 From: stellar-novas Date: Sun, 16 Jun 2024 18:49:20 -0400 Subject: [PATCH] Build doc cleanup (#470) # Description This pr streamlines the build process by removing the python3 dependency and pointing to the new build scripts. --- BuildChecker/BuildChecker.csproj | 4 +- BuildChecker/git_helper.py | 110 ------------------------------- BuildChecker/hooks/post-checkout | 13 ---- BuildChecker/hooks/post-merge | 5 -- LEGAL.md | 4 +- README.md | 27 ++++---- RUN_THIS.py | 13 ---- Scripts/bat/buildAllDebug.bat | 1 - Scripts/bat/buildAllRelease.bat | 1 - Scripts/bat/buildAllTools.bat | 1 - Scripts/sh/buildAllDebug.sh | 1 - Scripts/sh/buildAllRelease.sh | 1 - Scripts/sh/buildAllTools.sh | 1 - shell.nix | 1 - 14 files changed, 15 insertions(+), 168 deletions(-) delete mode 100644 BuildChecker/git_helper.py delete mode 100755 BuildChecker/hooks/post-checkout delete mode 100755 BuildChecker/hooks/post-merge delete mode 100755 RUN_THIS.py diff --git a/BuildChecker/BuildChecker.csproj b/BuildChecker/BuildChecker.csproj index 63d16fa9708..d4f9a412549 100644 --- a/BuildChecker/BuildChecker.csproj +++ b/BuildChecker/BuildChecker.csproj @@ -14,8 +14,6 @@ https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild --> - python3 - py -3 {C899FCA4-7037-4E49-ABC2-44DE72487110} .NETFramework, Version=v4.7.2 false @@ -39,7 +37,7 @@ https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild bin\DebugOpt\ - + diff --git a/BuildChecker/git_helper.py b/BuildChecker/git_helper.py deleted file mode 100644 index becd4506e82..00000000000 --- a/BuildChecker/git_helper.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python3 -# Installs git hooks, updates them, updates submodules, that kind of thing. - -import subprocess -import sys -import os -import shutil -from pathlib import Path -from typing import List - -SOLUTION_PATH = Path("..") / "SpaceStation14.sln" -# If this doesn't match the saved version we overwrite them all. -CURRENT_HOOKS_VERSION = "2" -QUIET = len(sys.argv) == 2 and sys.argv[1] == "--quiet" - - -def run_command(command: List[str], capture: bool = False) -> subprocess.CompletedProcess: - """ - Runs a command with pretty output. - """ - text = ' '.join(command) - if not QUIET: - print("$ {}".format(text)) - - sys.stdout.flush() - - completed = None - - if capture: - completed = subprocess.run(command, cwd="..", stdout=subprocess.PIPE) - else: - completed = subprocess.run(command, cwd="..") - - if completed.returncode != 0: - print("Error: command exited with code {}!".format(completed.returncode)) - - return completed - - -def update_submodules(): - """ - Updates all submodules. - """ - - if ('GITHUB_ACTIONS' in os.environ): - return - - if os.path.isfile("DISABLE_SUBMODULE_AUTOUPDATE"): - return - - if shutil.which("git") is None: - raise FileNotFoundError("git not found in PATH") - - # If the status doesn't match, force VS to reload the solution. - # status = run_command(["git", "submodule", "status"], capture=True) - run_command(["git", "submodule", "update", "--init", "--recursive"]) - # status2 = run_command(["git", "submodule", "status"], capture=True) - - # Something changed. - # if status.stdout != status2.stdout: - # print("Git submodules changed. Reloading solution.") - # reset_solution() - - -def install_hooks(): - """ - Installs the necessary git hooks into .git/hooks. - """ - - # Read version file. - if os.path.isfile("INSTALLED_HOOKS_VERSION"): - with open("INSTALLED_HOOKS_VERSION", "r") as f: - if f.read() == CURRENT_HOOKS_VERSION: - if not QUIET: - print("No hooks change detected.") - return - - with open("INSTALLED_HOOKS_VERSION", "w") as f: - f.write(CURRENT_HOOKS_VERSION) - - print("Hooks need updating.") - - hooks_target_dir = Path("..")/".git"/"hooks" - hooks_source_dir = Path("hooks") - - # Clear entire tree since we need to kill deleted files too. - for filename in os.listdir(str(hooks_target_dir)): - os.remove(str(hooks_target_dir/filename)) - - for filename in os.listdir(str(hooks_source_dir)): - print("Copying hook {}".format(filename)) - shutil.copy2(str(hooks_source_dir/filename), - str(hooks_target_dir/filename)) - - -def reset_solution(): - """ - Force VS to think the solution has been changed to prompt the user to reload it, thus fixing any load errors. - """ - - with SOLUTION_PATH.open("r") as f: - content = f.read() - - with SOLUTION_PATH.open("w") as f: - f.write(content) - - -if __name__ == '__main__': - install_hooks() - update_submodules() diff --git a/BuildChecker/hooks/post-checkout b/BuildChecker/hooks/post-checkout deleted file mode 100755 index c5662445c27..00000000000 --- a/BuildChecker/hooks/post-checkout +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -gitroot=`git rev-parse --show-toplevel` - -cd "$gitroot/BuildChecker" - -if [[ `uname` == MINGW* || `uname` == CYGWIN* ]]; then - # Windows - py -3 git_helper.py --quiet -else - # Not Windows, so probably some other Unix thing. - python3 git_helper.py --quiet -fi diff --git a/BuildChecker/hooks/post-merge b/BuildChecker/hooks/post-merge deleted file mode 100755 index 85fe61d966c..00000000000 --- a/BuildChecker/hooks/post-merge +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# Just call post-checkout since it does the same thing. -gitroot=`git rev-parse --show-toplevel` -bash "$gitroot/.git/hooks/post-checkout" diff --git a/LEGAL.md b/LEGAL.md index 2df3c39add1..34cd4009d53 100644 --- a/LEGAL.md +++ b/LEGAL.md @@ -6,9 +6,9 @@ The Authors retain all copyright to their respective work submitted here. ## Code license -Content contributed to this repository after commit 87c70a89a67d0521a56388e6b1c3f2cb947943e4 is licensed under the GNU Affero General Public License version 3.0 unless otherwise stated. See [LICENSE-AGPLv3](https://github.com/Simple-Station/Einstein-Engines/blob/master/LICENSE-AGPLv3.txt). +Content contributed to this repository after commit 87c70a89a67d0521a56388e6b1c3f2cb947943e4 is licensed under the GNU Affero General Public License version 3.0 unless otherwise stated. See [LICENSE-AGPLv3](./LICENSE-AGPLv3.txt). -Content contributed to this repository before commit 87c70a89a67d0521a56388e6b1c3f2cb947943e4 is licensed under the MIT license unless otherwise stated. See [LICENSE-MIT](https://github.com/Simple-Station/Einstein-Engines/blob/master/LICENSE-MIT.txt). +Content contributed to this repository before commit 87c70a89a67d0521a56388e6b1c3f2cb947943e4 is licensed under the MIT license unless otherwise stated. See [LICENSE-MIT](./LICENSE-MIT.txt). [87c70a89a67d0521a56388e6b1c3f2cb947943e4](https://github.com/Simple-Station/Einstein-Engines/commit/87c70a89a67d0521a56388e6b1c3f2cb947943e4) was pushed on February 17th 2024 at 21:48 UTC diff --git a/README.md b/README.md index 3dbe1910e29..f102318611f 100644 --- a/README.md +++ b/README.md @@ -41,27 +41,24 @@ We provide some scripts shown below to make the job easier. ### Build dependencies > - Git -> - DOTNET SDK 7.0 or higher -> - python 3.7 or higher +> - .NET SDK 8.0.100 ### Windows > 1. Clone this repository -> 2. Run `RUN_THIS.py` to init submodules and download the engine, or run `git submodule update --init --recursive` in a terminal -> 3. Run the `Scripts/bat/run1buildDebug.bat` -> 4. Run the `Scripts/bat/run2configDev.bat` if you need other configurations run other config scripts -> 5. Run both the `Scripts/bat/run3server.bat` and `Scripts/bat/run4client.bat` -> 6. Connect to localhost and play +> 2. Run `git submodule update --init --recursive` in a terminal to download the engine +> 3. Run `Scripts/bat/buildAllDebug.bat` after making any changes to the source +> 4. Run `Scripts/bat/runQuickAll.bat` to launch the client and the server +> 5. Connect to localhost in the client and play ### Linux > 1. Clone this repository -> 2. Run `RUN_THIS.py` to init submodules and download the engine, or run `git submodule update --init --recursive` in a terminal -> 3. Run the `Scripts/sh/run1buildDebug.sh` -> 4. Run the `Scripts/sh/run2configDev.sh` if you need other configurations run other config scripts -> 5. Run both the `Scripts/sh/run3server.bat` and `scripts/sh/run4client.sh` -> 6. Connect to localhost and play +> 2. Run `git submodule update --init --recursive` in a terminal to download the engine +> 3. Run `Scripts/bat/buildAllDebug.sh` after making any changes to the source +> 4. Run `Scripts/bat/runQuickAll.sh` to launch the client and the server +> 5. Connect to localhost in the client and play ### MacOS @@ -70,12 +67,12 @@ We provide some scripts shown below to make the job easier. ## License Content contributed to this repository after commit 87c70a89a67d0521a56388e6b1c3f2cb947943e4 (`17 February 2024 23:00:00 UTC`) is licensed under the GNU Affero General Public License version 3.0 unless otherwise stated. -See [LICENSE-AGPLv3](https://github.com/Simple-Station/Einstein-Engines/blob/master/LICENSE-AGPLv3.txt). +See [LICENSE-AGPLv3](./LICENSE-AGPLv3.txt). Content contributed to this repository before commit 87c70a89a67d0521a56388e6b1c3f2cb947943e4 (`17 February 2024 23:00:00 UTC`) is licensed under the MIT license unless otherwise stated. -See [LICENSE-MIT](https://github.com/Simple-Station/Einstein-Engines/blob/master/LICENSE-MIT.txt). +See [LICENSE-MIT](./LICENSE-MIT.txt). Most assets are licensed under [CC-BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/) unless stated otherwise. Assets have their license and the copyright in the metadata file. -[Example](https://github.com/Simple-Station/Einstein-Engines/blob/master/Resources/Textures/Objects/Tools/crowbar.rsi/meta.json). +[Example](./Resources/Textures/Objects/Tools/crowbar.rsi/meta.json). Note that some assets are licensed under the non-commercial [CC-BY-NC-SA 3.0](https://creativecommons.org/licenses/by-nc-sa/3.0/) or similar non-commercial licenses and will need to be removed if you wish to use this project commercially. diff --git a/RUN_THIS.py b/RUN_THIS.py deleted file mode 100755 index 6ea9f8e707d..00000000000 --- a/RUN_THIS.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python3 - -# Import future so people on py2 still get the clear error that they need to upgrade. -from __future__ import print_function -import sys -import subprocess - -version = sys.version_info -if version.major < 3 or (version.major == 3 and version.minor < 5): - print("ERROR: You need at least Python 3.5 to build SS14.") - sys.exit(1) - -subprocess.run([sys.executable, "git_helper.py"], cwd="BuildChecker") diff --git a/Scripts/bat/buildAllDebug.bat b/Scripts/bat/buildAllDebug.bat index 5cf49521753..1e3cc5442e3 100755 --- a/Scripts/bat/buildAllDebug.bat +++ b/Scripts/bat/buildAllDebug.bat @@ -1,7 +1,6 @@ @echo off cd ../../ -call python RUN_THIS.py call git submodule update --init --recursive call dotnet build -c Debug diff --git a/Scripts/bat/buildAllRelease.bat b/Scripts/bat/buildAllRelease.bat index 6a8cbac6648..730b39d26e3 100755 --- a/Scripts/bat/buildAllRelease.bat +++ b/Scripts/bat/buildAllRelease.bat @@ -1,7 +1,6 @@ @echo off cd ../../ -call python RUN_THIS.py call git submodule update --init --recursive call dotnet build -c Release diff --git a/Scripts/bat/buildAllTools.bat b/Scripts/bat/buildAllTools.bat index 7c878cbabb5..37db01f459d 100755 --- a/Scripts/bat/buildAllTools.bat +++ b/Scripts/bat/buildAllTools.bat @@ -1,7 +1,6 @@ @echo off cd ../../ -call python RUN_THIS.py call git submodule update --init --recursive call dotnet build -c Tools diff --git a/Scripts/sh/buildAllDebug.sh b/Scripts/sh/buildAllDebug.sh index 1ee457ff2ae..1e62ef7742c 100755 --- a/Scripts/sh/buildAllDebug.sh +++ b/Scripts/sh/buildAllDebug.sh @@ -7,6 +7,5 @@ fi cd ../../ -python RUN_THIS.py git submodule update --init --recursive dotnet build -c Debug diff --git a/Scripts/sh/buildAllRelease.sh b/Scripts/sh/buildAllRelease.sh index b3749ac28d8..3cfb84b76c0 100755 --- a/Scripts/sh/buildAllRelease.sh +++ b/Scripts/sh/buildAllRelease.sh @@ -7,6 +7,5 @@ fi cd ../../ -python RUN_THIS.py git submodule update --init --recursive dotnet build -c Release diff --git a/Scripts/sh/buildAllTools.sh b/Scripts/sh/buildAllTools.sh index 14a68487afe..551db74fcb5 100755 --- a/Scripts/sh/buildAllTools.sh +++ b/Scripts/sh/buildAllTools.sh @@ -7,6 +7,5 @@ fi cd ../../ -python RUN_THIS.py git submodule update --init --recursive dotnet build -c Tools diff --git a/shell.nix b/shell.nix index e93db685da5..57d64e00718 100644 --- a/shell.nix +++ b/shell.nix @@ -41,7 +41,6 @@ let dbus at-spi2-core cups - python3 ]; in pkgs.mkShell { name = "space-station-14-devshell";