remove SyncSolution
This commit is contained in:
parent
455f64f72c
commit
e2ea2241e5
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 3343c43624a31f447a1961156a2cac6e
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 07e92c78d576a8a458ce4a298eeb512d
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "AsmdefHelper.SyncSolution.Editor",
|
|
||||||
"references": [
|
|
||||||
"GUID:211243abc45174c45b3a6c275ea126b9"
|
|
||||||
],
|
|
||||||
"includePlatforms": [
|
|
||||||
"Editor"
|
|
||||||
],
|
|
||||||
"excludePlatforms": [],
|
|
||||||
"allowUnsafeCode": false,
|
|
||||||
"overrideReferences": false,
|
|
||||||
"precompiledReferences": [],
|
|
||||||
"autoReferenced": true,
|
|
||||||
"defineConstraints": [],
|
|
||||||
"versionDefines": [],
|
|
||||||
"noEngineReferences": false
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: dcfd308825181f346bc76cac8ae79330
|
|
||||||
AssemblyDefinitionImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1,57 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
|
||||||
using AsmdefHelper.UnityInternal;
|
|
||||||
|
|
||||||
// https://forum.unity.com/threads/solved-unity-not-generating-sln-file-from-assets-open-c-project.538487/
|
|
||||||
// Thank you Flexford!
|
|
||||||
namespace AsmdefHelper.SyncSolution.Editor {
|
|
||||||
public static class SyncSolutionUtilities {
|
|
||||||
|
|
||||||
[MenuItem("AsmdefHelper/Sync C# Solution", priority = 3000)]
|
|
||||||
public static void Sync() {
|
|
||||||
Sync(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void Sync(bool logsEnabled) {
|
|
||||||
CleanOldFiles(logsEnabled);
|
|
||||||
Call_SyncSolution(logsEnabled);
|
|
||||||
Call_SynchronizerSync(logsEnabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void CleanOldFiles(bool logsEnabled) {
|
|
||||||
var assetsDirectoryInfo = new DirectoryInfo(Application.dataPath);
|
|
||||||
var projectDirectoryInfo = assetsDirectoryInfo.Parent;
|
|
||||||
|
|
||||||
var files = GetFilesByExtensions(projectDirectoryInfo, "*.sln", "*.csproj");
|
|
||||||
foreach (var file in files) {
|
|
||||||
if (logsEnabled) {
|
|
||||||
Debug.Log($"Remove old solution file: {file.Name}");
|
|
||||||
}
|
|
||||||
file.Delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void Call_SyncSolution(bool logsEnabled) {
|
|
||||||
if (logsEnabled) {
|
|
||||||
Debug.Log($"Coll method: SyncVS.Sync()");
|
|
||||||
}
|
|
||||||
SolutionSynchronizerWrapper.SyncSolution();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void Call_SynchronizerSync(bool logsEnabled) {
|
|
||||||
if (logsEnabled) {
|
|
||||||
Debug.Log($"Coll method: SyncVS.Synchronizer.Sync()");
|
|
||||||
}
|
|
||||||
SolutionSynchronizerWrapper.SynchronizerSync();
|
|
||||||
}
|
|
||||||
|
|
||||||
static IEnumerable<FileInfo> GetFilesByExtensions(DirectoryInfo dir, params string[] extensions) {
|
|
||||||
extensions = extensions ?? new[] { "*" };
|
|
||||||
var files = Enumerable.Empty<FileInfo>();
|
|
||||||
return extensions.Aggregate(files, (current, ext) => current.Concat(dir.GetFiles(ext)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: e5785f4c5d9ed634799d54e96aabf408
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -1,22 +0,0 @@
|
|||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: aeb995b6396143f58028eb4aa639c7c4
|
|
||||||
timeCreated: 1586952223
|
|
Loading…
x
Reference in New Issue
Block a user