diff --git a/Assets/PatchKit Patcher/Editor/Manifest.cs b/Assets/PatchKit Patcher/Editor/Manifest.cs index 4f4a5554..fad1dfdf 100644 --- a/Assets/PatchKit Patcher/Editor/Manifest.cs +++ b/Assets/PatchKit Patcher/Editor/Manifest.cs @@ -23,6 +23,9 @@ public struct Argument public string Target; [JsonProperty(PropertyName = "target_arguments")] - public Argument[] Arguments; + public Argument[] Arguments; + + [JsonProperty(PropertyName = "capabilities")] + public string[] Capabilities; } } \ No newline at end of file diff --git a/Assets/PatchKit Patcher/Editor/PatcherManifestCreator.cs b/Assets/PatchKit Patcher/Editor/PatcherManifestCreator.cs index 610382fb..a5323b72 100644 --- a/Assets/PatchKit Patcher/Editor/PatcherManifestCreator.cs +++ b/Assets/PatchKit Patcher/Editor/PatcherManifestCreator.cs @@ -8,7 +8,32 @@ namespace PatchKit.Unity.Editor { public static class PatcherManifestCreator { - private const int ManifestVersion = 3; + private const int ManifestVersion = 4; + + private static void SaveTestManifest(Manifest manifest) + { + string targetLocation = EditorUtility.SaveFilePanel("Choose test manifest location", "", "patcher.manifest", "test"); + + File.WriteAllText(targetLocation, JsonConvert.SerializeObject(manifest, Formatting.Indented)); + } + + [MenuItem("Tools/PatchKit Patcher Internal/Manifest/Windows")] + private static void CreateTestManifestWindows() + { + SaveTestManifest(WindowsManifest("BUILD_PATH")); + } + + [MenuItem("Tools/PatchKit Patcher Internal/Manifest/Linux")] + private static void CreateTestManifestLinux() + { + SaveTestManifest(LinuxManifest("BUILD_PATH")); + } + + [MenuItem("Tools/PatchKit Patcher Internal/Manifest/Osx")] + private static void CreateTestManifestOsx() + { + SaveTestManifest(OsxManifest("BUILD_PATH")); + } [PostProcessBuild, UsedImplicitly] private static void PostProcessBuild(BuildTarget buildTarget, string buildPath) @@ -45,6 +70,13 @@ private static Manifest.Argument CreateManifestAgument(params string[] args) return new Manifest.Argument { Value = args }; } + private static string[] Capabilities() + { + return new []{ + "pack1_compression_lzma2", + }; + } + private static Manifest LinuxManifest(string buildPath) { string patcherExe = Path.GetFileName(buildPath); @@ -58,6 +90,7 @@ private static Manifest LinuxManifest(string buildPath) Version = ManifestVersion, Target = "sh", + Capabilities = Capabilities(), Arguments = new Manifest.Argument[] { CreateManifestAgument(launchScriptPath), CreateManifestAgument("--exedir={exedir}"), @@ -79,6 +112,7 @@ private static Manifest WindowsManifest(string buildPath) Version = ManifestVersion, Target = "{exedir}/" + targetFile, + Capabilities = Capabilities(), Arguments = new Manifest.Argument[] { CreateManifestAgument("--installdir", "{installdir}"), CreateManifestAgument("--lockfile", "{lockfile}"), @@ -97,6 +131,7 @@ private static Manifest OsxManifest(string buildPath) Version = ManifestVersion, Target = "open", + Capabilities = Capabilities(), Arguments = new Manifest.Argument[] { CreateManifestAgument("{exedir}/" + targetFile), CreateManifestAgument("--args"), @@ -108,4 +143,4 @@ private static Manifest OsxManifest(string buildPath) }; } } -} \ No newline at end of file +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 14f0fa3c..6a80507c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Handling failures when accessing the file system - Attaching "system-info" to Sentry events as tag - Support for PK_OFFICIAL define +- capabilities field in the manifest ### Changed - Linux launch script