unity-devkit 0.3.1__py3-none-any.whl → 0.3.2__py3-none-any.whl
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.
- unity_devkit/compile_check_unity.py +23 -1
- {unity_devkit-0.3.1.dist-info → unity_devkit-0.3.2.dist-info}/METADATA +1 -1
- {unity_devkit-0.3.1.dist-info → unity_devkit-0.3.2.dist-info}/RECORD +5 -5
- {unity_devkit-0.3.1.dist-info → unity_devkit-0.3.2.dist-info}/WHEEL +0 -0
- {unity_devkit-0.3.1.dist-info → unity_devkit-0.3.2.dist-info}/entry_points.txt +0 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import shutil
|
|
4
|
+
from pathlib import Path
|
|
3
5
|
from typing import Annotated
|
|
4
6
|
|
|
5
7
|
import typer
|
|
6
8
|
|
|
9
|
+
from build_artifact_registry.cache import restore, save
|
|
7
10
|
from build_artifact_registry.setup_oras import install_oras
|
|
8
|
-
from .identity import cache_registry
|
|
11
|
+
from .identity import cache_key, cache_registry
|
|
9
12
|
from .license_restore import restore_or_activate_license
|
|
10
13
|
from .player_build import prepare_unity_project, resolve_unity_project, run_unity_batchmode
|
|
11
14
|
from .upm_cache import restore_upm_cache, save_upm_cache
|
|
@@ -13,11 +16,15 @@ from .upm_cache import restore_upm_cache, save_upm_cache
|
|
|
13
16
|
app = typer.Typer(add_completion=False, pretty_exceptions_show_locals=False)
|
|
14
17
|
|
|
15
18
|
COMPILE_ERROR_SIGNATURES = ("error CS",)
|
|
19
|
+
COMPILE_CACHE_SCOPE = "compile"
|
|
16
20
|
|
|
17
21
|
|
|
18
22
|
@app.command()
|
|
19
23
|
def compile_check_unity(
|
|
20
24
|
project: Annotated[str, typer.Option(help="Unity project name (the 'name' field of its unity-devkit.json)")],
|
|
25
|
+
pr_number: Annotated[
|
|
26
|
+
str, typer.Option(help="Pull-request number; empty on non-PR runs selects the dev library-cache scope")
|
|
27
|
+
] = "",
|
|
21
28
|
license_cache_key: Annotated[
|
|
22
29
|
str,
|
|
23
30
|
typer.Option("--license-cache-key", help="ORAS tag the license cache restores under; empty uses today's tag"),
|
|
@@ -28,13 +35,28 @@ def compile_check_unity(
|
|
|
28
35
|
raise SystemExit("compile-check needs --registry (the OCI registry root)")
|
|
29
36
|
project_path = resolve_unity_project(project).path
|
|
30
37
|
cache_namespace = cache_registry(registry)
|
|
38
|
+
parsed_pr_number = int(pr_number) if pr_number else None
|
|
39
|
+
library_cache_key = cache_key(project, COMPILE_CACHE_SCOPE, parsed_pr_number)
|
|
31
40
|
|
|
32
41
|
install_oras()
|
|
33
42
|
restore_or_activate_license(cache_namespace, license_cache_key or None)
|
|
34
43
|
restore_upm_cache(project_path, cache_namespace)
|
|
44
|
+
restore(
|
|
45
|
+
cache_namespace,
|
|
46
|
+
"unity-library",
|
|
47
|
+
library_cache_key,
|
|
48
|
+
Path("."),
|
|
49
|
+
fallback_tags=[cache_key(project, COMPILE_CACHE_SCOPE, None)] if parsed_pr_number is not None else None,
|
|
50
|
+
)
|
|
35
51
|
|
|
36
52
|
print(f"Compile-checking {project}...")
|
|
37
53
|
prepare_unity_project(project_path)
|
|
38
54
|
run_unity_batchmode(project_path, extra_failure_signatures=COMPILE_ERROR_SIGNATURES)
|
|
55
|
+
|
|
56
|
+
package_cache = project_path / "Library" / "PackageCache"
|
|
57
|
+
if package_cache.exists():
|
|
58
|
+
shutil.rmtree(package_cache)
|
|
59
|
+
relative_project_path = project_path.relative_to(Path.cwd())
|
|
60
|
+
save(cache_namespace, "unity-library", library_cache_key, Path("."), [f"{relative_project_path}/Library/"])
|
|
39
61
|
save_upm_cache(project_path, cache_namespace)
|
|
40
62
|
print(" Compiles clean")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
unity_devkit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
unity_devkit/build_unity.py,sha256=saKXpZSEz-OMxwu1PHHInYtU1t2qtiu8VOpONoO-emA,6750
|
|
3
|
-
unity_devkit/compile_check_unity.py,sha256=
|
|
3
|
+
unity_devkit/compile_check_unity.py,sha256=E3olw0uh9-_F6ocJLgLIcOHaje_fnXj1BEfxbeGa8Ns,2537
|
|
4
4
|
unity_devkit/identity.py,sha256=8uuIU49EEX3FPA3FRBW6XFZZijRBcb3trEQmz0hbiL4,364
|
|
5
5
|
unity_devkit/install.py,sha256=ojdtQIt5gyViOoENRoAS9gx-WIFmnfb2Ed9bMlzb2tg,7758
|
|
6
6
|
unity_devkit/license.py,sha256=ESst2YYj2h2JWMqcQs07jIZkS9FfG4_g2HEwhZyVssE,813
|
|
@@ -12,7 +12,7 @@ unity_devkit/projects.py,sha256=PO5plIj-mn8KkKOUhGRRIL_sDdd6ohl12neS2poILhs,2665
|
|
|
12
12
|
unity_devkit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
unity_devkit/test_unity.py,sha256=SpeWnV2hpdZBaGsstL8RTO50C2HEAcvantzBQYeaTpE,1075
|
|
14
14
|
unity_devkit/upm_cache.py,sha256=s4-Op9aIebcjk5pFTciSomHfAAR8KDp2nMzIZlC5icg,1158
|
|
15
|
-
unity_devkit-0.3.
|
|
16
|
-
unity_devkit-0.3.
|
|
17
|
-
unity_devkit-0.3.
|
|
18
|
-
unity_devkit-0.3.
|
|
15
|
+
unity_devkit-0.3.2.dist-info/METADATA,sha256=u3Ole3TTTUTxECDwjl6TB_8jpXwJPfezEzbgQT9cIuU,308
|
|
16
|
+
unity_devkit-0.3.2.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
17
|
+
unity_devkit-0.3.2.dist-info/entry_points.txt,sha256=_GfnlOh8IWYzCh2Z8QVXMiJqppcNx8_sj0MX1d_Vky0,471
|
|
18
|
+
unity_devkit-0.3.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|