|
8 | 8 |
|
9 | 9 | ROOT = Path(__file__).resolve().parents[2] |
10 | 10 | DEMO = ROOT / "examples/demo" |
| 11 | +DEMO_PROJECTS = (DEMO, ROOT / "examples/demo-no-location") |
11 | 12 | BOOTSTRAP = ROOT / "examples/demo/Assets/OneSignal" |
12 | 13 | SAMPLE = ROOT / "com.onesignal.unitysdk.core/Samples~" |
13 | 14 | INVENTORY = BOOTSTRAP / "Editor/Resources/OneSignalFileInventory.asset" |
|
17 | 18 | "com.onesignal.unitysdk.ios", |
18 | 19 | ) |
19 | 20 | CORE_PACKAGE = PACKAGE_NAMES[0] |
| 21 | +PLATFORM_PACKAGES = PACKAGE_NAMES[1:] |
| 22 | +EDM_PACKAGE = "com.unity.external-dependency-manager" |
| 23 | +EDM_VERSION = "2.0.0" |
20 | 24 | MINIMUM_UNITY_VERSION = "2022.3" |
21 | 25 | MINIMUM_UNITY_RELEASE = "0f1" |
22 | 26 |
|
@@ -103,13 +107,23 @@ def validate_packages() -> None: |
103 | 107 | if package.get("samples"): |
104 | 108 | fail(f"{name} must not contain samples") |
105 | 109 |
|
106 | | - manifest = json.loads((DEMO / "Packages/manifest.json").read_text()) |
107 | | - if manifest.get("scopedRegistries"): |
108 | | - fail("demo requires a scoped registry") |
109 | | - for name in PACKAGE_NAMES: |
110 | | - expected_path = f"file:../../../{name}" |
111 | | - if manifest["dependencies"].get(name) != expected_path: |
112 | | - fail(f"demo does not reference {name} at {expected_path}") |
| 110 | + for name in PLATFORM_PACKAGES: |
| 111 | + if packages[name].get("dependencies", {}).get(EDM_PACKAGE) != EDM_VERSION: |
| 112 | + fail(f"{name} does not depend on {EDM_PACKAGE}@{EDM_VERSION}") |
| 113 | + |
| 114 | + legacy_installer = ROOT / CORE_PACKAGE / "Editor/SetupSteps/InstallEdm4uStep.cs" |
| 115 | + if legacy_installer.exists(): |
| 116 | + fail(f"{legacy_installer.relative_to(ROOT)} installs unsupported Google EDM4U") |
| 117 | + |
| 118 | + for project in DEMO_PROJECTS: |
| 119 | + project_name = project.relative_to(ROOT) |
| 120 | + manifest = json.loads((project / "Packages/manifest.json").read_text()) |
| 121 | + if manifest.get("scopedRegistries"): |
| 122 | + fail(f"{project_name} must not declare a scoped registry") |
| 123 | + for name in PACKAGE_NAMES: |
| 124 | + expected_path = f"file:../../../{name}" |
| 125 | + if manifest["dependencies"].get(name) != expected_path: |
| 126 | + fail(f"{project_name} does not reference {name} at {expected_path}") |
113 | 127 |
|
114 | 128 |
|
115 | 129 | def validate_sample() -> None: |
@@ -152,6 +166,16 @@ def validate_sample() -> None: |
152 | 166 |
|
153 | 167 |
|
154 | 168 | def main() -> None: |
| 169 | + for project in DEMO_PROJECTS: |
| 170 | + legacy_edm = project / "Assets/ExternalDependencyManager" |
| 171 | + if legacy_edm.exists(): |
| 172 | + fail(f"{legacy_edm.relative_to(ROOT)} bundles unsupported Google EDM4U") |
| 173 | + settings_path = project / "ProjectSettings/ExternalDependencyManagerSettings.json" |
| 174 | + if not settings_path.is_file(): |
| 175 | + fail(f"{settings_path.relative_to(ROOT)} is missing") |
| 176 | + settings = json.loads(settings_path.read_text()) |
| 177 | + if not settings.get("edmEnabled"): |
| 178 | + fail(f"{settings_path.relative_to(ROOT)} does not enable Unity EDM") |
155 | 179 | if (BOOTSTRAP / "Example").exists() or (BOOTSTRAP / "Example.meta").exists(): |
156 | 180 | fail("empty legacy Asset Store Example path still exists") |
157 | 181 | if (BOOTSTRAP / "Documentation~").exists(): |
|
0 commit comments