Skip to content

Commit

Permalink
Support for 2019.1.9
Browse files Browse the repository at this point in the history
Support for 2019.1.9
  • Loading branch information
mob-sakai authored and mob-sakai committed Nov 21, 2019
1 parent a40a32d commit 3de2f36
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Linq;
#if UNITY_2019_1_9 || UNITY_2019_1_10 || UNITY_2019_1_11 || UNITY_2019_1_12 || UNITY_2019_1_13 || UNITY_2019_1_14 || UNITY_2019_2_OR_NEWER
#define UNITY_2019_1_9_OR_NEWER
#endif
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using UnityEditor;
Expand Down Expand Up @@ -163,12 +166,12 @@ static void DevelopBridge()
"Packages/com.coffee.upm-git-extension/Editor/InternalBridge/Coffee.UpmGitExtension.Editor.Bridge.asmdef"
};

#if UNITY_2019_2_OR_NEWER
#if UNITY_2019_1_9_OR_NEWER
const string suffix = ".2019.2~";
#else
const string suffix = ".2018.3~";
const string suffix = ".2018.3~";
#endif
foreach(var t in targets)
foreach (var t in targets)
{
File.Copy(t + suffix, t, true);
}
Expand All @@ -182,22 +185,22 @@ static void CompileBridge()
s_MiSyncSolution.Invoke(null, new object[0]);

CompileCsproj(
#if UNITY_2019_2_OR_NEWER
"Unity.InternalAPIEditorBridgeDev.001.csproj",
#if UNITY_2019_1_9_OR_NEWER
"Unity.InternalAPIEditorBridgeDev.001.csproj",
#else
"Unity.PackageManagerCaptain.Editor.csproj",
#endif

#if UNITY_2019_3_OR_NEWER
"Packages/com.coffee.upm-git-extension/Editor/Coffee.UpmGitExtension.Editor.Bridge.2019.3.dll"
#elif UNITY_2019_2_OR_NEWER
"Packages/com.coffee.upm-git-extension/Editor/Coffee.UpmGitExtension.Editor.Bridge.2019.2.dll"
#elif UNITY_2019_1_9_OR_NEWER
"Packages/com.coffee.upm-git-extension/Editor/Coffee.UpmGitExtension.Editor.Bridge.2019.2.dll"
#elif UNITY_2019_1_OR_NEWER
"Packages/com.coffee.upm-git-extension/Editor/Coffee.UpmGitExtension.Editor.Bridge.2019.1.dll"
#else
"Packages/com.coffee.upm-git-extension/Editor/Coffee.UpmGitExtension.Editor.Bridge.2018.3.dll"
#endif
);
);
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
#if UNITY_2019_1_9 || UNITY_2019_1_10 || UNITY_2019_1_11 || UNITY_2019_1_12 || UNITY_2019_1_13 || UNITY_2019_1_14 || UNITY_2019_2_OR_NEWER
#define UNITY_2019_1_9_OR_NEWER
#endif
using System;
using System.Text;
using System.Linq;
using System.Collections;
Expand All @@ -8,7 +11,7 @@
using System.Text.RegularExpressions;
using System.IO;
using System.Runtime.CompilerServices;
#if !UNITY_2019_2_OR_NEWER
#if !UNITY_2019_1_9_OR_NEWER
using Semver;
#endif
#if UNITY_2019_1_OR_NEWER
Expand All @@ -32,7 +35,7 @@ public class Bridge

bool reloading;

LoadingSpinner GetLoadingSpinner() { return loadingSpinner as LoadingSpinner; }
LoadingSpinner GetLoadingSpinner () { return loadingSpinner as LoadingSpinner; }
PackageList GetPackageList() { return packageList as PackageList; }
PackageDetails GetPackageDetails() { return packageDetails as PackageDetails; }

Expand Down Expand Up @@ -341,11 +344,10 @@ void UpdatePackageVersions(Package package, IEnumerable<string> versions)
var newPInfo = JsonUtility.FromJson(json, typeof(PackageInfo)) as PackageInfo;

newPInfo.Version = SemVersion.Parse(version == refName ? version : version + "-" + refName);
#if UNITY_2019_2_OR_NEWER
newPInfo.IsInstalled = false;
#else
newPInfo.IsCurrent = false;
#endif

var exPackageInfo = Expose.FromObject(newPInfo);
exPackageInfo.Set(exPackageInfo.Has("IsInstalled") ? "IsInstalled" : "IsCurrent", false);

newPInfo.IsVerified = false;
newPInfo.Origin = (PackageSource)99;
newPInfo.Info = pInfo.Info;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#if UNITY_2019_1_OR_NEWER
#if UNITY_2019_1_9 || UNITY_2019_1_10 || UNITY_2019_1_11 || UNITY_2019_1_12 || UNITY_2019_1_13 || UNITY_2019_1_14 || UNITY_2019_2_OR_NEWER
#define UNITY_2019_1_9_OR_NEWER
#endif
#if UNITY_2019_1_OR_NEWER
using UnityEngine.UIElements;
#else
using UnityEngine.Experimental.UIElements;
Expand Down Expand Up @@ -187,16 +190,16 @@ public static class JsonUtils
public static Dictionary<string, object> DeserializeFile(string file)
{
var text = File.ReadAllText(file);
#if UNITY_2019_2_OR_NEWER
return Json.Deserialize(text) as Dictionary<string, object>;
#if UNITY_2019_1_9_OR_NEWER
return Json.Deserialize(text) as Dictionary<string, object>;
#else
return Expose.FromType(Type.GetType("UnityEditor.Json, UnityEditor")).Call("Deserialize", text).As<Dictionary<string, object>>();
#endif
}

public static void SerializeFile(string file, Dictionary<string, object> json)
{
#if UNITY_2019_2_OR_NEWER
#if UNITY_2019_1_9_OR_NEWER
var text = Json.Serialize(json);
#elif UNITY_2019_1_OR_NEWER
var text = Expose.FromType(Type.GetType("UnityEditor.Json, UnityEditor")).Call("Serialize", json, false, " ").As<string>();
Expand Down

0 comments on commit 3de2f36

Please sign in to comment.