From 5e6b5bb08e23a632d05f98abbdb99e7dc3e3716d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Sch=C3=A4rer?= <143824611+marc-n-dream@users.noreply.github.com> Date: Sat, 10 Oct 2026 00:49:05 +0200 Subject: [PATCH] build: leave the plugin tests out of the code package The tests change PlayerSettings, so they must not run in game projects. The upgrade deletes the Tests folder that 2.6.3 and earlier installed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_015uK9hhtA5vxmCSveT2uQm3 --- Assets/AirConsole/ProjectCodeUpdater.cs | 7 +++++++ Assets/Packager/Editor/Packager.cs | 16 +++++++++++----- CHANGELOG.md | 4 ++++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Assets/AirConsole/ProjectCodeUpdater.cs b/Assets/AirConsole/ProjectCodeUpdater.cs index eece6833..082bde0b 100644 --- a/Assets/AirConsole/ProjectCodeUpdater.cs +++ b/Assets/AirConsole/ProjectCodeUpdater.cs @@ -79,6 +79,13 @@ private static void ExecuteCodePackageImport() { AssetDatabase.DeleteAsset("Assets/AirConsole/unity-webview"); } + // Up to 2.6.3, the code package also installed the plugin tests. They compile against internal plugin members, and + // ImportPackage never deletes files, so a stale copy would break compilation after a later release changes those members. + if (File.Exists(Path.Combine(Application.dataPath, "AirConsole", "scripts", "Tests", "EditMode", + "AirConsole.EditMode.Tests.asmdef"))) { + AssetDatabase.DeleteAsset("Assets/AirConsole/scripts/Tests"); + } + ClearConsole(); SessionState.SetBool(IMPORT_PENDING_KEY, true); #if UNITY_6000_6_OR_NEWER diff --git a/Assets/Packager/Editor/Packager.cs b/Assets/Packager/Editor/Packager.cs index 83022fb2..b5e6805c 100644 --- a/Assets/Packager/Editor/Packager.cs +++ b/Assets/Packager/Editor/Packager.cs @@ -148,17 +148,23 @@ private static void CollectWebGlTemplateFiles(string path, ref IEnumerable it != "Tests") + .Select(it => $"Assets/AirConsole/scripts/{it}") + .Append("Assets/AirConsole/unity-webview") + .Append("Assets/AirConsole/examples") + .ToArray(); + #if UNITY_6000_6_OR_NEWER UnityEditor.AssetPackage.Package.Export(new UnityEditor.AssetPackage.ExportPackageParameters( - new[] { "Assets/AirConsole/scripts", "Assets/AirConsole/unity-webview", "Assets/AirConsole/examples" }, + codePaths, unityPackagePath, "", ExportPackageOptions.Recurse)); #else - AssetDatabase.ExportPackage( - new[] { "Assets/AirConsole/scripts", "Assets/AirConsole/unity-webview", "Assets/AirConsole/examples" }, - unityPackagePath, - ExportPackageOptions.Recurse); + AssetDatabase.ExportPackage(codePaths, unityPackagePath, ExportPackageOptions.Recurse); #endif return unityPackagePath.Replace(Application.dataPath, "Assets"); } diff --git a/CHANGELOG.md b/CHANGELOG.md index b1e80767..2ee1a829 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ Release notes follow the [keep a changelog](https://keepachangelog.com/en/1.1.0/ - **Unity API:** `RequestPhotonEngineAuth` and the `OnPhotonEngineAuth` event provide a ticket for Photon Custom Authentication. Requires airconsole-api 1.12.0. +### Changed + +- **Package:** The plugin package no longer contains the plugin tests (`Assets/AirConsole/scripts/Tests`), so they do not run in game projects. The upgrade deletes `Assets/AirConsole/scripts/Tests` that an earlier version installed. + ## [2.6.3] - 2026-10-03 ### Fixed