unknown-cli 0.9.16__tar.gz → 0.9.18__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/PKG-INFO +1 -1
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/README.md +2 -2
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/setup.py +101 -101
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknown_cli.egg-info/PKG-INFO +1 -1
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknown_cli.egg-info/SOURCES.txt +0 -1
- unknown-cli-0.9.18/unknowncli/VERSION +1 -0
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknowncli/__init__.py +16 -16
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknowncli/commands/preflight.py +7 -4
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknowncli/data/.p4ignore.txt +152 -152
- unknown-cli-0.9.16/unknowncli/VERSION +0 -1
- unknown-cli-0.9.16/unknowncli/commands/xbox.py +0 -496
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/setup.cfg +0 -0
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknown_cli.egg-info/dependency_links.txt +0 -0
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknown_cli.egg-info/entry_points.txt +0 -0
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknown_cli.egg-info/requires.txt +0 -0
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknown_cli.egg-info/top_level.txt +0 -0
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknowncli/__main__.py +0 -0
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknowncli/commands/__init__.py +0 -0
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknowncli/commands/project.py +0 -0
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknowncli/commands/task.py +0 -0
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknowncli/commands/unreal.py +0 -0
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknowncli/set_registry_keys.py +0 -0
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknowncli/set_url_handler.py +0 -0
- {unknown-cli-0.9.16 → unknown-cli-0.9.18}/unknowncli/utils.py +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# Unknown CLI
|
|
2
|
-
|
|
1
|
+
# Unknown CLI
|
|
2
|
+
|
|
3
3
|
Internal tool
|
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
import os, sys
|
|
3
|
-
from setuptools import setup, find_packages, Command
|
|
4
|
-
|
|
5
|
-
if sys.version_info < (3, 8):
|
|
6
|
-
raise NotImplementedError("""This tool does not support Python versions older than 3.6""")
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
version_file = os.path.abspath(os.path.join("unknowncli", "VERSION"))
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def get_version():
|
|
13
|
-
with open(version_file) as f:
|
|
14
|
-
return f.readlines()[0].strip()
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class BumpCommand(Command):
|
|
18
|
-
description = "Version bump"
|
|
19
|
-
user_options = [("which=", None, "Specify which part of the version to bump")]
|
|
20
|
-
|
|
21
|
-
def initialize_options(self):
|
|
22
|
-
self.which = None
|
|
23
|
-
|
|
24
|
-
def finalize_options(self):
|
|
25
|
-
assert self.which in (None, "major", "minor", "patch"), "Invalid bump pragma"
|
|
26
|
-
|
|
27
|
-
def run(self):
|
|
28
|
-
bump_version(self.which)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def bump_version(which):
|
|
32
|
-
major, minor, patch = (0, 1, 0)
|
|
33
|
-
old_version = get_version()
|
|
34
|
-
major, minor, patch = old_version.split(".")
|
|
35
|
-
|
|
36
|
-
if which == "major":
|
|
37
|
-
major = int(major) + 1
|
|
38
|
-
minor = 0
|
|
39
|
-
patch = 0
|
|
40
|
-
elif which == "minor":
|
|
41
|
-
minor = int(minor) + 1
|
|
42
|
-
patch = 0
|
|
43
|
-
else:
|
|
44
|
-
patch = int(patch.split("-")[0]) + 1
|
|
45
|
-
|
|
46
|
-
new_version = "%s.%s.%s" % (major, minor, patch)
|
|
47
|
-
|
|
48
|
-
with open(version_file, "w") as f:
|
|
49
|
-
f.write(new_version)
|
|
50
|
-
print(f"Version has been bumped from {old_version} to {new_version}")
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
with open("README.md", "r") as fh:
|
|
54
|
-
long_description = fh.read()
|
|
55
|
-
|
|
56
|
-
version = get_version()
|
|
57
|
-
|
|
58
|
-
setup(
|
|
59
|
-
name="unknown-cli",
|
|
60
|
-
python_requires=">=3.6",
|
|
61
|
-
version=version,
|
|
62
|
-
license="MIT",
|
|
63
|
-
author="",
|
|
64
|
-
author_email="",
|
|
65
|
-
description="Unknown Commandline Tool",
|
|
66
|
-
long_description=long_description,
|
|
67
|
-
long_description_content_type="text/markdown",
|
|
68
|
-
url="",
|
|
69
|
-
packages=find_packages(exclude=["tests"]),
|
|
70
|
-
package_data={"": ["VERSION", "data/.p4ignore.txt"]},
|
|
71
|
-
install_requires=[
|
|
72
|
-
"typer",
|
|
73
|
-
"click",
|
|
74
|
-
"requests",
|
|
75
|
-
"boto3",
|
|
76
|
-
"psutil",
|
|
77
|
-
"jsonpath-rw",
|
|
78
|
-
"pyyaml",
|
|
79
|
-
"pyjwt",
|
|
80
|
-
"tabulate",
|
|
81
|
-
"colorama",
|
|
82
|
-
"shellingham",
|
|
83
|
-
"boto3",
|
|
84
|
-
"loguru",
|
|
85
|
-
"P4Python",
|
|
86
|
-
"rich",
|
|
87
|
-
"pyuac",
|
|
88
|
-
"pywin32"
|
|
89
|
-
],
|
|
90
|
-
extras_require={},
|
|
91
|
-
include_package_data=False,
|
|
92
|
-
classifiers=[
|
|
93
|
-
"Intended Audience :: Developers",
|
|
94
|
-
"License :: OSI Approved :: MIT License",
|
|
95
|
-
"Operating System :: OS Independent",
|
|
96
|
-
"Programming Language :: Python :: 3",
|
|
97
|
-
],
|
|
98
|
-
test_suite="tests",
|
|
99
|
-
cmdclass={"bump": BumpCommand},
|
|
100
|
-
entry_points={"console_scripts": ["unknown = unknowncli.__main__:app", "unk = unknowncli.__main__:app"]},
|
|
101
|
-
)
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
import os, sys
|
|
3
|
+
from setuptools import setup, find_packages, Command
|
|
4
|
+
|
|
5
|
+
if sys.version_info < (3, 8):
|
|
6
|
+
raise NotImplementedError("""This tool does not support Python versions older than 3.6""")
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
version_file = os.path.abspath(os.path.join("unknowncli", "VERSION"))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def get_version():
|
|
13
|
+
with open(version_file) as f:
|
|
14
|
+
return f.readlines()[0].strip()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class BumpCommand(Command):
|
|
18
|
+
description = "Version bump"
|
|
19
|
+
user_options = [("which=", None, "Specify which part of the version to bump")]
|
|
20
|
+
|
|
21
|
+
def initialize_options(self):
|
|
22
|
+
self.which = None
|
|
23
|
+
|
|
24
|
+
def finalize_options(self):
|
|
25
|
+
assert self.which in (None, "major", "minor", "patch"), "Invalid bump pragma"
|
|
26
|
+
|
|
27
|
+
def run(self):
|
|
28
|
+
bump_version(self.which)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def bump_version(which):
|
|
32
|
+
major, minor, patch = (0, 1, 0)
|
|
33
|
+
old_version = get_version()
|
|
34
|
+
major, minor, patch = old_version.split(".")
|
|
35
|
+
|
|
36
|
+
if which == "major":
|
|
37
|
+
major = int(major) + 1
|
|
38
|
+
minor = 0
|
|
39
|
+
patch = 0
|
|
40
|
+
elif which == "minor":
|
|
41
|
+
minor = int(minor) + 1
|
|
42
|
+
patch = 0
|
|
43
|
+
else:
|
|
44
|
+
patch = int(patch.split("-")[0]) + 1
|
|
45
|
+
|
|
46
|
+
new_version = "%s.%s.%s" % (major, minor, patch)
|
|
47
|
+
|
|
48
|
+
with open(version_file, "w") as f:
|
|
49
|
+
f.write(new_version)
|
|
50
|
+
print(f"Version has been bumped from {old_version} to {new_version}")
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
with open("README.md", "r") as fh:
|
|
54
|
+
long_description = fh.read()
|
|
55
|
+
|
|
56
|
+
version = get_version()
|
|
57
|
+
|
|
58
|
+
setup(
|
|
59
|
+
name="unknown-cli",
|
|
60
|
+
python_requires=">=3.6",
|
|
61
|
+
version=version,
|
|
62
|
+
license="MIT",
|
|
63
|
+
author="",
|
|
64
|
+
author_email="",
|
|
65
|
+
description="Unknown Commandline Tool",
|
|
66
|
+
long_description=long_description,
|
|
67
|
+
long_description_content_type="text/markdown",
|
|
68
|
+
url="",
|
|
69
|
+
packages=find_packages(exclude=["tests"]),
|
|
70
|
+
package_data={"": ["VERSION", "data/.p4ignore.txt"]},
|
|
71
|
+
install_requires=[
|
|
72
|
+
"typer",
|
|
73
|
+
"click",
|
|
74
|
+
"requests",
|
|
75
|
+
"boto3",
|
|
76
|
+
"psutil",
|
|
77
|
+
"jsonpath-rw",
|
|
78
|
+
"pyyaml",
|
|
79
|
+
"pyjwt",
|
|
80
|
+
"tabulate",
|
|
81
|
+
"colorama",
|
|
82
|
+
"shellingham",
|
|
83
|
+
"boto3",
|
|
84
|
+
"loguru",
|
|
85
|
+
"P4Python",
|
|
86
|
+
"rich",
|
|
87
|
+
"pyuac",
|
|
88
|
+
"pywin32"
|
|
89
|
+
],
|
|
90
|
+
extras_require={},
|
|
91
|
+
include_package_data=False,
|
|
92
|
+
classifiers=[
|
|
93
|
+
"Intended Audience :: Developers",
|
|
94
|
+
"License :: OSI Approved :: MIT License",
|
|
95
|
+
"Operating System :: OS Independent",
|
|
96
|
+
"Programming Language :: Python :: 3",
|
|
97
|
+
],
|
|
98
|
+
test_suite="tests",
|
|
99
|
+
cmdclass={"bump": BumpCommand},
|
|
100
|
+
entry_points={"console_scripts": ["unknown = unknowncli.__main__:app", "unk = unknowncli.__main__:app"]},
|
|
101
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.9.18
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import os
|
|
2
|
-
from typer import Typer, Context, Argument, Option, echo, secho, confirm
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def read_version():
|
|
6
|
-
directory = os.path.dirname(__file__)
|
|
7
|
-
with open(os.path.join(directory, "VERSION"), "r") as version_file:
|
|
8
|
-
version = version_file.readline().strip()
|
|
9
|
-
return version
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
__version__ = read_version()
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def get_version_string():
|
|
16
|
-
return f"unknown-cli/{__version__}"
|
|
1
|
+
import os
|
|
2
|
+
from typer import Typer, Context, Argument, Option, echo, secho, confirm
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def read_version():
|
|
6
|
+
directory = os.path.dirname(__file__)
|
|
7
|
+
with open(os.path.join(directory, "VERSION"), "r") as version_file:
|
|
8
|
+
version = version_file.readline().strip()
|
|
9
|
+
return version
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
__version__ = read_version()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def get_version_string():
|
|
16
|
+
return f"unknown-cli/{__version__}"
|
|
@@ -532,7 +532,7 @@ def get_script_path(script_file_name):
|
|
|
532
532
|
abort(f"Failed to find script '{script_file_name}', post for help on Slack!")
|
|
533
533
|
|
|
534
534
|
|
|
535
|
-
def get_shelve_preflight_build_id(shelve_changelist, type=PreflightType.FULL, stream="", find=False, print_output=True, abort_on_fail=True):
|
|
535
|
+
def get_shelve_preflight_build_id(shelve_changelist, type=PreflightType.FULL, stream="", find=False, print_output=True, abort_on_fail=True, submit_on_server=False):
|
|
536
536
|
cmd = [
|
|
537
537
|
sys.executable,
|
|
538
538
|
get_script_path("trigger_shelve_preflight.py"),
|
|
@@ -542,6 +542,8 @@ def get_shelve_preflight_build_id(shelve_changelist, type=PreflightType.FULL, st
|
|
|
542
542
|
["--find"] if find else ["--preflight_type", type]
|
|
543
543
|
) + (
|
|
544
544
|
["--shelve_stream", stream] if stream else []
|
|
545
|
+
) + (
|
|
546
|
+
["--submit_on_server"] if submit_on_server else []
|
|
545
547
|
)
|
|
546
548
|
build_id = ""
|
|
547
549
|
try:
|
|
@@ -797,7 +799,8 @@ def main(
|
|
|
797
799
|
changelist: str = Option("", help="The changelist you own and want to preflight."),
|
|
798
800
|
commit_on_success: Optional[bool] = Option(True, help="Commit the shelve on successful preflight."),
|
|
799
801
|
type: PreflightType = Option(PreflightType.QUICK, help="The type of preflight to run."),
|
|
800
|
-
p4v_config_type: P4VConfigType = Option(None, help="The command to use when running from P4V context menus.")
|
|
802
|
+
p4v_config_type: P4VConfigType = Option(None, help="The command to use when running from P4V context menus."),
|
|
803
|
+
use_server_submit: Optional[bool] = Option(False, help="If committing on successful preflight, should server side commit be used.")
|
|
801
804
|
):
|
|
802
805
|
"""
|
|
803
806
|
Preflight a changelist
|
|
@@ -862,7 +865,7 @@ def main(
|
|
|
862
865
|
else:
|
|
863
866
|
abort(f"No opened files or shelve to work with in changelist '{change_obj.change}'...")
|
|
864
867
|
build_id = get_shelve_preflight_build_id(
|
|
865
|
-
shelve_changelist, type=type, stream=get_client_stream(change_obj.client)
|
|
868
|
+
shelve_changelist, type=type, stream=get_client_stream(change_obj.client), submit_on_server=use_server_submit
|
|
866
869
|
)
|
|
867
870
|
|
|
868
871
|
wait_on_teamcity_build(build_id, shelve_changelist)
|
|
@@ -872,6 +875,6 @@ def main(
|
|
|
872
875
|
abort(f"Preflight failed ({get_build_status(build_json)})")
|
|
873
876
|
|
|
874
877
|
secho("Preflight finished successfully.", fg="green", bold=True)
|
|
875
|
-
if commit_on_success:
|
|
878
|
+
if commit_on_success and not use_server_submit:
|
|
876
879
|
commit(shelve_changelist)
|
|
877
880
|
return
|
|
@@ -1,152 +1,152 @@
|
|
|
1
|
-
# Here you can specify files to ignore when adding files to the depot.
|
|
2
|
-
#
|
|
3
|
-
# The syntax for P4IGNORE files is not the same as Perforce syntax.
|
|
4
|
-
# Instead, it is similar to that used by other versioning systems:
|
|
5
|
-
#
|
|
6
|
-
# - Files are specified in local syntax
|
|
7
|
-
# - a # character at the beginning of a line denotes a comment
|
|
8
|
-
# - a ! character at the beginning of a line excludes the file specification
|
|
9
|
-
# - a * wildcard matches substrings.
|
|
10
|
-
#
|
|
11
|
-
# http://stackoverflow.com/questions/18240084/how-does-perforce-ignore-file-syntax-differ-from-gitignore-syntax
|
|
12
|
-
|
|
13
|
-
/*.sln
|
|
14
|
-
/.p4sync.txt
|
|
15
|
-
|
|
16
|
-
# Ignore all Visual Studio temp files.
|
|
17
|
-
*.suo
|
|
18
|
-
*.opensdf
|
|
19
|
-
*.sdf
|
|
20
|
-
.patch_*
|
|
21
|
-
|
|
22
|
-
*/DerivedDataCache/
|
|
23
|
-
**/DerivedDataCache/Boot.ddc
|
|
24
|
-
**/DerivedDataCache/**/*.udd
|
|
25
|
-
|
|
26
|
-
# Ignore all Intermediate and Saved directories
|
|
27
|
-
*/Intermediate/*
|
|
28
|
-
*/Saved/*
|
|
29
|
-
|
|
30
|
-
# Ignore UBT's configuration.xml
|
|
31
|
-
Engine/Programs/UnrealBuildTool/*
|
|
32
|
-
*.uatbuildrecord
|
|
33
|
-
*.tmp
|
|
34
|
-
|
|
35
|
-
# Ignore built binaries and temporary build files
|
|
36
|
-
*/obj/*
|
|
37
|
-
*.csprojAssemblyReference.cache
|
|
38
|
-
|
|
39
|
-
# Ignore UBT's log output files
|
|
40
|
-
/Engine/Programs/UnrealBuildTool/*.txt
|
|
41
|
-
|
|
42
|
-
# Ignore Python cached files
|
|
43
|
-
*.pyc
|
|
44
|
-
|
|
45
|
-
# Ignore JetBrain's IDE folders
|
|
46
|
-
.idea/
|
|
47
|
-
.gradle/
|
|
48
|
-
|
|
49
|
-
# Ignore autogenerated files from HoloLens WMRInterop
|
|
50
|
-
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/packages/*
|
|
51
|
-
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/Generated Files/*
|
|
52
|
-
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/x64/*
|
|
53
|
-
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/ARM64/*
|
|
54
|
-
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInterop/x64/*
|
|
55
|
-
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInterop/ARM64/*
|
|
56
|
-
|
|
57
|
-
Saved/
|
|
58
|
-
LocalBuilds/
|
|
59
|
-
*.csproj.*
|
|
60
|
-
.vs/*
|
|
61
|
-
.vsconfig
|
|
62
|
-
*.pdb
|
|
63
|
-
*.suo
|
|
64
|
-
*.opensdf
|
|
65
|
-
*.sdf
|
|
66
|
-
*.tmp
|
|
67
|
-
*.mdb
|
|
68
|
-
obj/
|
|
69
|
-
*.vcxproj
|
|
70
|
-
*.sln
|
|
71
|
-
*-Debug.*
|
|
72
|
-
FileOpenOrder/
|
|
73
|
-
*.xcworkspace
|
|
74
|
-
*.xcodeproj
|
|
75
|
-
./Makefile
|
|
76
|
-
./CMakeLists.txt
|
|
77
|
-
.ue4dependencies
|
|
78
|
-
Samples/*
|
|
79
|
-
FeaturePacks/*
|
|
80
|
-
Templates/*
|
|
81
|
-
Engine/Documentation/*
|
|
82
|
-
|
|
83
|
-
# Engine intermediates
|
|
84
|
-
Engine/Intermediate/*
|
|
85
|
-
Intermediate/
|
|
86
|
-
|
|
87
|
-
# Intermediate folders for programs should not be checked in
|
|
88
|
-
Engine\Programs\*\Intermediate\*
|
|
89
|
-
|
|
90
|
-
# Intermediate folders created for various C# programs
|
|
91
|
-
Engine\Source\Programs\*\obj\*
|
|
92
|
-
|
|
93
|
-
# Saved folders for programs should not be checked in
|
|
94
|
-
Engine\Programs\*\Saved\*
|
|
95
|
-
Engine\Programs\UnrealBuildTool\*
|
|
96
|
-
|
|
97
|
-
# Derived data cache should never be checked in
|
|
98
|
-
Engine/DerivedDataCache/*
|
|
99
|
-
|
|
100
|
-
# Ignore any build receipts
|
|
101
|
-
Engine/Build/Receipts/*
|
|
102
|
-
|
|
103
|
-
# Ignore personal workspace vars
|
|
104
|
-
p4config.txt
|
|
105
|
-
|
|
106
|
-
# Ignore Unix backup files
|
|
107
|
-
*~
|
|
108
|
-
|
|
109
|
-
# Ignore Mac desktop services store files
|
|
110
|
-
.DS_Store
|
|
111
|
-
|
|
112
|
-
# Ignore crash reports
|
|
113
|
-
crashinfo--*
|
|
114
|
-
|
|
115
|
-
# Ignore linux project files
|
|
116
|
-
*.user
|
|
117
|
-
*.pro
|
|
118
|
-
*.pri
|
|
119
|
-
*.kdev4
|
|
120
|
-
|
|
121
|
-
# Obj-C/Swift specific
|
|
122
|
-
*.hmap
|
|
123
|
-
*.ipa
|
|
124
|
-
*.dSYM.zip
|
|
125
|
-
*.dSYM
|
|
126
|
-
|
|
127
|
-
# Ignore documentation generated for C# tools
|
|
128
|
-
Engine/Binaries/DotNET/UnrealBuildTool.xml
|
|
129
|
-
Engine/Binaries/DotNET/AutomationScripts/BuildGraph.Automation.xml
|
|
130
|
-
|
|
131
|
-
# Ignore version files in the Engine/Binaries directory created by UBT
|
|
132
|
-
/Engine/Binaries/**/*.version
|
|
133
|
-
|
|
134
|
-
# Ignore exp files in the the Engine/Binaries directory as they aren't C/C++ source files
|
|
135
|
-
/Engine/Binaries/**/*.exp
|
|
136
|
-
|
|
137
|
-
# Ignore Swarm local save files
|
|
138
|
-
Engine/Binaries/DotNET/SwarmAgent.DeveloperOptions.xml
|
|
139
|
-
Engine/Binaries/DotNET/SwarmAgent.Options.xml
|
|
140
|
-
|
|
141
|
-
# Intermediary Files
|
|
142
|
-
*.target.xml
|
|
143
|
-
*.exe.config
|
|
144
|
-
*.exe.manifest
|
|
145
|
-
|
|
146
|
-
# Ignore project-specific files
|
|
147
|
-
*/Build/Receipts/*
|
|
148
|
-
*/DerivedDataCache/*
|
|
149
|
-
*/Binaries/*-Shipping.*
|
|
150
|
-
*/Intermediate/*
|
|
151
|
-
|
|
152
|
-
*/Logs/*
|
|
1
|
+
# Here you can specify files to ignore when adding files to the depot.
|
|
2
|
+
#
|
|
3
|
+
# The syntax for P4IGNORE files is not the same as Perforce syntax.
|
|
4
|
+
# Instead, it is similar to that used by other versioning systems:
|
|
5
|
+
#
|
|
6
|
+
# - Files are specified in local syntax
|
|
7
|
+
# - a # character at the beginning of a line denotes a comment
|
|
8
|
+
# - a ! character at the beginning of a line excludes the file specification
|
|
9
|
+
# - a * wildcard matches substrings.
|
|
10
|
+
#
|
|
11
|
+
# http://stackoverflow.com/questions/18240084/how-does-perforce-ignore-file-syntax-differ-from-gitignore-syntax
|
|
12
|
+
|
|
13
|
+
/*.sln
|
|
14
|
+
/.p4sync.txt
|
|
15
|
+
|
|
16
|
+
# Ignore all Visual Studio temp files.
|
|
17
|
+
*.suo
|
|
18
|
+
*.opensdf
|
|
19
|
+
*.sdf
|
|
20
|
+
.patch_*
|
|
21
|
+
|
|
22
|
+
*/DerivedDataCache/
|
|
23
|
+
**/DerivedDataCache/Boot.ddc
|
|
24
|
+
**/DerivedDataCache/**/*.udd
|
|
25
|
+
|
|
26
|
+
# Ignore all Intermediate and Saved directories
|
|
27
|
+
*/Intermediate/*
|
|
28
|
+
*/Saved/*
|
|
29
|
+
|
|
30
|
+
# Ignore UBT's configuration.xml
|
|
31
|
+
Engine/Programs/UnrealBuildTool/*
|
|
32
|
+
*.uatbuildrecord
|
|
33
|
+
*.tmp
|
|
34
|
+
|
|
35
|
+
# Ignore built binaries and temporary build files
|
|
36
|
+
*/obj/*
|
|
37
|
+
*.csprojAssemblyReference.cache
|
|
38
|
+
|
|
39
|
+
# Ignore UBT's log output files
|
|
40
|
+
/Engine/Programs/UnrealBuildTool/*.txt
|
|
41
|
+
|
|
42
|
+
# Ignore Python cached files
|
|
43
|
+
*.pyc
|
|
44
|
+
|
|
45
|
+
# Ignore JetBrain's IDE folders
|
|
46
|
+
.idea/
|
|
47
|
+
.gradle/
|
|
48
|
+
|
|
49
|
+
# Ignore autogenerated files from HoloLens WMRInterop
|
|
50
|
+
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/packages/*
|
|
51
|
+
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/Generated Files/*
|
|
52
|
+
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/x64/*
|
|
53
|
+
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/ARM64/*
|
|
54
|
+
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInterop/x64/*
|
|
55
|
+
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInterop/ARM64/*
|
|
56
|
+
|
|
57
|
+
Saved/
|
|
58
|
+
LocalBuilds/
|
|
59
|
+
*.csproj.*
|
|
60
|
+
.vs/*
|
|
61
|
+
.vsconfig
|
|
62
|
+
*.pdb
|
|
63
|
+
*.suo
|
|
64
|
+
*.opensdf
|
|
65
|
+
*.sdf
|
|
66
|
+
*.tmp
|
|
67
|
+
*.mdb
|
|
68
|
+
obj/
|
|
69
|
+
*.vcxproj
|
|
70
|
+
*.sln
|
|
71
|
+
*-Debug.*
|
|
72
|
+
FileOpenOrder/
|
|
73
|
+
*.xcworkspace
|
|
74
|
+
*.xcodeproj
|
|
75
|
+
./Makefile
|
|
76
|
+
./CMakeLists.txt
|
|
77
|
+
.ue4dependencies
|
|
78
|
+
Samples/*
|
|
79
|
+
FeaturePacks/*
|
|
80
|
+
Templates/*
|
|
81
|
+
Engine/Documentation/*
|
|
82
|
+
|
|
83
|
+
# Engine intermediates
|
|
84
|
+
Engine/Intermediate/*
|
|
85
|
+
Intermediate/
|
|
86
|
+
|
|
87
|
+
# Intermediate folders for programs should not be checked in
|
|
88
|
+
Engine\Programs\*\Intermediate\*
|
|
89
|
+
|
|
90
|
+
# Intermediate folders created for various C# programs
|
|
91
|
+
Engine\Source\Programs\*\obj\*
|
|
92
|
+
|
|
93
|
+
# Saved folders for programs should not be checked in
|
|
94
|
+
Engine\Programs\*\Saved\*
|
|
95
|
+
Engine\Programs\UnrealBuildTool\*
|
|
96
|
+
|
|
97
|
+
# Derived data cache should never be checked in
|
|
98
|
+
Engine/DerivedDataCache/*
|
|
99
|
+
|
|
100
|
+
# Ignore any build receipts
|
|
101
|
+
Engine/Build/Receipts/*
|
|
102
|
+
|
|
103
|
+
# Ignore personal workspace vars
|
|
104
|
+
p4config.txt
|
|
105
|
+
|
|
106
|
+
# Ignore Unix backup files
|
|
107
|
+
*~
|
|
108
|
+
|
|
109
|
+
# Ignore Mac desktop services store files
|
|
110
|
+
.DS_Store
|
|
111
|
+
|
|
112
|
+
# Ignore crash reports
|
|
113
|
+
crashinfo--*
|
|
114
|
+
|
|
115
|
+
# Ignore linux project files
|
|
116
|
+
*.user
|
|
117
|
+
*.pro
|
|
118
|
+
*.pri
|
|
119
|
+
*.kdev4
|
|
120
|
+
|
|
121
|
+
# Obj-C/Swift specific
|
|
122
|
+
*.hmap
|
|
123
|
+
*.ipa
|
|
124
|
+
*.dSYM.zip
|
|
125
|
+
*.dSYM
|
|
126
|
+
|
|
127
|
+
# Ignore documentation generated for C# tools
|
|
128
|
+
Engine/Binaries/DotNET/UnrealBuildTool.xml
|
|
129
|
+
Engine/Binaries/DotNET/AutomationScripts/BuildGraph.Automation.xml
|
|
130
|
+
|
|
131
|
+
# Ignore version files in the Engine/Binaries directory created by UBT
|
|
132
|
+
/Engine/Binaries/**/*.version
|
|
133
|
+
|
|
134
|
+
# Ignore exp files in the the Engine/Binaries directory as they aren't C/C++ source files
|
|
135
|
+
/Engine/Binaries/**/*.exp
|
|
136
|
+
|
|
137
|
+
# Ignore Swarm local save files
|
|
138
|
+
Engine/Binaries/DotNET/SwarmAgent.DeveloperOptions.xml
|
|
139
|
+
Engine/Binaries/DotNET/SwarmAgent.Options.xml
|
|
140
|
+
|
|
141
|
+
# Intermediary Files
|
|
142
|
+
*.target.xml
|
|
143
|
+
*.exe.config
|
|
144
|
+
*.exe.manifest
|
|
145
|
+
|
|
146
|
+
# Ignore project-specific files
|
|
147
|
+
*/Build/Receipts/*
|
|
148
|
+
*/DerivedDataCache/*
|
|
149
|
+
*/Binaries/*-Shipping.*
|
|
150
|
+
*/Intermediate/*
|
|
151
|
+
|
|
152
|
+
*/Logs/*
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.9.16
|
|
@@ -1,496 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
import shutil
|
|
3
|
-
import time
|
|
4
|
-
import os
|
|
5
|
-
import socket
|
|
6
|
-
import getpass
|
|
7
|
-
from datetime import datetime, timedelta
|
|
8
|
-
from tabulate import tabulate
|
|
9
|
-
import click
|
|
10
|
-
from click import echo, secho
|
|
11
|
-
from pathlib import Path
|
|
12
|
-
from subprocess import call, Popen, PIPE
|
|
13
|
-
from pprint import pprint
|
|
14
|
-
import json
|
|
15
|
-
from collections import defaultdict
|
|
16
|
-
from dateutil.parser import parse
|
|
17
|
-
|
|
18
|
-
my_path = Path(__file__).parent
|
|
19
|
-
builds_file = my_path / "builds.json"
|
|
20
|
-
cached_builds = {}
|
|
21
|
-
xbapps_ensured = False
|
|
22
|
-
console_ip = None
|
|
23
|
-
temp_path = Path("c:/temp/xboxbuilds/")
|
|
24
|
-
temp_path.mkdir(parents=True, exist_ok=True)
|
|
25
|
-
|
|
26
|
-
def abort(msg):
|
|
27
|
-
secho(msg, fg="red")
|
|
28
|
-
sys.exit(1)
|
|
29
|
-
|
|
30
|
-
def get_timestamp_from_logline(l):
|
|
31
|
-
timestamp_string = l.split("]")[0][1:].split(":")[0]
|
|
32
|
-
try:
|
|
33
|
-
timestamp = datetime.strptime(timestamp_string, "%Y.%m.%d-%H.%M.%S")
|
|
34
|
-
except Exception as e:
|
|
35
|
-
return datetime.now()
|
|
36
|
-
return timestamp
|
|
37
|
-
|
|
38
|
-
def parse_changelists(changelists_string, config):
|
|
39
|
-
all_builds = collect_builds()
|
|
40
|
-
changelists = []
|
|
41
|
-
if "," in changelists_string:
|
|
42
|
-
changelists = changelists_string.split(",")
|
|
43
|
-
elif "-" in changelists_string:
|
|
44
|
-
lst = changelists_string.split("-")
|
|
45
|
-
lst.sort()
|
|
46
|
-
|
|
47
|
-
if len(lst) != 2:
|
|
48
|
-
abort("Changelist range must be in the form [from]-[to]")
|
|
49
|
-
first_changelist = int(lst[0])
|
|
50
|
-
last_changelist = int(lst[1] or "999999999")
|
|
51
|
-
for changelist, builds in all_builds.items():
|
|
52
|
-
found_build = None
|
|
53
|
-
if changelist >= first_changelist and changelist <= last_changelist:
|
|
54
|
-
for b in builds:
|
|
55
|
-
if b['configuration'].lower() == config.lower():
|
|
56
|
-
found_build = b
|
|
57
|
-
if found_build:
|
|
58
|
-
changelists.append(changelist)
|
|
59
|
-
else:
|
|
60
|
-
changelists = [int(changelists_string)]
|
|
61
|
-
for cl in changelists:
|
|
62
|
-
if cl not in all_builds:
|
|
63
|
-
abort(f"Changelist {cl} not found")
|
|
64
|
-
if not changelists:
|
|
65
|
-
abort(f"Did not find valid changeslists in '{changelists_string}' for config '{config}'")
|
|
66
|
-
return changelists
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
def collect_builds():
|
|
70
|
-
global cached_builds
|
|
71
|
-
if cached_builds:
|
|
72
|
-
return cached_builds
|
|
73
|
-
builds_path = Path("U:/SN2")
|
|
74
|
-
builds_by_changelist = defaultdict(list)
|
|
75
|
-
for f in builds_path.iterdir():
|
|
76
|
-
if "_MAIN_" not in str(f):
|
|
77
|
-
continue
|
|
78
|
-
n = f.name
|
|
79
|
-
lst = n.replace("CL-", "").split("_")
|
|
80
|
-
build_number = int(lst[0])
|
|
81
|
-
branch = lst[-2]
|
|
82
|
-
configuration = "Test" if "test" in n.lower() else "Development"
|
|
83
|
-
changelist = int(lst[-1])
|
|
84
|
-
builds_by_changelist[changelist].append((f.name, branch, configuration))
|
|
85
|
-
builds_by_changelist = dict(sorted(builds_by_changelist.items()))
|
|
86
|
-
#pprint(builds_by_changelist)
|
|
87
|
-
builds = get_builds()
|
|
88
|
-
if not builds:
|
|
89
|
-
secho("Running initial scan. This will take a while...", fg="yellow")
|
|
90
|
-
n = 0
|
|
91
|
-
for changelist, folders in builds_by_changelist.items():
|
|
92
|
-
if changelist in builds:
|
|
93
|
-
builds_by_changelist[changelist] = builds[changelist]
|
|
94
|
-
continue
|
|
95
|
-
if changelist not in builds:
|
|
96
|
-
builds[changelist] = []
|
|
97
|
-
|
|
98
|
-
for folder, branch, configuration in folders:
|
|
99
|
-
path = builds_path / folder
|
|
100
|
-
# U:\SN2\10147_TEST_MAIN_CL-53357\Publish\++project+sn2-main-ue\Subnautica2-CL-53353\XSX\Packages\Test
|
|
101
|
-
package_path = path / "Publish" / "++project+sn2-main-ue"
|
|
102
|
-
#print(package_path)
|
|
103
|
-
# / f"Subnautica2-CL-{changelist}" / "XSX\Packages" / "Test"
|
|
104
|
-
for f in package_path.glob("*/XSX/Packages/*/*.xvc"):
|
|
105
|
-
if f.is_file():
|
|
106
|
-
print(f"Found XBox build for {folder}")
|
|
107
|
-
build = {
|
|
108
|
-
"filename": f.name,
|
|
109
|
-
"path": f.as_posix(),
|
|
110
|
-
"configuration": configuration,
|
|
111
|
-
"branch": branch,
|
|
112
|
-
"size_mb": f.stat().st_size // 1024 // 1024,
|
|
113
|
-
"timestamp": datetime.fromtimestamp(f.stat().st_mtime).isoformat(),
|
|
114
|
-
}
|
|
115
|
-
builds[changelist].append(build)
|
|
116
|
-
n += 1
|
|
117
|
-
|
|
118
|
-
save_builds(builds)
|
|
119
|
-
cached_builds = builds
|
|
120
|
-
return builds
|
|
121
|
-
|
|
122
|
-
def get_loglines(num=None):
|
|
123
|
-
ensure_xbapps()
|
|
124
|
-
path = Path(f"//{console_ip}/SystemScratch/Logs/Subnautica2.log")
|
|
125
|
-
if not path.is_file():
|
|
126
|
-
abort(f"Path {path} not found")
|
|
127
|
-
with path.open() as f:
|
|
128
|
-
lines = f.readlines()
|
|
129
|
-
ret = []
|
|
130
|
-
if num:
|
|
131
|
-
lines = lines[-num:]
|
|
132
|
-
for l in lines:
|
|
133
|
-
ret.append(l.strip())
|
|
134
|
-
return ret
|
|
135
|
-
|
|
136
|
-
def ensure_xbapps():
|
|
137
|
-
global console_ip
|
|
138
|
-
if console_ip:
|
|
139
|
-
return
|
|
140
|
-
game_dk = os.environ.get("GAMEDK")
|
|
141
|
-
if not game_dk:
|
|
142
|
-
abort("XBox GDK Manager is not installed")
|
|
143
|
-
game_bin_path = Path(game_dk) / "bin"
|
|
144
|
-
xbapp = game_bin_path / "xbapp.exe"
|
|
145
|
-
xbconnect = game_bin_path / "xbconnect.exe"
|
|
146
|
-
if not xbapp.is_file() or not xbconnect.is_file():
|
|
147
|
-
abort("XBox GDK Manager is not installed")
|
|
148
|
-
p = Popen(f"{xbconnect} /q /b", stdout=PIPE, stderr=PIPE)
|
|
149
|
-
out, err = p.communicate()
|
|
150
|
-
if not not p.returncode:
|
|
151
|
-
abort("No XBox console found (1)")
|
|
152
|
-
|
|
153
|
-
console_ip = out.strip().decode()
|
|
154
|
-
if not console_ip.startswith("192."):
|
|
155
|
-
abort("No XBox console found (2)")
|
|
156
|
-
|
|
157
|
-
def xb(appname):
|
|
158
|
-
ensure_xbapps()
|
|
159
|
-
return Path(os.environ.get("GAMEDK")) / "bin" / appname
|
|
160
|
-
|
|
161
|
-
def get_builds():
|
|
162
|
-
try:
|
|
163
|
-
with open(builds_file) as f:
|
|
164
|
-
return {int(k): v for k, v in json.load(f).items()}
|
|
165
|
-
except Exception as e:
|
|
166
|
-
return {}
|
|
167
|
-
|
|
168
|
-
def save_builds(data):
|
|
169
|
-
with open(builds_file, "w") as f:
|
|
170
|
-
json.dump(data, f, indent=4)
|
|
171
|
-
|
|
172
|
-
def mount():
|
|
173
|
-
p = Path("U:")
|
|
174
|
-
if p.is_dir():
|
|
175
|
-
return
|
|
176
|
-
mountbat_filename = my_path.parent / "BatchFiles" / "MountBuildsFolder.bat"
|
|
177
|
-
cmd = ["net", "use", "U:", r"\\sn2-storage-int.metal.subnautica.net\storage /persistent:yes /user:install belabour-hull-calcutta"]
|
|
178
|
-
p = Popen(cmd, shell=True)
|
|
179
|
-
stdout, stderr = p.communicate()
|
|
180
|
-
|
|
181
|
-
@click.group()
|
|
182
|
-
@click.option('--debug/--no-debug', default=False)
|
|
183
|
-
@click.pass_context
|
|
184
|
-
def cli(ctx, debug):
|
|
185
|
-
"""
|
|
186
|
-
Manage xbox builds and run xbox phototours
|
|
187
|
-
"""
|
|
188
|
-
ctx.ensure_object(dict)
|
|
189
|
-
ctx.obj['DEBUG'] = debug
|
|
190
|
-
|
|
191
|
-
@cli.command("list")
|
|
192
|
-
@click.option("-t", "--type", "config", default="None", help="Test or Development configuration (default is both)")
|
|
193
|
-
@click.option("-n", "--num", default=10, show_default=True, help="Maximum number of builds to show")
|
|
194
|
-
@click.option("-d", "--days", default=7, show_default=True, help="Show builds from the last few days")
|
|
195
|
-
@click.pass_context
|
|
196
|
-
def list_builds(ctx, config, num, days):
|
|
197
|
-
"""
|
|
198
|
-
List out the builds in the build folder on teamcity.
|
|
199
|
-
This might take a while to collect the builds
|
|
200
|
-
"""
|
|
201
|
-
mount()
|
|
202
|
-
builds = collect_builds()
|
|
203
|
-
hdr = ["CL", "timestamp", "config", "GB"]
|
|
204
|
-
lst = []
|
|
205
|
-
for changelist, builds in builds.items():
|
|
206
|
-
for build in builds:
|
|
207
|
-
dt = parse(build["timestamp"])
|
|
208
|
-
if dt < datetime.now() - timedelta(days=days):
|
|
209
|
-
continue
|
|
210
|
-
if config and build['configuration'].lower() != config.lower():
|
|
211
|
-
continue
|
|
212
|
-
lst.append([changelist, dt.strftime("%Y-%m-%d %H:%M"), build['configuration'], round(build['size_mb']/1024, 1)])
|
|
213
|
-
lst.reverse()
|
|
214
|
-
lst = lst[:num]
|
|
215
|
-
echo(tabulate(lst, hdr))
|
|
216
|
-
|
|
217
|
-
@cli.command()
|
|
218
|
-
@click.option("-n", "--num")
|
|
219
|
-
@click.option("-f", "--filter")
|
|
220
|
-
@click.pass_context
|
|
221
|
-
def tail(ctx, num, filter):
|
|
222
|
-
num = int(num) if num else 100
|
|
223
|
-
lines = get_loglines(num)
|
|
224
|
-
for l in lines:
|
|
225
|
-
if not filter or filter.lower() in l.lower():
|
|
226
|
-
print(l)
|
|
227
|
-
|
|
228
|
-
@cli.command()
|
|
229
|
-
@click.pass_context
|
|
230
|
-
def kill(ctx):
|
|
231
|
-
"""
|
|
232
|
-
Terminate the currently running executable on your xbox
|
|
233
|
-
"""
|
|
234
|
-
ensure_xbapps()
|
|
235
|
-
xbapp = xb("xbapp.exe")
|
|
236
|
-
cmd = [xbapp, "terminate"]
|
|
237
|
-
call(cmd)
|
|
238
|
-
|
|
239
|
-
@cli.command()
|
|
240
|
-
@click.option("-m", "--mode", "kit_mode", help="Set mode to xss or xsx")
|
|
241
|
-
@click.pass_context
|
|
242
|
-
def mode(ctx, kit_mode):
|
|
243
|
-
"""
|
|
244
|
-
Switch the xbox console between Lockhart (series S) and Anaconda (series X) modes.
|
|
245
|
-
This will restart the console.
|
|
246
|
-
"""
|
|
247
|
-
ensure_xbapps()
|
|
248
|
-
app = xb("xbconfig.exe")
|
|
249
|
-
cmd = [app, "/D"]
|
|
250
|
-
p = Popen(cmd, stdout=PIPE)
|
|
251
|
-
out, err = p.communicate()
|
|
252
|
-
curr_settings = {}
|
|
253
|
-
for l in out.splitlines():
|
|
254
|
-
kv = [k.strip() for k in l.strip().decode().split(":")]
|
|
255
|
-
try:
|
|
256
|
-
curr_settings[kv[0]] = kv[1]
|
|
257
|
-
except Exception as e:
|
|
258
|
-
pass
|
|
259
|
-
console_mode = curr_settings["consolemode"]
|
|
260
|
-
extra_title_memory = curr_settings["extratitlememory"]
|
|
261
|
-
profiling_mode = curr_settings["profilingmode"] == "on"
|
|
262
|
-
secho(f"Console is in mode: {console_mode}", bold=True)
|
|
263
|
-
modes = {
|
|
264
|
-
"xss": {
|
|
265
|
-
"ConsoleMode": "LockhartProfiling",
|
|
266
|
-
"ProfilingMode": "On",
|
|
267
|
-
"ExtraTitleMemory": "6048",
|
|
268
|
-
},
|
|
269
|
-
"xsx": {
|
|
270
|
-
"ConsoleMode": "AnacondaProfiling",
|
|
271
|
-
"ProfilingMode": "On"
|
|
272
|
-
},
|
|
273
|
-
}
|
|
274
|
-
if kit_mode:
|
|
275
|
-
settings = modes.get(kit_mode)
|
|
276
|
-
if not settings:
|
|
277
|
-
abort(f"Mode {kit_mode} not Found. Please select one of: {','.join(modes.keys())}")
|
|
278
|
-
if settings["ConsoleMode"] == console_mode:
|
|
279
|
-
echo(f"Console is already in mode {kit_mode}")
|
|
280
|
-
else:
|
|
281
|
-
echo(f"Setting console to mode {kit_mode} ({settings['ConsoleMode']})")
|
|
282
|
-
cmd = [app]
|
|
283
|
-
for k, v in settings.items():
|
|
284
|
-
cmd.append(f"{k}={v}")
|
|
285
|
-
p = Popen(cmd, stdout=PIPE)
|
|
286
|
-
out, err = p.communicate()
|
|
287
|
-
secho("Rebooting console. Please wait...")
|
|
288
|
-
call(xb("xbreboot.exe"))
|
|
289
|
-
|
|
290
|
-
while 1:
|
|
291
|
-
sys.stdout.write(".")
|
|
292
|
-
sys.stdout.flush()
|
|
293
|
-
cmd = [xb("xbconnect.exe"), "/q"]
|
|
294
|
-
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
|
|
295
|
-
p.communicate()
|
|
296
|
-
if p.returncode:
|
|
297
|
-
time.sleep(1.0)
|
|
298
|
-
else:
|
|
299
|
-
break
|
|
300
|
-
secho(f"\nConsole mode has been set to {kit_mode}", fg="green")
|
|
301
|
-
ctx.invoke(mode)
|
|
302
|
-
else:
|
|
303
|
-
echo("Use '-m xss' or '-m xsx' to switch modes")
|
|
304
|
-
|
|
305
|
-
def find_package(package):
|
|
306
|
-
p = Path(package)
|
|
307
|
-
if p.is_file():
|
|
308
|
-
return p.as_posix()
|
|
309
|
-
elif p.is_dir():
|
|
310
|
-
files = []
|
|
311
|
-
for f in p.glob("**/*.xvc"):
|
|
312
|
-
if f.is_file():
|
|
313
|
-
files.append(f.as_posix())
|
|
314
|
-
if len(files) > 1:
|
|
315
|
-
abort(f"Too many packages found: {files}")
|
|
316
|
-
elif files:
|
|
317
|
-
return files[0]
|
|
318
|
-
abort(f"Package {package} not found")
|
|
319
|
-
|
|
320
|
-
def find_build(cl, config):
|
|
321
|
-
all_builds = collect_builds()
|
|
322
|
-
cl = int(cl)
|
|
323
|
-
for b in all_builds[cl]:
|
|
324
|
-
if b['configuration'].lower() == (config or "").lower() or len(all_builds[cl]) == 1:
|
|
325
|
-
build = b
|
|
326
|
-
if not build:
|
|
327
|
-
abort(f"Multiple builds for {cl} found. Please specify --type=development|test")
|
|
328
|
-
return build
|
|
329
|
-
|
|
330
|
-
@cli.command()
|
|
331
|
-
@click.option("-c", "--cl", "changelists_string", help="Comma separated list of changelists or a range [from]-[to]")
|
|
332
|
-
@click.option("-t", "--type", "config", default=None, help="Build configuration, select either Development or Test")
|
|
333
|
-
@click.pass_context
|
|
334
|
-
def fetch(ctx, changelists_string, config):
|
|
335
|
-
"""
|
|
336
|
-
Fetch a build from teamcity storage to the local machine
|
|
337
|
-
"""
|
|
338
|
-
all_builds = collect_builds()
|
|
339
|
-
if not changelists_string:
|
|
340
|
-
ctx.invoke(list_builds, config=config)
|
|
341
|
-
changelists_string = input("Select a changelist to deploy: ")
|
|
342
|
-
|
|
343
|
-
changelists = parse_changelists(changelists_string, config)
|
|
344
|
-
secho(f"Downloading the following builds: {', '.join([str(c) for c in changelists])} in {config} configuration", bold=True)
|
|
345
|
-
if (len(changelists) > 1):
|
|
346
|
-
secho(f"This will require approximately {len(changelists)*20} GB space on your c:/ drive", fg="yellow")
|
|
347
|
-
|
|
348
|
-
for i, cl in enumerate(changelists):
|
|
349
|
-
build = find_build(cl, config)
|
|
350
|
-
|
|
351
|
-
full_path = Path(build["path"])
|
|
352
|
-
#echo(f"[{i+1}/{len(changelists)}] Downloading CL {cl} from {full_path}")
|
|
353
|
-
|
|
354
|
-
target_file = temp_path / build['filename']
|
|
355
|
-
if target_file.is_file():
|
|
356
|
-
tz = datetime.fromtimestamp(target_file.stat().st_mtime).isoformat()
|
|
357
|
-
if tz == build['timestamp']:
|
|
358
|
-
secho(f"[{i+1}/{len(changelists)}] Build {target_file.name} is already in {temp_path}", fg="green")
|
|
359
|
-
continue
|
|
360
|
-
else:
|
|
361
|
-
secho(f"[{i+1}/{len(changelists)}] Build {target_file.name} was found in {temp_path} but has the wrong timestamp. Will re-download", fg="yellow")
|
|
362
|
-
secho(f"[{i+1}/{len(changelists)}] Copying file {full_path} to {temp_path}...", fg="green")
|
|
363
|
-
path_to_copy = full_path.parent.as_posix()
|
|
364
|
-
cmd = ["robocopy.exe", path_to_copy, temp_path, "*.xvc", "/mt:10"]
|
|
365
|
-
p = call(cmd)
|
|
366
|
-
|
|
367
|
-
@cli.command()
|
|
368
|
-
@click.option("-c", "--cl", help="Changelist number to deploy")
|
|
369
|
-
@click.option("-p", "--package", help=".xvc Package name or folder containing package, alternative to --cl")
|
|
370
|
-
@click.option("-t", "--type", "config", default=None, help="Build configuration, select wither Development or Test")
|
|
371
|
-
@click.pass_context
|
|
372
|
-
def deploy(ctx, cl, package, config):
|
|
373
|
-
"""
|
|
374
|
-
Deploy a build that has already been downloaded to c:/temp/xboxbuilds
|
|
375
|
-
to your xbox console
|
|
376
|
-
"""
|
|
377
|
-
ensure_xbapps()
|
|
378
|
-
xbapp = xb("xbapp.exe")
|
|
379
|
-
xbconnect = xb("xbconnect.exe")
|
|
380
|
-
|
|
381
|
-
if cl:
|
|
382
|
-
echo(f"XBox found at IP {console_ip}. Deploying CL {cl}")
|
|
383
|
-
else:
|
|
384
|
-
echo(f"XBox found at IP {console_ip}. Deploying package {cl}")
|
|
385
|
-
|
|
386
|
-
cmd = [xbapp, "list"]
|
|
387
|
-
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
|
|
388
|
-
out, err = p.communicate()
|
|
389
|
-
if not not p.returncode:
|
|
390
|
-
abort("No XBox console found")
|
|
391
|
-
app_id = ""
|
|
392
|
-
for l in out.split():
|
|
393
|
-
l = l.decode()
|
|
394
|
-
# try to find the build number
|
|
395
|
-
if "UnknownWorldsEnter" in l and "!" not in l:
|
|
396
|
-
installed_cl = l.strip().split(".")[-1].split("_")[0]
|
|
397
|
-
if installed_cl:
|
|
398
|
-
try:
|
|
399
|
-
installed_cl = int(installed_cl)
|
|
400
|
-
except Exception as e:
|
|
401
|
-
installed_cl = 0
|
|
402
|
-
if installed_cl == cl:
|
|
403
|
-
secho(f"Changelist {cl} is already installed on xbox")
|
|
404
|
-
return
|
|
405
|
-
if package:
|
|
406
|
-
file_path_string = find_package(package)
|
|
407
|
-
else:
|
|
408
|
-
file_path_string = temp_path / find_build(cl, config)['filename']
|
|
409
|
-
secho(f"Installing build {file_path_string} on xbox", fg="green")
|
|
410
|
-
cmd = [xbapp, "install", file_path_string]
|
|
411
|
-
p = call(cmd)
|
|
412
|
-
|
|
413
|
-
@cli.command()
|
|
414
|
-
@click.option("-c", "--cl", "changelists_string", help="Comma separated or [from]-[to] list of changelists")
|
|
415
|
-
@click.option("-p", "--package", help=".xvc Package name or folder containing package, alternative to --cl")
|
|
416
|
-
@click.option("-t", "--type", "config", default=None, help="Development or Test configuration (required)")
|
|
417
|
-
@click.option("-m", "--mode", "kit_mode", default="xss", show_default=True, help="Run as xss or xsx")
|
|
418
|
-
@click.option("--teamcity/--no-teamcity", default=False, help="Run as teamcity build (sets group)")
|
|
419
|
-
@click.option("--cameras", default="xss", help="Comma separated list of camera filters")
|
|
420
|
-
@click.pass_context
|
|
421
|
-
def phototour(ctx, changelists_string, package, config, kit_mode, teamcity, cameras):
|
|
422
|
-
"""
|
|
423
|
-
Run a phototour from the selected changelists on the xbox console.
|
|
424
|
-
Downloads the required builds to your local machine before running.
|
|
425
|
-
Before running this use 'list' to see available builds
|
|
426
|
-
"""
|
|
427
|
-
ensure_xbapps()
|
|
428
|
-
ctx.invoke(mode, kit_mode=kit_mode)
|
|
429
|
-
if not package:
|
|
430
|
-
changelists = parse_changelists(changelists_string, config)
|
|
431
|
-
secho(f"Running phototours on the following changelists: {','.join([str(c) for c in changelists])}")
|
|
432
|
-
ctx.invoke(fetch, changelists_string=changelists_string, config=config)
|
|
433
|
-
for cl in changelists:
|
|
434
|
-
run_phototour(ctx, cl, None, config, teamcity, cameras, kit_mode)
|
|
435
|
-
else:
|
|
436
|
-
run_phototour(ctx, None, package, config, teamcity, cameras, kit_mode)
|
|
437
|
-
|
|
438
|
-
def run_phototour(ctx, cl, package, config, teamcity, cameras, kit_mode):
|
|
439
|
-
if cl:
|
|
440
|
-
secho(f"Deploying and running changelist {cl}", fg="green")
|
|
441
|
-
else:
|
|
442
|
-
secho(f"Deploying and running package {package}", fg="green")
|
|
443
|
-
ctx.invoke(deploy, cl=cl, package=package, config=config)
|
|
444
|
-
xbapp = xb("xbapp.exe")
|
|
445
|
-
# get the build ID
|
|
446
|
-
cmd = [xbapp, "list"]
|
|
447
|
-
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
|
|
448
|
-
out, err = p.communicate()
|
|
449
|
-
if not not p.returncode:
|
|
450
|
-
abort("No XBox console found")
|
|
451
|
-
app_id = ""
|
|
452
|
-
for l in out.split():
|
|
453
|
-
l = l.decode()
|
|
454
|
-
if "UnknownWorldsEnter" in l and "!" in l:
|
|
455
|
-
app_id = l.strip()
|
|
456
|
-
if not app_id:
|
|
457
|
-
abort("App not found on console")
|
|
458
|
-
|
|
459
|
-
computer_name = socket.gethostname()
|
|
460
|
-
current_user = getpass.getuser()
|
|
461
|
-
cmd = [xbapp, "launch", app_id, "-phototour",
|
|
462
|
-
f'-perftour_runner="{computer_name}/{current_user}"',
|
|
463
|
-
'-perftour_tags="personal"']
|
|
464
|
-
if cameras:
|
|
465
|
-
cmd.append(f'-perftour_cameras="{cameras}"')
|
|
466
|
-
if teamcity:
|
|
467
|
-
cmd.append(f'-perftour_group="{kit_mode.lower()}"')
|
|
468
|
-
secho(f"Launching phototour with app {app_id}", fg="green")
|
|
469
|
-
p = Popen(cmd, shell=True)
|
|
470
|
-
out, err = p.communicate()
|
|
471
|
-
done = False
|
|
472
|
-
start_time = datetime.now()
|
|
473
|
-
while 1:
|
|
474
|
-
time.sleep(10)
|
|
475
|
-
lines = get_loglines()
|
|
476
|
-
lines.reverse()
|
|
477
|
-
latest_timestamp = None
|
|
478
|
-
for l in lines:
|
|
479
|
-
if not latest_timestamp:
|
|
480
|
-
latest_timestamp = get_timestamp_from_logline(l)
|
|
481
|
-
if "phototour" in l.lower():
|
|
482
|
-
echo(l)
|
|
483
|
-
break
|
|
484
|
-
if "RequestExit" in l:
|
|
485
|
-
echo(l)
|
|
486
|
-
done = True
|
|
487
|
-
if latest_timestamp < datetime.now() - timedelta(minutes=2):
|
|
488
|
-
secho(f"No loglines since {latest_timestamp.isoformat()}. Quitting", fg="yellow")
|
|
489
|
-
done = True
|
|
490
|
-
if done:
|
|
491
|
-
break
|
|
492
|
-
durr = (datetime.now() - start_time).total_seconds()
|
|
493
|
-
secho(f"Phototour has finished running in {durr} sec", fg="green")
|
|
494
|
-
|
|
495
|
-
if __name__ == "__main__":
|
|
496
|
-
cli()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|