From 94404083520b67726f5090db3d6cd0ef593e804a Mon Sep 17 00:00:00 2001 From: hatayama Date: Thu, 28 May 2026 01:56:46 +0900 Subject: [PATCH 1/3] Rename legacy uLoopMCP asmdef files Rename remaining tracked asmdef asset filenames to UnityCLILoop while preserving their .meta contents and GUIDs. Update filename-based tests so future cleanup catches legacy asset names. --- ...MCP.Dev.asmdef => UnityCLILoop.Dev.asmdef} | 0 ...mdef.meta => UnityCLILoop.Dev.asmdef.meta} | 0 ... => UnityCLILoop.Tests.Demo.Editor.asmdef} | 0 ...nityCLILoop.Tests.Demo.Editor.asmdef.meta} | 0 ....asmdef => UnityCLILoop.Tests.Demo.asmdef} | 0 ...ta => UnityCLILoop.Tests.Demo.asmdef.meta} | 0 .../InputVisualizationCanvasPrefabTests.cs | 2 +- .../Editor/OnionAssemblyDependencyTests.cs | 19 ++++++++++++++++--- ...smdef => UnityCLILoop.Tests.Editor.asmdef} | 0 ... => UnityCLILoop.Tests.Editor.asmdef.meta} | 0 ...def => UnityCLILoop.Tests.PlayMode.asmdef} | 0 ...> UnityCLILoop.Tests.PlayMode.asmdef.meta} | 0 ... UnityCLILoop.test_for_test.Editor.asmdef} | 0 ...yCLILoop.test_for_test.Editor.asmdef.meta} | 0 ...ime.asmdef => UnityCLILoop.Runtime.asmdef} | 0 ....meta => UnityCLILoop.Runtime.asmdef.meta} | 0 16 files changed, 17 insertions(+), 4 deletions(-) rename Assets/Editor/{uLoopMCP.Dev.asmdef => UnityCLILoop.Dev.asmdef} (100%) rename Assets/Editor/{uLoopMCP.Dev.asmdef.meta => UnityCLILoop.Dev.asmdef.meta} (100%) rename Assets/Tests/Demo/Editor/{uLoopMCP.Tests.Demo.Editor.asmdef => UnityCLILoop.Tests.Demo.Editor.asmdef} (100%) rename Assets/Tests/Demo/Editor/{uLoopMCP.Tests.Demo.Editor.asmdef.meta => UnityCLILoop.Tests.Demo.Editor.asmdef.meta} (100%) rename Assets/Tests/Demo/{uLoopMCP.Tests.Demo.asmdef => UnityCLILoop.Tests.Demo.asmdef} (100%) rename Assets/Tests/Demo/{uLoopMCP.Tests.Demo.asmdef.meta => UnityCLILoop.Tests.Demo.asmdef.meta} (100%) rename Assets/Tests/Editor/{uLoopMCP.Tests.Editor.asmdef => UnityCLILoop.Tests.Editor.asmdef} (100%) rename Assets/Tests/Editor/{uLoopMCP.Tests.Editor.asmdef.meta => UnityCLILoop.Tests.Editor.asmdef.meta} (100%) rename Assets/Tests/PlayMode/{uLoopMCP.Tests.PlayMode.asmdef => UnityCLILoop.Tests.PlayMode.asmdef} (100%) rename Assets/Tests/PlayMode/{uLoopMCP.Tests.PlayMode.asmdef.meta => UnityCLILoop.Tests.PlayMode.asmdef.meta} (100%) rename Assets/Tests/_Test_For_Test_/{uLoopMCP.test_for_test.Editor.asmdef => UnityCLILoop.test_for_test.Editor.asmdef} (100%) rename Assets/Tests/_Test_For_Test_/{uLoopMCP.test_for_test.Editor.asmdef.meta => UnityCLILoop.test_for_test.Editor.asmdef.meta} (100%) rename Packages/src/Runtime/{uLoopMCP.Runtime.asmdef => UnityCLILoop.Runtime.asmdef} (100%) rename Packages/src/Runtime/{uLoopMCP.Runtime.asmdef.meta => UnityCLILoop.Runtime.asmdef.meta} (100%) diff --git a/Assets/Editor/uLoopMCP.Dev.asmdef b/Assets/Editor/UnityCLILoop.Dev.asmdef similarity index 100% rename from Assets/Editor/uLoopMCP.Dev.asmdef rename to Assets/Editor/UnityCLILoop.Dev.asmdef diff --git a/Assets/Editor/uLoopMCP.Dev.asmdef.meta b/Assets/Editor/UnityCLILoop.Dev.asmdef.meta similarity index 100% rename from Assets/Editor/uLoopMCP.Dev.asmdef.meta rename to Assets/Editor/UnityCLILoop.Dev.asmdef.meta diff --git a/Assets/Tests/Demo/Editor/uLoopMCP.Tests.Demo.Editor.asmdef b/Assets/Tests/Demo/Editor/UnityCLILoop.Tests.Demo.Editor.asmdef similarity index 100% rename from Assets/Tests/Demo/Editor/uLoopMCP.Tests.Demo.Editor.asmdef rename to Assets/Tests/Demo/Editor/UnityCLILoop.Tests.Demo.Editor.asmdef diff --git a/Assets/Tests/Demo/Editor/uLoopMCP.Tests.Demo.Editor.asmdef.meta b/Assets/Tests/Demo/Editor/UnityCLILoop.Tests.Demo.Editor.asmdef.meta similarity index 100% rename from Assets/Tests/Demo/Editor/uLoopMCP.Tests.Demo.Editor.asmdef.meta rename to Assets/Tests/Demo/Editor/UnityCLILoop.Tests.Demo.Editor.asmdef.meta diff --git a/Assets/Tests/Demo/uLoopMCP.Tests.Demo.asmdef b/Assets/Tests/Demo/UnityCLILoop.Tests.Demo.asmdef similarity index 100% rename from Assets/Tests/Demo/uLoopMCP.Tests.Demo.asmdef rename to Assets/Tests/Demo/UnityCLILoop.Tests.Demo.asmdef diff --git a/Assets/Tests/Demo/uLoopMCP.Tests.Demo.asmdef.meta b/Assets/Tests/Demo/UnityCLILoop.Tests.Demo.asmdef.meta similarity index 100% rename from Assets/Tests/Demo/uLoopMCP.Tests.Demo.asmdef.meta rename to Assets/Tests/Demo/UnityCLILoop.Tests.Demo.asmdef.meta diff --git a/Assets/Tests/Editor/InputVisualizationCanvasPrefabTests.cs b/Assets/Tests/Editor/InputVisualizationCanvasPrefabTests.cs index f12e689921..b000ee86a1 100644 --- a/Assets/Tests/Editor/InputVisualizationCanvasPrefabTests.cs +++ b/Assets/Tests/Editor/InputVisualizationCanvasPrefabTests.cs @@ -18,7 +18,7 @@ public sealed class InputVisualizationCanvasPrefabTests private const string PrefabPath = "Packages/io.github.hatayama.uloopmcp/Runtime/Common/InputVisualizationCanvas.prefab"; private const string RuntimeAssemblyDefinitionPath = - "Packages/src/Runtime/uLoopMCP.Runtime.asmdef"; + "Packages/src/Runtime/UnityCLILoop.Runtime.asmdef"; private const string RuntimeSourceDirectoryPath = "Packages/src/Runtime"; private static readonly string[] OverlayPrefabPaths = diff --git a/Assets/Tests/Editor/OnionAssemblyDependencyTests.cs b/Assets/Tests/Editor/OnionAssemblyDependencyTests.cs index 75e088127e..5978abf01d 100644 --- a/Assets/Tests/Editor/OnionAssemblyDependencyTests.cs +++ b/Assets/Tests/Editor/OnionAssemblyDependencyTests.cs @@ -97,13 +97,26 @@ public void CliConstants_WhenLoaded_CompileUnderDomainAssembly() public void RuntimeAsmdef_WhenLoaded_AllowsPrefabAttachmentWithoutAutoReference() { // Tests that runtime overlay code can attach to prefabs without implicit project references. - string[] includePlatforms = ReadIncludePlatforms("Packages/src/Runtime/uLoopMCP.Runtime.asmdef"); - bool autoReferenced = ReadAutoReferenced("Packages/src/Runtime/uLoopMCP.Runtime.asmdef"); + string[] includePlatforms = ReadIncludePlatforms("Packages/src/Runtime/UnityCLILoop.Runtime.asmdef"); + bool autoReferenced = ReadAutoReferenced("Packages/src/Runtime/UnityCLILoop.Runtime.asmdef"); Assert.That(includePlatforms, Is.Empty); Assert.That(autoReferenced, Is.False); } + [Test] + public void ProjectAsmdefFileNames_WhenLoaded_UseUnityCliLoopName() + { + // Tests that tracked asmdef asset filenames no longer expose the legacy project name. + string[] legacyFileNames = ReadProjectAsmdefPaths() + .Select(Path.GetFileName) + .Where(fileName => fileName.IndexOf("uLoopMCP", StringComparison.Ordinal) >= 0) + .OrderBy(fileName => fileName) + .ToArray(); + + Assert.That(legacyFileNames, Is.Empty); + } + [Test] public void ProjectAsmdefs_WhenLoaded_AutoReferenceOnlyPublicToolContracts() { @@ -145,7 +158,7 @@ public void ProjectAsmdefsReferencingEditorOnlyPackageAssemblies_WhenLoaded_Targ public void DemoEditorAsmdef_WhenLoaded_RequiresUnityIncludeTestsAndManualReference() { // Tests that demo editor startup hooks stay out of normal Editor startup. - string relativeAsmdefPath = "Assets/Tests/Demo/Editor/uLoopMCP.Tests.Demo.Editor.asmdef"; + string relativeAsmdefPath = "Assets/Tests/Demo/Editor/UnityCLILoop.Tests.Demo.Editor.asmdef"; string[] defineConstraints = ReadDefineConstraints(relativeAsmdefPath); bool autoReferenced = ReadAutoReferenced(relativeAsmdefPath); diff --git a/Assets/Tests/Editor/uLoopMCP.Tests.Editor.asmdef b/Assets/Tests/Editor/UnityCLILoop.Tests.Editor.asmdef similarity index 100% rename from Assets/Tests/Editor/uLoopMCP.Tests.Editor.asmdef rename to Assets/Tests/Editor/UnityCLILoop.Tests.Editor.asmdef diff --git a/Assets/Tests/Editor/uLoopMCP.Tests.Editor.asmdef.meta b/Assets/Tests/Editor/UnityCLILoop.Tests.Editor.asmdef.meta similarity index 100% rename from Assets/Tests/Editor/uLoopMCP.Tests.Editor.asmdef.meta rename to Assets/Tests/Editor/UnityCLILoop.Tests.Editor.asmdef.meta diff --git a/Assets/Tests/PlayMode/uLoopMCP.Tests.PlayMode.asmdef b/Assets/Tests/PlayMode/UnityCLILoop.Tests.PlayMode.asmdef similarity index 100% rename from Assets/Tests/PlayMode/uLoopMCP.Tests.PlayMode.asmdef rename to Assets/Tests/PlayMode/UnityCLILoop.Tests.PlayMode.asmdef diff --git a/Assets/Tests/PlayMode/uLoopMCP.Tests.PlayMode.asmdef.meta b/Assets/Tests/PlayMode/UnityCLILoop.Tests.PlayMode.asmdef.meta similarity index 100% rename from Assets/Tests/PlayMode/uLoopMCP.Tests.PlayMode.asmdef.meta rename to Assets/Tests/PlayMode/UnityCLILoop.Tests.PlayMode.asmdef.meta diff --git a/Assets/Tests/_Test_For_Test_/uLoopMCP.test_for_test.Editor.asmdef b/Assets/Tests/_Test_For_Test_/UnityCLILoop.test_for_test.Editor.asmdef similarity index 100% rename from Assets/Tests/_Test_For_Test_/uLoopMCP.test_for_test.Editor.asmdef rename to Assets/Tests/_Test_For_Test_/UnityCLILoop.test_for_test.Editor.asmdef diff --git a/Assets/Tests/_Test_For_Test_/uLoopMCP.test_for_test.Editor.asmdef.meta b/Assets/Tests/_Test_For_Test_/UnityCLILoop.test_for_test.Editor.asmdef.meta similarity index 100% rename from Assets/Tests/_Test_For_Test_/uLoopMCP.test_for_test.Editor.asmdef.meta rename to Assets/Tests/_Test_For_Test_/UnityCLILoop.test_for_test.Editor.asmdef.meta diff --git a/Packages/src/Runtime/uLoopMCP.Runtime.asmdef b/Packages/src/Runtime/UnityCLILoop.Runtime.asmdef similarity index 100% rename from Packages/src/Runtime/uLoopMCP.Runtime.asmdef rename to Packages/src/Runtime/UnityCLILoop.Runtime.asmdef diff --git a/Packages/src/Runtime/uLoopMCP.Runtime.asmdef.meta b/Packages/src/Runtime/UnityCLILoop.Runtime.asmdef.meta similarity index 100% rename from Packages/src/Runtime/uLoopMCP.Runtime.asmdef.meta rename to Packages/src/Runtime/UnityCLILoop.Runtime.asmdef.meta From 8dce8f0d94e6685021e6ad36c2e34cd339fc1457 Mon Sep 17 00:00:00 2001 From: hatayama Date: Thu, 28 May 2026 08:52:12 +0900 Subject: [PATCH 2/3] Rename legacy asmdef assembly names Update remaining asmdef names to UnityCLILoop and align friend assembly and scene references with the new assembly identities. Preserve migration support for old name-based runtime references so third-party asmdefs can still be repaired. --- .../CustomCommandSamples/AssemblyInfo.cs | 2 +- Assets/Editor/UnityCLILoop.Dev.asmdef | 2 +- .../Scenes/InputReplayVerificationScene.unity | 6 ++-- Assets/Scenes/SimulateMouseDemoScene.unity | 6 ++-- .../UnityCLILoop.Tests.Demo.Editor.asmdef | 2 +- .../Tests/Demo/UnityCLILoop.Tests.Demo.asmdef | 2 +- .../Editor/OnionAssemblyDependencyTests.cs | 13 ++++++++ ...ThirdPartyToolMigrationFileServiceTests.cs | 30 +++++++++++++++++++ .../ThirdPartyToolMigrationRulesTests.cs | 25 ++++++++++++++++ .../Editor/UnityCLILoop.Tests.Editor.asmdef | 2 +- .../UnityCLILoop.Tests.PlayMode.asmdef | 2 +- .../UnityCLILoop.test_for_test.Editor.asmdef | 2 +- .../src/Editor/Application/AssemblyInfo.cs | 8 ++--- .../Editor/CompositionRoot/AssemblyInfo.cs | 2 +- Packages/src/Editor/Domain/AssemblyInfo.cs | 8 ++--- .../ClearConsole/AssemblyInfo.cs | 6 ++-- .../Common/Console/AssemblyInfo.cs | 6 ++-- .../Common/EditorUtility/AssemblyInfo.cs | 6 ++-- .../Common/InputRecording/AssemblyInfo.cs | 6 ++-- .../Common/InputSimulation/AssemblyInfo.cs | 6 ++-- .../Common/InputSystem/AssemblyInfo.cs | 6 ++-- .../Common/MouseUi/AssemblyInfo.cs | 6 ++-- .../Common/Overlay/AssemblyInfo.cs | 6 ++-- .../FirstPartyTools/Compile/AssemblyInfo.cs | 6 ++-- .../ControlPlayMode/AssemblyInfo.cs | 6 ++-- .../ExecuteDynamicCode/AssemblyInfo.cs | 6 ++-- .../DynamicCodeCompilationServiceFactory.cs | 2 +- .../FindGameObjects/AssemblyInfo.cs | 6 ++-- .../GetHierarchy/AssemblyInfo.cs | 6 ++-- .../FirstPartyTools/GetLogs/AssemblyInfo.cs | 6 ++-- .../RecordInput/AssemblyInfo.cs | 6 ++-- .../ReplayInput/AssemblyInfo.cs | 6 ++-- .../FirstPartyTools/RunTests/AssemblyInfo.cs | 6 ++-- .../TestFramework/NUnitXmlResultExporter.cs | 2 +- .../TestRunner/TestExecutionFilter.cs | 2 +- .../Screenshot/AssemblyInfo.cs | 6 ++-- .../SimulateKeyboard/AssemblyInfo.cs | 6 ++-- .../SimulateMouseInput/AssemblyInfo.cs | 6 ++-- .../SimulateMouseUi/AssemblyInfo.cs | 6 ++-- .../src/Editor/Infrastructure/AssemblyInfo.cs | 2 +- .../ThirdPartyToolMigrationRules.cs | 25 ++++++++++++++-- .../UnityCliLoopSettingsWindowEventHandler.cs | 2 +- .../src/Runtime/UnityCLILoop.Runtime.asmdef | 2 +- 43 files changed, 181 insertions(+), 94 deletions(-) diff --git a/Assets/Editor/CustomCommandSamples/AssemblyInfo.cs b/Assets/Editor/CustomCommandSamples/AssemblyInfo.cs index 88caf038e9..18a3118430 100644 --- a/Assets/Editor/CustomCommandSamples/AssemblyInfo.cs +++ b/Assets/Editor/CustomCommandSamples/AssemblyInfo.cs @@ -1,3 +1,3 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Assets/Editor/UnityCLILoop.Dev.asmdef b/Assets/Editor/UnityCLILoop.Dev.asmdef index 62f4a8685e..e58066840f 100644 --- a/Assets/Editor/UnityCLILoop.Dev.asmdef +++ b/Assets/Editor/UnityCLILoop.Dev.asmdef @@ -1,5 +1,5 @@ { - "name": "uLoopMCP.Dev", + "name": "UnityCLILoop.Dev", "rootNamespace": "io.github.hatayama.UnityCliLoop.Dev", "references": [ "GUID:214998e563c124e8a88199b2dd1f522d", diff --git a/Assets/Scenes/InputReplayVerificationScene.unity b/Assets/Scenes/InputReplayVerificationScene.unity index b125519261..cf8945c7b4 100644 --- a/Assets/Scenes/InputReplayVerificationScene.unity +++ b/Assets/Scenes/InputReplayVerificationScene.unity @@ -1216,7 +1216,7 @@ MonoBehaviour: m_Calls: - m_Target: {fileID: 169394561} m_TargetAssemblyTypeName: io.github.hatayama.uLoopMCP.InputReplayVerificationController, - uLoopMCP.Tests.Demo + UnityCLILoop.Tests.Demo m_MethodName: OnSaveRecordingLog m_Mode: 0 m_Arguments: @@ -1863,7 +1863,7 @@ MonoBehaviour: m_Calls: - m_Target: {fileID: 169394561} m_TargetAssemblyTypeName: io.github.hatayama.uLoopMCP.InputReplayVerificationController, - uLoopMCP.Tests.Demo + UnityCLILoop.Tests.Demo m_MethodName: OnSaveReplayLog m_Mode: 0 m_Arguments: @@ -1997,7 +1997,7 @@ MonoBehaviour: m_Calls: - m_Target: {fileID: 169394561} m_TargetAssemblyTypeName: io.github.hatayama.uLoopMCP.InputReplayVerificationController, - uLoopMCP.Tests.Demo + UnityCLILoop.Tests.Demo m_MethodName: OnCompareLogs m_Mode: 0 m_Arguments: diff --git a/Assets/Scenes/SimulateMouseDemoScene.unity b/Assets/Scenes/SimulateMouseDemoScene.unity index 56de8a3644..8d0f6bc9be 100644 --- a/Assets/Scenes/SimulateMouseDemoScene.unity +++ b/Assets/Scenes/SimulateMouseDemoScene.unity @@ -714,7 +714,7 @@ MonoBehaviour: m_Calls: - m_Target: {fileID: 801584489} m_TargetAssemblyTypeName: io.github.hatayama.uLoopMCP.ReplayVerificationControllerBase, - uLoopMCP.Tests.Demo + UnityCLILoop.Tests.Demo m_MethodName: OnCompareLogs m_Mode: 0 m_Arguments: @@ -1019,7 +1019,7 @@ MonoBehaviour: m_Calls: - m_Target: {fileID: 801584489} m_TargetAssemblyTypeName: io.github.hatayama.uLoopMCP.ReplayVerificationControllerBase, - uLoopMCP.Tests.Demo + UnityCLILoop.Tests.Demo m_MethodName: OnSaveRecordingLog m_Mode: 0 m_Arguments: @@ -1861,7 +1861,7 @@ MonoBehaviour: m_Calls: - m_Target: {fileID: 801584489} m_TargetAssemblyTypeName: io.github.hatayama.uLoopMCP.ReplayVerificationControllerBase, - uLoopMCP.Tests.Demo + UnityCLILoop.Tests.Demo m_MethodName: OnSaveReplayLog m_Mode: 0 m_Arguments: diff --git a/Assets/Tests/Demo/Editor/UnityCLILoop.Tests.Demo.Editor.asmdef b/Assets/Tests/Demo/Editor/UnityCLILoop.Tests.Demo.Editor.asmdef index ad592d10a5..abbfea1c10 100644 --- a/Assets/Tests/Demo/Editor/UnityCLILoop.Tests.Demo.Editor.asmdef +++ b/Assets/Tests/Demo/Editor/UnityCLILoop.Tests.Demo.Editor.asmdef @@ -1,5 +1,5 @@ { - "name": "uLoopMCP.Tests.Demo.Editor", + "name": "UnityCLILoop.Tests.Demo.Editor", "rootNamespace": "io.github.hatayama.UnityCliLoop.Tests.Demo.Editor", "references": [ "GUID:6399a27a6ac3945be87994ba344509be", diff --git a/Assets/Tests/Demo/UnityCLILoop.Tests.Demo.asmdef b/Assets/Tests/Demo/UnityCLILoop.Tests.Demo.asmdef index e2a8203bd1..7a3095b9c0 100644 --- a/Assets/Tests/Demo/UnityCLILoop.Tests.Demo.asmdef +++ b/Assets/Tests/Demo/UnityCLILoop.Tests.Demo.asmdef @@ -1,5 +1,5 @@ { - "name": "uLoopMCP.Tests.Demo", + "name": "UnityCLILoop.Tests.Demo", "rootNamespace": "io.github.hatayama.UnityCliLoop.Tests.Demo", "references": [ "GUID:75469ad4d38634e559750d17036d5f7c", diff --git a/Assets/Tests/Editor/OnionAssemblyDependencyTests.cs b/Assets/Tests/Editor/OnionAssemblyDependencyTests.cs index 5978abf01d..74cf5b2cc5 100644 --- a/Assets/Tests/Editor/OnionAssemblyDependencyTests.cs +++ b/Assets/Tests/Editor/OnionAssemblyDependencyTests.cs @@ -117,6 +117,19 @@ public void ProjectAsmdefFileNames_WhenLoaded_UseUnityCliLoopName() Assert.That(legacyFileNames, Is.Empty); } + [Test] + public void ProjectAsmdefNames_WhenLoaded_UseUnityCliLoopName() + { + // Tests that tracked asmdef assembly names no longer expose the legacy project name. + string[] legacyAssemblyNames = ReadProjectAsmdefPaths() + .Select(ReadAsmdefName) + .Where(assemblyName => assemblyName.IndexOf("uLoopMCP", StringComparison.Ordinal) >= 0) + .OrderBy(assemblyName => assemblyName) + .ToArray(); + + Assert.That(legacyAssemblyNames, Is.Empty); + } + [Test] public void ProjectAsmdefs_WhenLoaded_AutoReferenceOnlyPublicToolContracts() { diff --git a/Assets/Tests/Editor/ThirdPartyToolMigrationFileServiceTests.cs b/Assets/Tests/Editor/ThirdPartyToolMigrationFileServiceTests.cs index 65ff00d9db..71ed355e8a 100644 --- a/Assets/Tests/Editor/ThirdPartyToolMigrationFileServiceTests.cs +++ b/Assets/Tests/Editor/ThirdPartyToolMigrationFileServiceTests.cs @@ -332,6 +332,36 @@ public static void Register(object tool) } } + [Test] + public void ApplyMigration_WhenLegacyRuntimeAsmdefNameExists_RewritesToRuntimeReference() + { + // Verifies that old name-based runtime references survive the runtime asmdef rename. + string projectRoot = CreateProjectRoot(); + try + { + string toolDirectory = Path.Combine(projectRoot, "Assets", "VendorTools"); + Directory.CreateDirectory(toolDirectory); + string asmdefPath = Path.Combine(toolDirectory, "VendorTools.asmdef"); + File.WriteAllText(asmdefPath, @"{ + ""name"": ""VendorTools"", + ""references"": [ + ""uLoopMCP.Runtime"" + ] +}"); + + ThirdPartyToolMigrationFileService service = new(); + ThirdPartyToolMigrationResult result = service.ApplyMigration(projectRoot); + + Assert.That(result.FileCount, Is.EqualTo(1)); + Assert.That(File.ReadAllText(asmdefPath), Does.Contain("GUID:c956a21f824994ef087b6de566690b3d")); + Assert.That(File.ReadAllText(asmdefPath), Does.Not.Contain("uLoopMCP.Runtime")); + } + finally + { + Directory.Delete(projectRoot, recursive: true); + } + } + [Test] public void ApplyMigration_WhenCurrentManualRegistrationExistsWithLegacyAsmdefGuid_AddsContractReferences() { diff --git a/Assets/Tests/Editor/ThirdPartyToolMigrationRulesTests.cs b/Assets/Tests/Editor/ThirdPartyToolMigrationRulesTests.cs index 812c905e40..2a484b15a5 100644 --- a/Assets/Tests/Editor/ThirdPartyToolMigrationRulesTests.cs +++ b/Assets/Tests/Editor/ThirdPartyToolMigrationRulesTests.cs @@ -1185,6 +1185,31 @@ public void MigrateAsmdefSource_WhenLegacyReferenceIsUsed_RewritesToToolContract Assert.That(result.ReplacementCount, Is.EqualTo(1)); } + [Test] + public void MigrateAsmdefSource_WhenLegacyRuntimeReferenceIsUsed_RewritesToRuntimeGuid() + { + // Verifies that old runtime assembly name references keep resolving after the asmdef rename. + string source = @"{ + ""name"": ""MyCompany.Tools"", + ""references"": [ + ""uLoopMCP.Runtime"" + ] +}"; + + ThirdPartyToolMigrationContentResult result = + ThirdPartyToolMigrationRules.MigrateAsmdefSource( + source, + hasLegacyCSharpSource: false, + requiresToolContractsReference: false, + requiresApplicationReference: false, + requiresDomainReference: false); + + Assert.That(result.Changed, Is.True); + Assert.That(result.Content, Does.Contain("GUID:c956a21f824994ef087b6de566690b3d")); + Assert.That(result.Content, Does.Not.Contain("uLoopMCP.Runtime")); + Assert.That(result.ReplacementCount, Is.EqualTo(1)); + } + [Test] public void MigrateAsmdefSource_WhenOnlyLegacyGuidIsUsedWithoutLegacySource_KeepsContent() { diff --git a/Assets/Tests/Editor/UnityCLILoop.Tests.Editor.asmdef b/Assets/Tests/Editor/UnityCLILoop.Tests.Editor.asmdef index c851d42241..f8562f30b4 100644 --- a/Assets/Tests/Editor/UnityCLILoop.Tests.Editor.asmdef +++ b/Assets/Tests/Editor/UnityCLILoop.Tests.Editor.asmdef @@ -1,5 +1,5 @@ { - "name": "uLoopMCP.Tests.Editor", + "name": "UnityCLILoop.Tests.Editor", "rootNamespace": "io.github.hatayama.UnityCliLoop.Tests.Editor", "references": [ "GUID:214998e563c124e8a88199b2dd1f522d", diff --git a/Assets/Tests/PlayMode/UnityCLILoop.Tests.PlayMode.asmdef b/Assets/Tests/PlayMode/UnityCLILoop.Tests.PlayMode.asmdef index 5f1a94216c..fd43ec1da1 100644 --- a/Assets/Tests/PlayMode/UnityCLILoop.Tests.PlayMode.asmdef +++ b/Assets/Tests/PlayMode/UnityCLILoop.Tests.PlayMode.asmdef @@ -1,5 +1,5 @@ { - "name": "uLoopMCP.Tests.PlayMode", + "name": "UnityCLILoop.Tests.PlayMode", "rootNamespace": "io.github.hatayama.UnityCliLoop.Tests.PlayMode", "references": [ "GUID:27619889b8ba8c24980f49ee34dbb44a", diff --git a/Assets/Tests/_Test_For_Test_/UnityCLILoop.test_for_test.Editor.asmdef b/Assets/Tests/_Test_For_Test_/UnityCLILoop.test_for_test.Editor.asmdef index f20cc2f65b..9d5833ff02 100644 --- a/Assets/Tests/_Test_For_Test_/UnityCLILoop.test_for_test.Editor.asmdef +++ b/Assets/Tests/_Test_For_Test_/UnityCLILoop.test_for_test.Editor.asmdef @@ -1,5 +1,5 @@ { - "name": "uLoopMCP.test_for_test.Editor", + "name": "UnityCLILoop.test_for_test.Editor", "rootNamespace": "io.github.hatayama.UnityCliLoop.Tests.TestForTest", "references": [ "GUID:214998e563c124e8a88199b2dd1f522d", diff --git a/Packages/src/Editor/Application/AssemblyInfo.cs b/Packages/src/Editor/Application/AssemblyInfo.cs index feca3bc3b5..e08bb6b3e9 100644 --- a/Packages/src/Editor/Application/AssemblyInfo.cs +++ b/Packages/src/Editor/Application/AssemblyInfo.cs @@ -1,9 +1,9 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Dev")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Dev")] [assembly: InternalsVisibleTo("UnityCLILoop.CompositionRoot.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.Infrastructure")] [assembly: InternalsVisibleTo("UnityCLILoop.Presentation")] diff --git a/Packages/src/Editor/CompositionRoot/AssemblyInfo.cs b/Packages/src/Editor/CompositionRoot/AssemblyInfo.cs index 2e00e843aa..dfa2c7f965 100644 --- a/Packages/src/Editor/CompositionRoot/AssemblyInfo.cs +++ b/Packages/src/Editor/CompositionRoot/AssemblyInfo.cs @@ -1,3 +1,3 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] diff --git a/Packages/src/Editor/Domain/AssemblyInfo.cs b/Packages/src/Editor/Domain/AssemblyInfo.cs index 773051089a..a6bcec3a02 100644 --- a/Packages/src/Editor/Domain/AssemblyInfo.cs +++ b/Packages/src/Editor/Domain/AssemblyInfo.cs @@ -1,8 +1,8 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Dev")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Dev")] [assembly: InternalsVisibleTo("UnityCLILoop.Application")] [assembly: InternalsVisibleTo("UnityCLILoop.CompositionRoot.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/ClearConsole/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/ClearConsole/AssemblyInfo.cs index eec5b228fa..d95a6d1c48 100644 --- a/Packages/src/Editor/FirstPartyTools/ClearConsole/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/ClearConsole/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/Common/Console/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/Common/Console/AssemblyInfo.cs index 77bc8159c1..5608ebb211 100644 --- a/Packages/src/Editor/FirstPartyTools/Common/Console/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/Common/Console/AssemblyInfo.cs @@ -4,6 +4,6 @@ [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.ClearConsole.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Compile.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.GetLogs.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/Common/EditorUtility/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/Common/EditorUtility/AssemblyInfo.cs index 680c7bf3f5..234a118c01 100644 --- a/Packages/src/Editor/FirstPartyTools/Common/EditorUtility/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/Common/EditorUtility/AssemblyInfo.cs @@ -3,6 +3,6 @@ [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Compile.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.RunTests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/Common/InputRecording/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/Common/InputRecording/AssemblyInfo.cs index 95087086e9..bc9553b7cc 100644 --- a/Packages/src/Editor/FirstPartyTools/Common/InputRecording/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/Common/InputRecording/AssemblyInfo.cs @@ -3,6 +3,6 @@ [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.RecordInput.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.ReplayInput.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/Common/InputSimulation/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/Common/InputSimulation/AssemblyInfo.cs index b619b2ca3e..4415b53173 100644 --- a/Packages/src/Editor/FirstPartyTools/Common/InputSimulation/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/Common/InputSimulation/AssemblyInfo.cs @@ -4,6 +4,6 @@ [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.SimulateKeyboard.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.SimulateMouseInput.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.SimulateMouseUi.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/Common/InputSystem/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/Common/InputSystem/AssemblyInfo.cs index f11b1d6eb1..1218d431bd 100644 --- a/Packages/src/Editor/FirstPartyTools/Common/InputSystem/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/Common/InputSystem/AssemblyInfo.cs @@ -6,6 +6,6 @@ [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.ReplayInput.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.SimulateKeyboard.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.SimulateMouseInput.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/Common/MouseUi/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/Common/MouseUi/AssemblyInfo.cs index 180e4b892a..3bfbc123a2 100644 --- a/Packages/src/Editor/FirstPartyTools/Common/MouseUi/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/Common/MouseUi/AssemblyInfo.cs @@ -5,6 +5,6 @@ [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.ReplayInput.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Screenshot.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.SimulateMouseUi.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/Common/Overlay/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/Common/Overlay/AssemblyInfo.cs index 69e1f04ba4..3976368411 100644 --- a/Packages/src/Editor/FirstPartyTools/Common/Overlay/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/Common/Overlay/AssemblyInfo.cs @@ -7,6 +7,6 @@ [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.SimulateKeyboard.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.SimulateMouseInput.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.SimulateMouseUi.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/Compile/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/Compile/AssemblyInfo.cs index eec5b228fa..d95a6d1c48 100644 --- a/Packages/src/Editor/FirstPartyTools/Compile/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/Compile/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/ControlPlayMode/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/ControlPlayMode/AssemblyInfo.cs index eec5b228fa..d95a6d1c48 100644 --- a/Packages/src/Editor/FirstPartyTools/ControlPlayMode/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/ControlPlayMode/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/AssemblyInfo.cs index eec5b228fa..d95a6d1c48 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/DynamicCodeCompilationServiceFactory.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/DynamicCodeCompilationServiceFactory.cs index b83fafcb83..0ad3ad4caf 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/DynamicCodeCompilationServiceFactory.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/DynamicCodeCompilationServiceFactory.cs @@ -2,7 +2,7 @@ using io.github.hatayama.UnityCliLoop.ToolContracts; using io.github.hatayama.UnityCliLoop.Domain; -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] namespace io.github.hatayama.UnityCliLoop.FirstPartyTools { diff --git a/Packages/src/Editor/FirstPartyTools/FindGameObjects/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/FindGameObjects/AssemblyInfo.cs index eec5b228fa..d95a6d1c48 100644 --- a/Packages/src/Editor/FirstPartyTools/FindGameObjects/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/FindGameObjects/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/GetHierarchy/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/GetHierarchy/AssemblyInfo.cs index eec5b228fa..d95a6d1c48 100644 --- a/Packages/src/Editor/FirstPartyTools/GetHierarchy/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/GetHierarchy/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/GetLogs/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/GetLogs/AssemblyInfo.cs index eec5b228fa..d95a6d1c48 100644 --- a/Packages/src/Editor/FirstPartyTools/GetLogs/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/GetLogs/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/RecordInput/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/RecordInput/AssemblyInfo.cs index eec5b228fa..d95a6d1c48 100644 --- a/Packages/src/Editor/FirstPartyTools/RecordInput/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/RecordInput/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/ReplayInput/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/ReplayInput/AssemblyInfo.cs index ed4f6848e7..1f73975649 100644 --- a/Packages/src/Editor/FirstPartyTools/ReplayInput/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/ReplayInput/AssemblyInfo.cs @@ -2,6 +2,6 @@ [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.RecordInput.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/RunTests/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/RunTests/AssemblyInfo.cs index 27efaa42f1..13edc5b462 100644 --- a/Packages/src/Editor/FirstPartyTools/RunTests/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/RunTests/AssemblyInfo.cs @@ -2,6 +2,6 @@ [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.RunTests.TestFramework.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/RunTests/TestFramework/NUnitXmlResultExporter.cs b/Packages/src/Editor/FirstPartyTools/RunTests/TestFramework/NUnitXmlResultExporter.cs index b464ab1166..5cf042ed63 100644 --- a/Packages/src/Editor/FirstPartyTools/RunTests/TestFramework/NUnitXmlResultExporter.cs +++ b/Packages/src/Editor/FirstPartyTools/RunTests/TestFramework/NUnitXmlResultExporter.cs @@ -10,7 +10,7 @@ using io.github.hatayama.UnityCliLoop.ToolContracts; -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] namespace io.github.hatayama.UnityCliLoop.FirstPartyTools { diff --git a/Packages/src/Editor/FirstPartyTools/RunTests/TestRunner/TestExecutionFilter.cs b/Packages/src/Editor/FirstPartyTools/RunTests/TestRunner/TestExecutionFilter.cs index 9a20f6cffb..bc2d0605b7 100644 --- a/Packages/src/Editor/FirstPartyTools/RunTests/TestRunner/TestExecutionFilter.cs +++ b/Packages/src/Editor/FirstPartyTools/RunTests/TestRunner/TestExecutionFilter.cs @@ -43,7 +43,7 @@ public class TestExecutionFilter /// Examples: /// • When FilterType is Exact: "io.github.hatayama.UnityCliLoop.ConsoleLogRetrieverTests.GetAllLogs_WithMaskAllOff_StillReturnsAllLogs" /// • When FilterType is Regex: "io.github.hatayama.UnityCliLoop.ConsoleLogRetrieverTests" or "io.github.hatayama.UnityCliLoop" - /// • When FilterType is AssemblyName: "uLoopMCP.Tests.Editor" + /// • When FilterType is AssemblyName: "UnityCLILoop.Tests.Editor" /// public string FilterValue { get; } diff --git a/Packages/src/Editor/FirstPartyTools/Screenshot/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/Screenshot/AssemblyInfo.cs index eec5b228fa..d95a6d1c48 100644 --- a/Packages/src/Editor/FirstPartyTools/Screenshot/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/Screenshot/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/SimulateKeyboard/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/SimulateKeyboard/AssemblyInfo.cs index eec5b228fa..d95a6d1c48 100644 --- a/Packages/src/Editor/FirstPartyTools/SimulateKeyboard/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/SimulateKeyboard/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/SimulateMouseInput/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/SimulateMouseInput/AssemblyInfo.cs index eec5b228fa..d95a6d1c48 100644 --- a/Packages/src/Editor/FirstPartyTools/SimulateMouseInput/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/SimulateMouseInput/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/AssemblyInfo.cs b/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/AssemblyInfo.cs index eec5b228fa..d95a6d1c48 100644 --- a/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/AssemblyInfo.cs +++ b/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("UnityCLILoop.FirstPartyTools.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.PlayMode")] -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Demo.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.PlayMode")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Demo.Editor")] diff --git a/Packages/src/Editor/Infrastructure/AssemblyInfo.cs b/Packages/src/Editor/Infrastructure/AssemblyInfo.cs index 0b7dbdc127..de48d60e19 100644 --- a/Packages/src/Editor/Infrastructure/AssemblyInfo.cs +++ b/Packages/src/Editor/Infrastructure/AssemblyInfo.cs @@ -1,4 +1,4 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] [assembly: InternalsVisibleTo("UnityCLILoop.CompositionRoot.Editor")] diff --git a/Packages/src/Editor/Infrastructure/ThirdPartyToolMigration/ThirdPartyToolMigrationRules.cs b/Packages/src/Editor/Infrastructure/ThirdPartyToolMigration/ThirdPartyToolMigrationRules.cs index bf719b06a2..104a063930 100644 --- a/Packages/src/Editor/Infrastructure/ThirdPartyToolMigration/ThirdPartyToolMigrationRules.cs +++ b/Packages/src/Editor/Infrastructure/ThirdPartyToolMigration/ThirdPartyToolMigrationRules.cs @@ -21,12 +21,15 @@ internal static class ThirdPartyToolMigrationRules internal const string CurrentApplicationNamespace = "io.github.hatayama.UnityCliLoop.Application"; internal const string CurrentDomainNamespace = "io.github.hatayama.UnityCliLoop.Domain"; internal const string LegacyEditorAssemblyName = "uLoopMCP.Editor"; + internal const string LegacyRuntimeAssemblyName = "uLoopMCP.Runtime"; private const string CurrentApplicationAssemblyName = "UnityCLILoop.Application"; private const string CurrentDomainAssemblyName = "UnityCLILoop.Domain"; + private const string CurrentRuntimeAssemblyName = "UnityCLILoop.Runtime"; private const string CurrentToolContractsAssemblyName = "UnityCLILoop.ToolContracts"; internal const string LegacyEditorAssemblyGuidReference = "GUID:214998e563c124e8a88199b2dd1f522d"; internal const string CurrentApplicationGuidReference = "GUID:214998e563c124e8a88199b2dd1f522d"; internal const string CurrentDomainGuidReference = "GUID:5c4588558a3624eacbce0f50007cf1eb"; + internal const string CurrentRuntimeGuidReference = "GUID:c956a21f824994ef087b6de566690b3d"; internal const string CurrentToolContractsGuidReference = "GUID:fc3fd32eddbee40e39c2d76dc184957b"; private const string DescriptionAttributeArgumentName = "Description"; private const string DisplayDevelopmentOnlyAttributeArgumentName = "DisplayDevelopmentOnly"; @@ -419,14 +422,16 @@ internal static bool ContainsLegacyMigrationCandidateText(string source) Debug.Assert(source != null, "source must not be null"); return ContainsTextFragment(source, LegacyNamespace) || - ContainsTextFragment(source, LegacyEditorAssemblyName); + ContainsTextFragment(source, LegacyEditorAssemblyName) || + ContainsTextFragment(source, LegacyRuntimeAssemblyName); } internal static bool ContainsLegacyAsmdefNameReference(string source) { Debug.Assert(source != null, "source must not be null"); - if (!ContainsTextFragment(source, LegacyEditorAssemblyName)) + if (!ContainsTextFragment(source, LegacyEditorAssemblyName) && + !ContainsTextFragment(source, LegacyRuntimeAssemblyName)) { return false; } @@ -440,7 +445,8 @@ internal static bool ContainsLegacyAsmdefNameReference(string source) foreach (JToken reference in references) { string referenceValue = reference.Value() ?? string.Empty; - if (string.Equals(referenceValue, LegacyEditorAssemblyName, StringComparison.Ordinal)) + if (string.Equals(referenceValue, LegacyEditorAssemblyName, StringComparison.Ordinal) || + string.Equals(referenceValue, LegacyRuntimeAssemblyName, StringComparison.Ordinal)) { return true; } @@ -676,6 +682,11 @@ private static string[] GetMigratedAsmdefReferences( return GetMigratedLegacyEditorReferences(requiresApplicationReference, requiresDomainReference); } + if (string.Equals(reference, LegacyRuntimeAssemblyName, StringComparison.Ordinal)) + { + return new[] { CurrentRuntimeGuidReference }; + } + if (hasLegacyCSharpSource && string.Equals(reference, LegacyEditorAssemblyGuidReference, StringComparison.Ordinal)) { @@ -770,6 +781,14 @@ private static string GetCurrentAsmdefReferenceKey(string reference) { Debug.Assert(!string.IsNullOrEmpty(reference), "reference must not be null or empty"); + if (IsCurrentAsmdefReference( + reference, + CurrentRuntimeAssemblyName, + CurrentRuntimeGuidReference)) + { + return CurrentRuntimeAssemblyName; + } + if (IsCurrentAsmdefReference( reference, CurrentToolContractsAssemblyName, diff --git a/Packages/src/Editor/Presentation/UnityCliLoopSettingsWindowEventHandler.cs b/Packages/src/Editor/Presentation/UnityCliLoopSettingsWindowEventHandler.cs index ea8c511c71..43e3a416b7 100644 --- a/Packages/src/Editor/Presentation/UnityCliLoopSettingsWindowEventHandler.cs +++ b/Packages/src/Editor/Presentation/UnityCliLoopSettingsWindowEventHandler.cs @@ -5,7 +5,7 @@ using io.github.hatayama.UnityCliLoop.Application; using io.github.hatayama.UnityCliLoop.Domain; -[assembly: InternalsVisibleTo("uLoopMCP.Tests.Editor")] +[assembly: InternalsVisibleTo("UnityCLILoop.Tests.Editor")] namespace io.github.hatayama.UnityCliLoop.Presentation { diff --git a/Packages/src/Runtime/UnityCLILoop.Runtime.asmdef b/Packages/src/Runtime/UnityCLILoop.Runtime.asmdef index 690b4c8821..faa5ac4c53 100644 --- a/Packages/src/Runtime/UnityCLILoop.Runtime.asmdef +++ b/Packages/src/Runtime/UnityCLILoop.Runtime.asmdef @@ -1,5 +1,5 @@ { - "name": "uLoopMCP.Runtime", + "name": "UnityCLILoop.Runtime", "rootNamespace": "io.github.hatayama.UnityCliLoop.Runtime", "references": [], "includePlatforms": [], From 94f90ece96898300e4a37532392d04ca860f6103 Mon Sep 17 00:00:00 2001 From: hatayama Date: Thu, 28 May 2026 09:10:18 +0900 Subject: [PATCH 3/3] Fix tool contract tests during run-tests execution Run the sample tool assertions through an isolated execution service so the tests no longer contend with the shared run-tests execution slot. --- .../Editor/UnityCliLoopToolRegistryTests.cs | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Assets/Tests/Editor/UnityCliLoopToolRegistryTests.cs b/Assets/Tests/Editor/UnityCliLoopToolRegistryTests.cs index 275504d41c..59444266d5 100644 --- a/Assets/Tests/Editor/UnityCliLoopToolRegistryTests.cs +++ b/Assets/Tests/Editor/UnityCliLoopToolRegistryTests.cs @@ -347,32 +347,39 @@ public void Constructor_WhenSampleToolUsesToolContractsAssembly_RegistersAsThird } [Test] - public async Task ExecuteCommandAsync_WhenSampleToolUsesTypedContract_ReturnsTypedResponse() + public async Task ExecuteToolAsync_WhenSampleToolUsesTypedContract_ReturnsTypedResponse() { - // Tests that third-party sample tools execute through the same typed contract path as bundled tools. + // Tests that third-party sample tools deserialize camelCase JSON into typed schema values. + UnityCliLoopToolRegistry registry = ToolRegistryTestFactory.Create(); + UnityCliLoopToolExecutionService executionService = new(); JObject parameters = JObject.FromObject(new { - name = "Masamichi", + name = "", language = "french", includeTimestamp = false }); - UnityCliLoopToolResponse response = await UnityApiHandler.ExecuteCommandAsync( + UnityCliLoopToolResponse response = await executionService.ExecuteToolAsync( + registry, "hello-world", parameters, CancellationToken.None); JObject serializedResponse = JObject.FromObject(response); - Assert.That(serializedResponse.Value("Message"), Is.EqualTo("Bonjour, Masamichi!")); + Assert.That(serializedResponse.Value("Message"), Is.EqualTo("Bonjour, !")); Assert.That(serializedResponse.Value("Language"), Is.EqualTo("french")); Assert.That(serializedResponse["Timestamp"]?.Type, Is.EqualTo(JTokenType.Null)); } [Test] - public async Task ExecuteCommandAsync_WhenParamsAreOmitted_UsesDefaultSchema() + public async Task ExecuteToolAsync_WhenParamsAreOmitted_UsesDefaultSchema() { - // Tests that JSON-RPC requests may omit params and still use schema defaults. - UnityCliLoopToolResponse response = await UnityApiHandler.ExecuteCommandAsync( + // Tests that tool execution may omit params and still use schema defaults. + UnityCliLoopToolRegistry registry = ToolRegistryTestFactory.Create(); + UnityCliLoopToolExecutionService executionService = new(); + + UnityCliLoopToolResponse response = await executionService.ExecuteToolAsync( + registry, "hello-world", null, CancellationToken.None);