Minor stuff: (#58)

* Minor stuff:

* Making a file called DISABLE_SUBMODULE_AUTOUPDATE in BuildChecker/ makes it not always run git submodule update.
* Added .mypy_cache to .gitignore.
* Made default platforms x64 (from Any CPU).

* Make git hooks +x.
This commit is contained in:
Pieter-Jan Briers
2018-04-19 20:15:36 +02:00
committed by GitHub
parent ed411fa944
commit 41bda76980
9 changed files with 21 additions and 9 deletions

3
.gitignore vendored
View File

@@ -274,3 +274,6 @@ BuildFiles/Mac/Space Station 14.app/Contents/MacOS/GodotSharpTools.dll
BuildFiles/Mac/Space Station 14.app/Contents/MacOS/mscorlib.dll
BuildFiles/Mac/Space Station 14.app/Contents/MacOS/libmonosgen-2.0.dylib
BuildFiles/Windows/Godot/*
# Working on the tools scripts is getting annoying okay?
.mypy_cache/

View File

@@ -1 +1,2 @@
INSTALLED_HOOKS_VERSION
DISABLE_SUBMODULE_AUTOUPDATE

View File

@@ -9,9 +9,11 @@ from pathlib import Path
from typing import List
SOLUTION_PATH = Path("..") / "SpaceStation14Content.sln"
CURRENT_HOOKS_VERSION = "1" # If this doesn't match the saved version we overwrite them all.
# 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.
@@ -40,6 +42,9 @@ def update_submodules():
Updates all submodules.
"""
if os.path.isfile("DISABLE_SUBMODULE_AUTOUPDATE"):
return
# 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"])
@@ -50,6 +55,7 @@ def update_submodules():
# print("Git submodules changed. Reloading solution.")
# reset_solution()
def install_hooks():
"""
Installs the necessary git hooks into .git/hooks.
@@ -77,7 +83,8 @@ def install_hooks():
for filename in os.listdir(str(hooks_source_dir)):
print("Copying hook {}".format(filename))
shutil.copyfile(str(hooks_source_dir/filename), str(hooks_target_dir/filename))
shutil.copyfile(str(hooks_source_dir/filename),
str(hooks_target_dir/filename))
def reset_solution():
@@ -91,6 +98,7 @@ def reset_solution():
with SOLUTION_PATH.open("w") as f:
f.write(content)
if __name__ == '__main__':
install_hooks()
update_submodules()

0
BuildChecker/hooks/post-checkout Normal file → Executable file
View File

0
BuildChecker/hooks/post-merge Normal file → Executable file
View File

View File

@@ -3,7 +3,7 @@
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
<ProjectGuid>{A2E5F175-78AF-4DDD-8F97-E2D2552372ED}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>

View File

@@ -3,7 +3,7 @@
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
<ProjectGuid>{B38DBBD0-04C2-4D1A-84E2-B3446F6ADF2A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>

View File

@@ -3,7 +3,7 @@
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
<ProjectGuid>{26AEEBB3-DDE7-443A-9F43-7BC7F4ACF6B5}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>