update libs
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
using AssetStoreTools.Utility;
|
||||
using Newtonsoft.Json;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
|
||||
namespace AssetStoreTools.Uploader.Data.Serialization
|
||||
{
|
||||
internal class AssetPath
|
||||
{
|
||||
[JsonProperty("path")]
|
||||
private string _path = string.Empty;
|
||||
[JsonProperty("guid")]
|
||||
private string _guid = string.Empty;
|
||||
|
||||
[JsonIgnore]
|
||||
public string Path { get => _path; set { SetAssetPath(value); } }
|
||||
[JsonIgnore]
|
||||
public string Guid { get => _guid; set { _guid = value; } }
|
||||
|
||||
public AssetPath() { }
|
||||
|
||||
public AssetPath(string path)
|
||||
{
|
||||
SetAssetPath(path);
|
||||
}
|
||||
|
||||
private void SetAssetPath(string path)
|
||||
{
|
||||
_path = path.Replace("\\", "/");
|
||||
if (TryGetGuid(_path, out var guid))
|
||||
_guid = guid;
|
||||
}
|
||||
|
||||
private bool TryGetGuid(string path, out string guid)
|
||||
{
|
||||
guid = string.Empty;
|
||||
|
||||
var relativePath = FileUtility.AbsolutePathToRelativePath(path, ASToolsPreferences.Instance.EnableSymlinkSupport);
|
||||
|
||||
if (!relativePath.StartsWith("Assets/") && !relativePath.StartsWith("Packages/"))
|
||||
return false;
|
||||
|
||||
guid = AssetDatabase.AssetPathToGUID(relativePath);
|
||||
return !string.IsNullOrEmpty(guid);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
var pathFromGuid = AssetDatabase.GUIDToAssetPath(_guid);
|
||||
if (!string.IsNullOrEmpty(pathFromGuid) && (File.Exists(pathFromGuid) || Directory.Exists(pathFromGuid)))
|
||||
return pathFromGuid;
|
||||
|
||||
if (File.Exists(_path) || Directory.Exists(_path))
|
||||
return _path;
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 920ff8e4ffe77ec44bede985593cc187
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 115
|
||||
packageName: Asset Store Publishing Tools
|
||||
packageVersion: 12.0.1
|
||||
assetPath: Packages/com.unity.asset-store-tools/Editor/Uploader/Scripts/Data/Serialization/AssetPath.cs
|
||||
uploadId: 724584
|
||||
@@ -0,0 +1,77 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AssetStoreTools.Uploader.Data.Serialization
|
||||
{
|
||||
internal class AssetsWorkflowState
|
||||
{
|
||||
[JsonProperty("main_path")]
|
||||
private AssetPath _mainPath;
|
||||
[JsonProperty("special_folders")]
|
||||
private List<AssetPath> _specialFolders;
|
||||
[JsonProperty("include_dependencies")]
|
||||
private bool _includeDependencies;
|
||||
[JsonProperty("dependencies")]
|
||||
private List<string> _dependencies;
|
||||
|
||||
public AssetsWorkflowState()
|
||||
{
|
||||
_mainPath = new AssetPath();
|
||||
_includeDependencies = false;
|
||||
_dependencies = new List<string>();
|
||||
_specialFolders = new List<AssetPath>();
|
||||
}
|
||||
|
||||
public string GetMainPath()
|
||||
{
|
||||
return _mainPath?.ToString();
|
||||
}
|
||||
|
||||
public void SetMainPath(string path)
|
||||
{
|
||||
_mainPath = new AssetPath(path);
|
||||
}
|
||||
|
||||
public bool GetIncludeDependencies()
|
||||
{
|
||||
return _includeDependencies;
|
||||
}
|
||||
|
||||
public void SetIncludeDependencies(bool value)
|
||||
{
|
||||
_includeDependencies = value;
|
||||
}
|
||||
|
||||
public List<string> GetDependencies()
|
||||
{
|
||||
return _dependencies;
|
||||
}
|
||||
|
||||
public void SetDependencies(IEnumerable<string> dependencies)
|
||||
{
|
||||
_dependencies = new List<string>();
|
||||
foreach (var dependency in dependencies)
|
||||
_dependencies.Add(dependency);
|
||||
}
|
||||
|
||||
public List<string> GetSpecialFolders()
|
||||
{
|
||||
var specialFolders = new List<string>();
|
||||
foreach (var folder in _specialFolders)
|
||||
{
|
||||
var path = folder.ToString();
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
specialFolders.Add(path);
|
||||
}
|
||||
|
||||
return specialFolders;
|
||||
}
|
||||
|
||||
public void SetSpecialFolders(List<string> specialFolders)
|
||||
{
|
||||
_specialFolders = new List<AssetPath>();
|
||||
foreach (var path in specialFolders)
|
||||
_specialFolders.Add(new AssetPath(path));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 505f0a5aa753b4445a467539e150190a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 115
|
||||
packageName: Asset Store Publishing Tools
|
||||
packageVersion: 12.0.1
|
||||
assetPath: Packages/com.unity.asset-store-tools/Editor/Uploader/Scripts/Data/Serialization/AssetsWorkflowStateData.cs
|
||||
uploadId: 724584
|
||||
@@ -0,0 +1,41 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AssetStoreTools.Uploader.Data.Serialization
|
||||
{
|
||||
internal class HybridPackageWorkflowState
|
||||
{
|
||||
[JsonProperty("package_name")]
|
||||
private string _packageName;
|
||||
[JsonProperty("dependencies")]
|
||||
private List<string> _dependencies;
|
||||
|
||||
public HybridPackageWorkflowState()
|
||||
{
|
||||
_packageName = string.Empty;
|
||||
_dependencies = new List<string>();
|
||||
}
|
||||
|
||||
public string GetPackageName()
|
||||
{
|
||||
return _packageName;
|
||||
}
|
||||
|
||||
public void SetPackageName(string packageName)
|
||||
{
|
||||
_packageName = packageName;
|
||||
}
|
||||
|
||||
public List<string> GetPackageDependencies()
|
||||
{
|
||||
return _dependencies;
|
||||
}
|
||||
|
||||
public void SetPackageDependencies(IEnumerable<string> dependencies)
|
||||
{
|
||||
_dependencies.Clear();
|
||||
foreach (var dependency in dependencies)
|
||||
_dependencies.Add(dependency);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2848375fcb0a4174495573190bfc3900
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 115
|
||||
packageName: Asset Store Publishing Tools
|
||||
packageVersion: 12.0.1
|
||||
assetPath: Packages/com.unity.asset-store-tools/Editor/Uploader/Scripts/Data/Serialization/HybridPackageWorkflowState.cs
|
||||
uploadId: 724584
|
||||
@@ -0,0 +1,25 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace AssetStoreTools.Uploader.Data.Serialization
|
||||
{
|
||||
internal class UnityPackageWorkflowState
|
||||
{
|
||||
[JsonProperty("package_path")]
|
||||
private AssetPath _packagePath;
|
||||
|
||||
public UnityPackageWorkflowState()
|
||||
{
|
||||
_packagePath = new AssetPath();
|
||||
}
|
||||
|
||||
public string GetPackagePath()
|
||||
{
|
||||
return _packagePath?.ToString();
|
||||
}
|
||||
|
||||
public void SetPackagePath(string path)
|
||||
{
|
||||
_packagePath = new AssetPath(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 101a66adc88639b43b07cc28214474cf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 115
|
||||
packageName: Asset Store Publishing Tools
|
||||
packageVersion: 12.0.1
|
||||
assetPath: Packages/com.unity.asset-store-tools/Editor/Uploader/Scripts/Data/Serialization/UnityPackageWorkflowStateData.cs
|
||||
uploadId: 724584
|
||||
@@ -0,0 +1,68 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace AssetStoreTools.Uploader.Data.Serialization
|
||||
{
|
||||
internal class WorkflowStateData
|
||||
{
|
||||
[JsonProperty("package_id")]
|
||||
private string _packageId;
|
||||
[JsonProperty("active_workflow")]
|
||||
private string _activeWorkflow;
|
||||
[JsonProperty("assets_workflow")]
|
||||
private AssetsWorkflowState _assetsWorkflow;
|
||||
[JsonProperty("unitypackage_workflow")]
|
||||
private UnityPackageWorkflowState _unityPackageWorkflow;
|
||||
[JsonProperty("hybrid_workflow")]
|
||||
private HybridPackageWorkflowState _hybridPackageWorkflow;
|
||||
|
||||
public WorkflowStateData()
|
||||
{
|
||||
_activeWorkflow = string.Empty;
|
||||
|
||||
_assetsWorkflow = new AssetsWorkflowState();
|
||||
_unityPackageWorkflow = new UnityPackageWorkflowState();
|
||||
_hybridPackageWorkflow = new HybridPackageWorkflowState();
|
||||
}
|
||||
|
||||
public WorkflowStateData(string packageId) : this()
|
||||
{
|
||||
SetPackageId(packageId);
|
||||
}
|
||||
|
||||
public string GetPackageId()
|
||||
{
|
||||
return _packageId;
|
||||
}
|
||||
|
||||
public void SetPackageId(string packageId)
|
||||
{
|
||||
_packageId = packageId;
|
||||
}
|
||||
|
||||
public string GetActiveWorkflow()
|
||||
{
|
||||
return _activeWorkflow;
|
||||
}
|
||||
|
||||
public void SetActiveWorkflow(string activeWorkflow)
|
||||
{
|
||||
_activeWorkflow = activeWorkflow;
|
||||
}
|
||||
|
||||
public AssetsWorkflowState GetAssetsWorkflowState()
|
||||
{
|
||||
return _assetsWorkflow;
|
||||
}
|
||||
|
||||
public UnityPackageWorkflowState GetUnityPackageWorkflowState()
|
||||
{
|
||||
return _unityPackageWorkflow;
|
||||
}
|
||||
|
||||
public HybridPackageWorkflowState GetHybridPackageWorkflowState()
|
||||
{
|
||||
return _hybridPackageWorkflow;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eecebbc83661a4f41a14e293c9fc3331
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 115
|
||||
packageName: Asset Store Publishing Tools
|
||||
packageVersion: 12.0.1
|
||||
assetPath: Packages/com.unity.asset-store-tools/Editor/Uploader/Scripts/Data/Serialization/WorkflowStateData.cs
|
||||
uploadId: 724584
|
||||
Reference in New Issue
Block a user