-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
318 changed files
with
694 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright (c) 2020-2021 dotBunny Inc. | ||
// dotBunny licenses this file to you under the BSL-1.0 license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using GDX; | ||
using GDX.Editor; | ||
using UnityEngine; | ||
|
||
namespace GDX.Editor | ||
{ | ||
/// <summary> | ||
/// An object representative of the GDX entry in a manifest lockfile. | ||
/// </summary> | ||
[Serializable] | ||
public class ManifestEntry | ||
{ | ||
public string version; | ||
public int depth; | ||
public string source; | ||
public string[] dependencies; | ||
public string hash; | ||
|
||
[NonSerialized] | ||
public PackageProvider.InstallationType installationType; | ||
[NonSerialized] | ||
public string tag; | ||
|
||
public static ManifestEntry Get(string json) | ||
{ | ||
ManifestEntry returnObject = JsonUtility.FromJson<ManifestEntry>(json); | ||
if (returnObject == null) | ||
{ | ||
return null; | ||
} | ||
|
||
// Evaluate for tag | ||
string tag = returnObject.version.GetAfterLast("#"); | ||
if (tag != null) | ||
{ | ||
if (tag.StartsWith("v")) | ||
{ | ||
returnObject.installationType = PackageProvider.InstallationType.UPMTag; | ||
returnObject.tag = tag; | ||
return returnObject; | ||
} | ||
|
||
// Check for what we assume is a commit hash | ||
if (tag.Length == 40 && tag.HasLowerCase() && !tag.HasUpperCase()) | ||
{ | ||
returnObject.installationType = PackageProvider.InstallationType.GitHubCommit; | ||
returnObject.tag = tag; | ||
return returnObject; | ||
} | ||
|
||
// Left with assuming its a branch? | ||
returnObject.installationType = PackageProvider.InstallationType.UPMBranch; | ||
returnObject.tag = tag; | ||
return returnObject; | ||
} | ||
|
||
returnObject.installationType = PackageProvider.InstallationType.UPM; | ||
returnObject.tag = "main"; | ||
return returnObject; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.