forked from ParadiseSS13/Paradise
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates tools to include mapmerge hooks and merge drivers, plus more (P…
…aradiseSS13#18034) * bumps tools to modern versions, adds DMM merge driver hooks for automatic map merging * mapping guidelines update * Update .github/CONTRIBUTING.md Co-authored-by: AffectedArc07 <[email protected]> * aa review * these somehow got ignored? force adding * Apply suggestions from code review Co-authored-by: AffectedArc07 <[email protected]>
- Loading branch information
1 parent
727b299
commit 4f5c337
Showing
53 changed files
with
1,088 additions
and
2,464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo off | ||
call "%~dp0\..\bootstrap\python" -m UpdatePaths %* | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
HOW TO USE: | ||
Drag one of the scripts in the “Scripts” folder onto the .bat file “Update_Paths” to open it with the .bat file. Let the script run. | ||
|
||
Use this tool before using mapmerge or opening the map in an editor. | ||
|
||
IMPORTANT: | ||
Please tie the script you are making to the associated PR on github and put it in the scripts folder when you are done. | ||
|
||
For example: 17980_rust_converter ties into https://github.com/ParadiseSS13/Paradise/pull/17980 | ||
|
||
HOW TO MAKE A SCRIPT: | ||
This tool updates paths in the game to new paths. For instance: | ||
If you have a path labeled | ||
|
||
/obj/structure/door/airlock/science/closed/rd | ||
|
||
and wanted it to be | ||
|
||
/obj/structure/door/airlock/science/rd/closed | ||
|
||
This tool would update it for you! This is extremely helpful if you want to be nice to people who have to resolve merge conflicts from the PRs that you make updating these areas. | ||
|
||
How do you do it? | ||
Simply open a notepad and type this on a line: | ||
|
||
/obj/structure/door/airlock/science/closed/rd : /obj/structure/door/airlock/science/rd/closed | ||
|
||
The path on the left is the old, the path on the right is the new. It is seperated by a ":" | ||
If you want to make multiple path changes in one script, simply add more changes on new lines. | ||
|
||
If you get lost, look at other scripts for examples. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
#!/bin/sh | ||
# bootstrap/python | ||
# | ||
# Python-finding script for all `sh` environments, including Linux, MSYS2, | ||
# Git for Windows, and GitHub Desktop. Invokable from CLI or automation. | ||
# | ||
# If a python.exe installed by `python_.ps1` is present, it will be used. | ||
# Otherwise, this script requires a system `python3` and `pip` to be provided, | ||
# and will create a standard virtualenv in which to install `requirements.txt`. | ||
set -e | ||
|
||
# Convenience variables | ||
Bootstrap="$(dirname "$0")" | ||
Sdk="$(dirname "$Bootstrap")" | ||
Cache="$Bootstrap/.cache" | ||
if [ "$TG_BOOTSTRAP_CACHE" ]; then | ||
Cache="$TG_BOOTSTRAP_CACHE" | ||
fi | ||
OldPWD="$PWD" | ||
cd "$Bootstrap/../.." | ||
. ./_build_dependencies.sh # sets PYTHON_VERSION | ||
cd "$OldPWD" | ||
PythonVersion="$PYTHON_VERSION" | ||
PythonDir="$Cache/python-$PythonVersion" | ||
PythonExe="$PythonDir/python.exe" | ||
Log="$Cache/last-command.log" | ||
|
||
# If a portable Python for Windows is not present, search on $PATH. | ||
if [ "$(uname)" = "Linux" ] || [ ! -f "$PythonExe" ]; then | ||
# Strip the "App Execution Aliases" from $PATH. Even if the user installed | ||
# Python using the Windows Store on purpose, these aliases always generate | ||
# "Permission denied" errors when sh.exe tries to invoke them. | ||
PATH=$(echo "$PATH" | tr ":" "\n" | grep -v "AppData/Local/Microsoft/WindowsApps" | tr "\n" ":") | ||
|
||
# Try to find a Python executable. | ||
if command -v python3 >/dev/null 2>&1; then | ||
PythonExe=python3 | ||
elif command -v python >/dev/null 2>&1; then | ||
PythonExe=python | ||
elif command -v py >/dev/null 2>&1; then | ||
PythonExe="py -3" | ||
else | ||
echo | ||
if command -v apt-get >/dev/null 2>&1; then | ||
echo "Please install Python using your system's package manager:" | ||
echo " sudo apt-get install python3 python3-pip" | ||
elif [ "$(uname -o)" = "Msys" ]; then | ||
echo "Please run tools/bootstrap/python.bat instead of tools/bootstrap/python once to" | ||
echo "install Python automatically, or install it from https://www.python.org/downloads/" | ||
# TODO: give MSYS pacman advice? | ||
elif command -v pacman >/dev/null 2>&1; then | ||
echo "Please install Python using your system's package manager:" | ||
echo " sudo pacman -S python python-pip" | ||
else | ||
echo "Please install Python from https://www.python.org/downloads/ or using your system's package manager." | ||
fi | ||
echo | ||
exit 1 | ||
fi | ||
|
||
# Create a venv and activate it | ||
PythonDir="$Cache/venv" | ||
if [ ! -d "$PythonDir" ]; then | ||
echo "Creating virtualenv..." | ||
"$PythonExe" -m venv "$PythonDir" | ||
fi | ||
if [ -f "$PythonDir/bin/python" ]; then | ||
PythonExe="$PythonDir/bin/python" | ||
elif [ -f "$PythonDir/scripts/python3.exe" ]; then | ||
PythonExe="$PythonDir/scripts/python3.exe"; | ||
else | ||
echo "bootstrap/python failed to find the python executable inside its virtualenv" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
# Use pip to install our requirements | ||
if [ ! -f "$PythonDir/requirements.txt" ] || [ "$(b2sum < "$Sdk/requirements.txt")" != "$(b2sum < "$PythonDir/requirements.txt")" ]; then | ||
echo "Updating dependencies..." | ||
"$PythonExe" -m pip install -U wheel | ||
"$PythonExe" -m pip install -U pip -r "$Sdk/requirements.txt" | ||
cp "$Sdk/requirements.txt" "$PythonDir/requirements.txt" | ||
echo "---" | ||
fi | ||
|
||
# Verify version and deduce the path separator | ||
PythonMajor=${PythonVersion%%.*} | ||
PythonMinor=${PythonVersion#*.} | ||
PythonMinor=${PythonMinor%.*} | ||
PATHSEP=$("$PythonExe" - "$PythonMajor" "$PythonMinor" <<'EOF' | ||
import sys, os | ||
if sys.version_info.major != int(sys.argv[1]) or sys.version_info.minor < int(sys.argv[2]): | ||
print("Error: Python ", sys.argv[1], ".", sys.argv[2], " or later is required, but you have:\n", sys.version, sep="", file=sys.stderr) | ||
exit(1) | ||
print(os.pathsep) | ||
EOF | ||
) | ||
|
||
# Cheap shell function if tee.exe is not available | ||
if ! command -v tee >/dev/null 2>&1; then | ||
tee() { | ||
# Fudge: assume $1 is always "-a" | ||
while read -r line; do | ||
echo "$line" >> "$2" | ||
echo "$line" | ||
done | ||
} | ||
fi | ||
|
||
# Invoke python with all command-line arguments | ||
export PYTHONPATH="$Sdk$PATHSEP${PYTHONPATH:-}" | ||
mkdir -p "$Cache" | ||
printf '%s\n' "$PythonExe" "$@" > "$Log" | ||
printf -- '---\n' >> "$Log" | ||
exec 4>&1 | ||
exitstatus=$({ { set +e; "$PythonExe" -u "$@" 2>&1 3>&-; printf %s $? >&3; } 4>&- | tee -a "$Log" 1>&4; } 3>&1) | ||
exec 4>&- | ||
exit "$exitstatus" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@echo off | ||
call powershell.exe -NoLogo -ExecutionPolicy Bypass -File "%~dp0\python_.ps1" %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
python37.zip | ||
. | ||
..\..\.. | ||
|
||
import site |
Oops, something went wrong.