SyncSolutionとUnityInternalAPIの依存を整理

This commit is contained in:
nakano yosuke 2020-04-15 21:13:20 +09:00
parent 5c506077af
commit 8647512e83
8 changed files with 79 additions and 22 deletions

View File

@ -10,6 +10,7 @@
<e p="AsmdefHelper.Example.Hoge.csproj" t="IncludeRecursive" /> <e p="AsmdefHelper.Example.Hoge.csproj" t="IncludeRecursive" />
<e p="AsmdefHelper.Example.Piyo.csproj" t="IncludeRecursive" /> <e p="AsmdefHelper.Example.Piyo.csproj" t="IncludeRecursive" />
<e p="AsmdefHelper.sln" t="IncludeFlat" /> <e p="AsmdefHelper.sln" t="IncludeFlat" />
<e p="AsmdefHelper.SyncSolution.Editor.csproj" t="IncludeRecursive" />
<e p="Assets" t="Include"> <e p="Assets" t="Include">
<e p="AsmdefHelper" t="Include"> <e p="AsmdefHelper" t="Include">
<e p="DependencyGraph" t="Include"> <e p="DependencyGraph" t="Include">
@ -45,11 +46,12 @@
</e> </e>
<e p="SyncSolution" t="Include"> <e p="SyncSolution" t="Include">
<e p="Editor" t="Include"> <e p="Editor" t="Include">
<e p="AsmdefHelper.SyncSolution.Editor.asmref" t="Include" /> <e p="AsmdefHelper.SyncSolution.Editor.asmdef" t="Include" />
<e p="SyncSolutionUtilities.cs" t="Include" /> <e p="SyncSolutionUtilities.cs" t="Include" />
</e> </e>
</e> </e>
<e p="Unity.InternalAPIEditorBridgeDev.001" t="Include"> <e p="Unity.InternalAPIEditorBridgeDev.001" t="Include">
<e p="SolutionSynchronizerWrapper.cs" t="Include" />
<e p="Unity.InternalAPIEditorBridgeDev.001.asmdef" t="Include" /> <e p="Unity.InternalAPIEditorBridgeDev.001.asmdef" t="Include" />
</e> </e>
</e> </e>

View File

