mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Remove engine BuildChecker.
It apparently has been broken for over a year and I trust anybody working on the engine to be smart enough to not need it.
This commit is contained in:
1
BuildChecker/.gitignore
vendored
1
BuildChecker/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
INSTALLED_HOOKS_VERSION
|
||||
@@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This is a dummy .csproj file to check things like submodules.
|
||||
Better this than other errors.
|
||||
|
||||
If you want to create this kind of file yourself, you have to create an empty .NET application,
|
||||
Then strip it of everything until you have the <Project> tags.
|
||||
VS refuses to load the project if you make a bare project file and use Add -> Existing Project... for some reason.
|
||||
|
||||
You want to handle the Build, Clean and Rebuild tasks to prevent missing task errors on build.
|
||||
|
||||
If you want to learn more about these kinds of things, check out Microsoft's official documentation about MSBuild:
|
||||
https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild
|
||||
-->
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Choose>
|
||||
<When Condition="'$(Python)' == ''">
|
||||
<PropertyGroup>
|
||||
<Python>python3</Python>
|
||||
<Python Condition="'$(OS)'=='Windows_NT' Or '$(OS)'=='Windows'">py -3</Python>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
</Choose>
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{D0DA124B-5580-4345-A02B-9F051F78915F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFrameworkMoniker>.NETFramework, Version=v4.6.1</TargetFrameworkMoniker>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<Target Name="Build">
|
||||
<Exec Command="$(Python) git_helper.py" CustomErrorRegularExpression="^Error" />
|
||||
</Target>
|
||||
<Target Name="Rebuild" DependsOnTargets="Build" />
|
||||
<Target Name="Clean">
|
||||
<Message Importance="low" Text="Ignoring 'Clean' target." />
|
||||
</Target>
|
||||
<Target Name="Compile" />
|
||||
<Target Name="CoreCompile" />
|
||||
</Project>
|
||||
@@ -1,105 +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
|
||||
|
||||
BUILD_CHECKER_PATH = Path(Path(__file__).resolve().parent)
|
||||
SS14_ROOT_PATH = Path(BUILD_CHECKER_PATH.parent)
|
||||
SOLUTION_PATH = Path(SS14_ROOT_PATH/"SpaceStation14.sln")
|
||||
CURRENT_HOOKS_VERSION = "2" # If this doesn't match the saved version we overwrite them all.
|
||||
QUIET = "--quiet" in sys.argv
|
||||
NO_HOOKS = "--nohooks" in sys.argv
|
||||
|
||||
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=str(SS14_ROOT_PATH), stdout=subprocess.PIPE)
|
||||
else:
|
||||
completed = subprocess.run(command, cwd=str(SS14_ROOT_PATH))
|
||||
|
||||
if completed.returncode != 0:
|
||||
raise RuntimeError("Error: command exited with code {}!".format(completed.returncode))
|
||||
|
||||
return completed
|
||||
|
||||
|
||||
def update_submodules():
|
||||
"""
|
||||
Updates all submodules.
|
||||
"""
|
||||
|
||||
status = run_command(["git", "submodule", "update", "--init", "--recursive"], capture=True)
|
||||
|
||||
if status.stdout.decode().strip():
|
||||
print("Git submodules changed. Reloading solution.")
|
||||
reset_solution()
|
||||
|
||||
def install_hooks():
|
||||
"""
|
||||
Installs the necessary git hooks into .git/hooks.
|
||||
"""
|
||||
|
||||
# Read version file.
|
||||
hooks_version_file = BUILD_CHECKER_PATH/"INSTALLED_HOOKS_VERSION"
|
||||
|
||||
if os.path.isfile(str(hooks_version_file)):
|
||||
with open(str(hooks_version_file), "r") as f:
|
||||
if f.read() == CURRENT_HOOKS_VERSION:
|
||||
if not QUIET:
|
||||
print("No hooks change detected.")
|
||||
return
|
||||
|
||||
with open(str(hooks_version_file), "w") as f:
|
||||
f.write(CURRENT_HOOKS_VERSION)
|
||||
|
||||
print("Hooks need updating.")
|
||||
|
||||
hooks_target_dir = SS14_ROOT_PATH/".git"/"hooks"
|
||||
hooks_source_dir = BUILD_CHECKER_PATH/"hooks"
|
||||
|
||||
if not os.path.exists(str(hooks_target_dir)):
|
||||
os.makedirs(str(hooks_target_dir))
|
||||
|
||||
# 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)
|
||||
|
||||
def main():
|
||||
if not NO_HOOKS:
|
||||
install_hooks()
|
||||
update_submodules()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
gitroot=`git rev-parse --show-toplevel`
|
||||
|
||||
cd "$gitroot/BuildChecker"
|
||||
|
||||
if [ -f "git_helper.py" ]
|
||||
then
|
||||
if [[ `uname` == MINGW* || `uname` == CYGWIN* ]]; then
|
||||
# Windows
|
||||
# Can't update hooks from here because we are a hook,
|
||||
# and the file is read only while it's used.
|
||||
# Thanks Windows.
|
||||
py -3 git_helper.py --quiet --nohooks
|
||||
else
|
||||
# Not Windows, so probably some other Unix thing.
|
||||
python3 git_helper.py --quiet
|
||||
fi
|
||||
fi
|
||||
@@ -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"
|
||||
41
RUN_THIS.py
41
RUN_THIS.py
@@ -1,41 +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 os
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
VERSION = sys.version_info
|
||||
NO_PROMPT = "--no-prompt" in sys.argv
|
||||
|
||||
sane_input = raw_input if VERSION.major < 3 else input
|
||||
|
||||
def main():
|
||||
if VERSION.major < 3 or (VERSION.major == 3 and VERSION.minor < 5):
|
||||
print("ERROR: You need at least Python 3.5 to build SS14.")
|
||||
# Need "press enter to exit" stuff because Windows just immediately closes conhost.
|
||||
if not NO_PROMPT:
|
||||
sane_input("Press enter to exit...")
|
||||
exit(1)
|
||||
|
||||
# Import git_helper by modifying the path.
|
||||
ss14_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.append(os.path.join(ss14_dir, "BuildChecker"))
|
||||
|
||||
try:
|
||||
import git_helper
|
||||
git_helper.main()
|
||||
|
||||
except Exception as e:
|
||||
print("ERROR:")
|
||||
traceback.print_exc()
|
||||
print("This was NOT intentional. If the error is not immediately obvious, ask on Discord or IRC for help.")
|
||||
if not NO_PROMPT:
|
||||
sane_input("Press enter to exit...")
|
||||
exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
if not NO_PROMPT:
|
||||
sane_input("Success! Press enter to exit...")
|
||||
@@ -11,10 +11,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Robust.Shared", "Robust.Sha
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Robust.UnitTesting", "Robust.UnitTesting\Robust.UnitTesting.csproj", "{F0ADA779-40B8-4F7E-BA6C-CDB19F3065D9}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildChecker", "BuildChecker\BuildChecker.csproj", "{D0DA124B-5580-4345-A02B-9F051F78915F}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{795D76AB-19B5-4682-B51F-6DB148024A0C}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Robust.Client", "Robust.Client\Robust.Client.csproj", "{83429BD6-6358-4B18-BE51-401DF8EA2673}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Robust.Shared.Maths", "Robust.Shared.Maths\Robust.Shared.Maths.csproj", "{93F23A82-00C5-4572-964E-E7C9457726D4}"
|
||||
@@ -49,10 +45,6 @@ Global
|
||||
{F0ADA779-40B8-4F7E-BA6C-CDB19F3065D9}.Debug|x64.Build.0 = Debug|x64
|
||||
{F0ADA779-40B8-4F7E-BA6C-CDB19F3065D9}.Release|x64.ActiveCfg = Release|x64
|
||||
{F0ADA779-40B8-4F7E-BA6C-CDB19F3065D9}.Release|x64.Build.0 = Release|x64
|
||||
{D0DA124B-5580-4345-A02B-9F051F78915F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D0DA124B-5580-4345-A02B-9F051F78915F}.Debug|x64.Build.0 = Debug|x64
|
||||
{D0DA124B-5580-4345-A02B-9F051F78915F}.Release|x64.ActiveCfg = Release|x64
|
||||
{D0DA124B-5580-4345-A02B-9F051F78915F}.Release|x64.Build.0 = Release|x64
|
||||
{83429BD6-6358-4B18-BE51-401DF8EA2673}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{83429BD6-6358-4B18-BE51-401DF8EA2673}.Debug|x64.Build.0 = Debug|x64
|
||||
{83429BD6-6358-4B18-BE51-401DF8EA2673}.Release|x64.ActiveCfg = Release|x64
|
||||
@@ -78,7 +70,6 @@ Global
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{D0DA124B-5580-4345-A02B-9F051F78915F} = {795D76AB-19B5-4682-B51F-6DB148024A0C}
|
||||
{ECBCE1D8-05C2-4881-9446-197C4C8E1C14} = {9143C8DD-A989-4089-9149-C50D12189FE4}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
|
||||
Reference in New Issue
Block a user