Skip to content

Commit 8f57887

Browse files
committed
Merge branch 'feature/bump-2021' into feature/bump-2021-feat/RNSM-dogfooding
* feature/bump-2021: MTT-3022 removing QoS until we have a version that works and compiles for iOS cleanup adding git lfs support something didn't work, reverting file Adding project id detection initial pass at hooks
2 parents f53d905 + 644c8ae commit 8f57887

File tree

6 files changed

+41
-11
lines changed

6 files changed

+41
-11
lines changed

Packages/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"com.unity.textmeshpro": "3.0.6",
2121
"com.unity.timeline": "1.6.4",
2222
"com.unity.toolchain.macos-x86_64-linux-x86_64": "1.0.0",
23-
"com.unity.ucg.qos": "0.3.1-preview.2",
2423
"com.unity.ugui": "1.0.0",
2524
"com.veriorpies.parrelsync": "https://github.com/VeriorPies/ParrelSync.git?path=/ParrelSync#bb3d5067e49e403d8b8ba15c036d313b4dd2c696",
2625
"com.unity.modules.ai": "1.0.0",

Packages/packages-lock.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -347,16 +347,6 @@
347347
},
348348
"url": "https://packages.unity.com"
349349
},
350-
"com.unity.ucg.qos": {
351-
"version": "0.3.1-preview.2",
352-
"depth": 0,
353-
"source": "registry",
354-
"dependencies": {
355-
"com.unity.collections": "0.9.0-preview.6",
356-
"com.unity.modules.unitywebrequest": "1.0.0"
357-
},
358-
"url": "https://packages.unity.com"
359-
},
360350
"com.unity.ugui": {
361351
"version": "1.0.0",
362352
"depth": 0,

RepoUtilities/InstallHooks.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
echo "starting"
2+
xcopy pre-commit.toInstall ../.git/hooks/pre-commit
3+
echo "checking if python is installed, if the following errors out, please install python3"
4+
python3 -c "print('done installing')"

RepoUtilities/InstallHooks.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
echo "starting"
2+
cp pre-commit.toInstall ../.git/hooks/pre-commit
3+
chmod +x ../.git/hooks/pre-commit
4+
echo "checking if python is installed, if the following errors out, please install python3"
5+
6+
python3 -c "print('done installing')"

RepoUtilities/pre-commit.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import json
2+
import sys
3+
import os
4+
import re
5+
6+
def FailCommit(reason):
7+
print("Oh no! Bad commit! "+reason)
8+
sys.exit(1)
9+
10+
def GetStagedFileContent(filePath):
11+
cmd = 'git show :' + filePath
12+
stream = os.popen(cmd)
13+
return stream.read()
14+
15+
def GetLFSStagedFileContent(filePath):
16+
cmd = f"git cat-file blob :{filePath} | git lfs smudge"
17+
stream = os.popen(cmd)
18+
return stream.read()
19+
20+
output = GetStagedFileContent('Packages/manifest.json')
21+
packages = json.loads(output)['dependencies']
22+
if ('com.unity.multiplayer.virtualprojects' in packages):
23+
FailCommit("Virtual projects in packages")
24+
if ('github' in packages['com.unity.multiplayer.tools'].lower()):
25+
FailCommit("Tools using github package")
26+
27+
content = GetLFSStagedFileContent('ProjectSettings/ProjectSettings.asset')
28+
res = re.search(r'.*cloudProjectId:.*\w+\s*\n', content) != None
29+
if res:
30+
FailCommit("Detected cloud project id in project settings")

RepoUtilities/pre-commit.toInstall

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python3 RepoUtilities/pre-commit.py

0 commit comments

Comments
 (0)