@ -2,9 +2,13 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="f71251e0-52ab-4cea-859f-4c363c01a121" name="Default Changelist" comment=""> <list default="true" id="f71251e0-52ab-4cea-859f-4c363c01a121" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/Assets/AsmdefHelper/Unity.InternalAPIEditorBridgeDev.001/SolutionSynchronizerWrapper.cs" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Assets/AsmdefHelper/Unity.InternalAPIEditorBridgeDev.001/SolutionSynchronizerWrapper.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.AsmdefHelper/.idea/contentModel.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.AsmdefHelper/.idea/contentModel.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.AsmdefHelper/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.AsmdefHelper/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/.idea.AsmdefHelper/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.AsmdefHelper/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/AsmdefHelper/DependencyGraph/Editor/AsmdefGraphEditorWindow.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/AsmdefHelper/DependencyGraph/Editor/AsmdefGraphEditorWindow.cs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/AsmdefHelper/SyncSolution.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/AsmdefHelper/MultipleEdit/Editor/AsmdefMultiEditWindow.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/AsmdefHelper/MultipleEdit/Editor/AsmdefMultiEditWindow.cs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/AsmdefHelper/SyncSolution/Editor/AsmdefHelper.SyncSolution.Editor.asmref" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/AsmdefHelper/SyncSolution/Editor/AsmdefHelper.SyncSolution.Editor.asmref.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/AsmdefHelper/SyncSolution/Editor/SyncSolutionUtilities.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/AsmdefHelper/SyncSolution/Editor/SyncSolutionUtilities.cs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/AsmdefHelper/SyncSolution/Editor/SyncSolutionUtilities.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/AsmdefHelper/SyncSolution/Editor/SyncSolutionUtilities.cs" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -16,16 +20,18 @@
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
<component name="HighlightingSettingsPerFile"> <component name="HighlightingSettingsPerFile">
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/Unity.InternalAPIEditorBridgeDev.001/Unity.InternalAPIEditorBridgeDev.001.asmdef" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/SyncSolution/Editor/SyncSolutionUtilities.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/Example/Hoge/NewBehaviourScript.cs" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/Example/Hoge/NewBehaviourScript.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/DependencyGraph/Editor/AsmdefGraphEditorWindow.cs" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/DependencyGraph/Editor/AsmdefGraphEditorWindow.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/DependencyGraph/Editor/AsmdefGraphView.cs" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/DependencyGraph/Editor/AsmdefGraphView.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/Example/NewBehaviourScript.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/Example/Fuga/NewBehaviourScript.cs" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/Example/Fuga/NewBehaviourScript.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/SyncSolution/Editor/AsmdefHelper.SyncSolution.Editor.asmdef" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/DependencyGraph/Editor/AsmdefDependency.cs" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/DependencyGraph/Editor/AsmdefDependency.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/SyncSolution/Editor/SyncSolutionUtilities.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/Example/Piyo/NewBehaviourScript.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/MultipleEdit/Editor/AsmdefMultiEditWindow.cs" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/MultipleEdit/Editor/AsmdefMultiEditWindow.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/Unity.InternalAPIEditorBridgeDev.001/SolutionSynchronizerWrapper.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/Unity.InternalAPIEditorBridgeDev.001/Unity.InternalAPIEditorBridgeDev.001.asmdef" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/Example/NewBehaviourScript.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/Example/Piyo/NewBehaviourScript.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/DependencyGraph/Editor/AsmdefNode.cs" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Assets/AsmdefHelper/DependencyGraph/Editor/AsmdefNode.cs" root0="FORCE_HIGHLIGHTING" />
</component> </component>
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
@ -39,8 +45,11 @@
<option value="$PROJECT_DIR$/Assets/AsmdefHelper/Example/Hoge/NewBehaviourScript.cs" /> <option value="$PROJECT_DIR$/Assets/AsmdefHelper/Example/Hoge/NewBehaviourScript.cs" />
<option value="$PROJECT_DIR$/Assets/AsmdefHelper/Example/Piyo/NewBehaviourScript.cs" /> <option value="$PROJECT_DIR$/Assets/AsmdefHelper/Example/Piyo/NewBehaviourScript.cs" />
<option value="$PROJECT_DIR$/Assets/AsmdefHelper/MultipleEdit/Editor/AsmdefMultiEditWindow.cs" /> <option value="$PROJECT_DIR$/Assets/AsmdefHelper/MultipleEdit/Editor/AsmdefMultiEditWindow.cs" />
<option value="$PROJECT_DIR$/Assets/AsmdefHelper/SyncSolution/Editor/SyncSolutionUtilities.cs" />
<option value="$PROJECT_DIR$/Assets/AsmdefHelper/DependencyGraph/Editor/AsmdefGraphEditorWindow.cs" /> <option value="$PROJECT_DIR$/Assets/AsmdefHelper/DependencyGraph/Editor/AsmdefGraphEditorWindow.cs" />
<option value="$PROJECT_DIR$/Assets/AsmdefHelper/SyncSolution/Editor/UnityInternal/SolutionSynchronizerWrapper.cs" />
<option value="$PROJECT_DIR$/Assets/AsmdefHelper/SyncSolution/Editor/UnityInternal/SyncSolutionUtilities.cs" />
<option value="$PROJECT_DIR$/Assets/AsmdefHelper/Unity.InternalAPIEditorBridgeDev.001/SolutionSynchronizerWrapper.cs" />
<option value="$PROJECT_DIR$/Assets/AsmdefHelper/SyncSolution/Editor/SyncSolutionUtilities.cs" />
</list> </list>
</option> </option>
</component> </component>
@ -105,7 +114,8 @@
<workItem from="1586793017650" duration="506000" /> <workItem from="1586793017650" duration="506000" />
<workItem from="1586793564564" duration="160000" /> <workItem from="1586793564564" duration="160000" />
<workItem from="1586793758449" duration="2076000" /> <workItem from="1586793758449" duration="2076000" />
<workItem from="1586872725062" duration="502000" /> <workItem from="1586872725062" duration="657000" />
<workItem from="1586951660938" duration="989000" />
</task> </task>
<servers /> <servers />
</component> </component>
@ -114,4 +124,15 @@
</component> </component>
<component name="UnityProjectConfiguration" hasMinimizedUI="true" /> <component name="UnityProjectConfiguration" hasMinimizedUI="true" />
<component name="UnityUnitTestConfiguration" currentTestLauncher="EditMode" /> <component name="UnityUnitTestConfiguration" currentTestLauncher="EditMode" />
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
</project> </project>

View File

@ -0,0 +1,17 @@
{
"name": "AsmdefHelper.SyncSolution.Editor",
"references": [
"GUID:211243abc45174c45b3a6c275ea126b9"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 353d4308cc0c6c945a085f59650f2b11 guid: dcfd308825181f346bc76cac8ae79330
AssemblyDefinitionReferenceImporter: AssemblyDefinitionImporter:
externalObjects: {} externalObjects: {}
userData: userData:
assetBundleName: assetBundleName:

View File

@ -1,3 +0,0 @@
{
"reference": "GUID:211243abc45174c45b3a6c275ea126b9"
}

View File

@ -2,18 +2,13 @@
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using UnityEditor; using UnityEditor;
using UnityEditor.VisualStudioIntegration;
using UnityEngine; using UnityEngine;
using AsmdefHelper.UnityInternal;
// https://forum.unity.com/threads/solved-unity-not-generating-sln-file-from-assets-open-c-project.538487/ // https://forum.unity.com/threads/solved-unity-not-generating-sln-file-from-assets-open-c-project.538487/
// Thank you Flexford! // Thank you Flexford!
namespace AsmdefHelper.SyncSolution.Editor { namespace AsmdefHelper.SyncSolution.Editor {
public static class SyncSolutionUtilities { public static class SyncSolutionUtilities {
static SolutionSynchronizer synchronizer;
static SyncSolutionUtilities() {
synchronizer = SyncVS.Synchronizer;
}
[MenuItem("Window/Asmdef Helper/Sync C# Solution", priority = 3000)] [MenuItem("Window/Asmdef Helper/Sync C# Solution", priority = 3000)]
public static void Sync() { public static void Sync() {
@ -43,14 +38,14 @@ namespace AsmdefHelper.SyncSolution.Editor {
if (logsEnabled) { if (logsEnabled) {
Debug.Log($"Coll method: SyncVS.Sync()"); Debug.Log($"Coll method: SyncVS.Sync()");
} }
SyncVS.SyncSolution(); SolutionSynchronizerWrapper.SyncSolution();
} }
static void Call_SynchronizerSync(bool logsEnabled) { static void Call_SynchronizerSync(bool logsEnabled) {
if (logsEnabled) { if (logsEnabled) {
Debug.Log($"Coll method: SyncVS.Synchronizer.Sync()"); Debug.Log($"Coll method: SyncVS.Synchronizer.Sync()");
} }
synchronizer?.Sync(); SolutionSynchronizerWrapper.SynchronizerSync();
} }
static IEnumerable<FileInfo> GetFilesByExtensions(DirectoryInfo dir, params string[] extensions) { static IEnumerable<FileInfo> GetFilesByExtensions(DirectoryInfo dir, params string[] extensions) {

View File

@ -0,0 +1,22 @@
using UnityEditor;
using UnityEditor.VisualStudioIntegration;
namespace AsmdefHelper.UnityInternal {
public static class SolutionSynchronizerWrapper {
static readonly SolutionSynchronizer synchronizer;
static SolutionSynchronizerWrapper() {
synchronizer = SyncVS.Synchronizer;
}
public static void SyncSolution() {
SyncVS.SyncSolution();
}
public static void SynchronizerSync() {
synchronizer?.Sync();
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: aeb995b6396143f58028eb4aa639c7c4
timeCreated: 1586952223