@@ -9,7 +9,32 @@ namespace PatchKit.Unity.Editor
99{
1010 public static class PatcherManifestCreator
1111 {
12- private const int ManifestVersion = 3 ;
12+ private const int ManifestVersion = 4 ;
13+
14+ private static void SaveTestManifest ( Manifest manifest )
15+ {
16+ string targetLocation = EditorUtility . SaveFilePanel ( "Choose test manifest location" , "" , "patcher.manifest" , "test" ) ;
17+
18+ File . WriteAllText ( targetLocation , JsonConvert . SerializeObject ( manifest , Formatting . Indented ) ) ;
19+ }
20+
21+ [ MenuItem ( "Tools/PatchKit Patcher Internal/Manifest/Windows" ) ]
22+ private static void CreateTestManifestWindows ( )
23+ {
24+ SaveTestManifest ( WindowsManifest ( "BUILD_PATH" ) ) ;
25+ }
26+
27+ [ MenuItem ( "Tools/PatchKit Patcher Internal/Manifest/Linux" ) ]
28+ private static void CreateTestManifestLinux ( )
29+ {
30+ SaveTestManifest ( LinuxManifest ( "BUILD_PATH" ) ) ;
31+ }
32+
33+ [ MenuItem ( "Tools/PatchKit Patcher Internal/Manifest/Osx" ) ]
34+ private static void CreateTestManifestOsx ( )
35+ {
36+ SaveTestManifest ( OsxManifest ( "BUILD_PATH" ) ) ;
37+ }
1338
1439 [ PostProcessBuild , UsedImplicitly ]
1540 private static void PostProcessBuild ( BuildTarget buildTarget , string buildPath )
@@ -45,6 +70,13 @@ private static Manifest.Argument CreateManifestAgument(params string[] args)
4570 return new Manifest . Argument { Value = args } ;
4671 }
4772
73+ private static string [ ] Capabilities ( )
74+ {
75+ return new [ ] {
76+ "pack1_compression_lzma2" ,
77+ } ;
78+ }
79+
4880 private static Manifest LinuxManifest ( string buildPath )
4981 {
5082 string patcherExe = Path . GetFileName ( buildPath ) ;
@@ -58,6 +90,7 @@ private static Manifest LinuxManifest(string buildPath)
5890
5991 Version = ManifestVersion ,
6092 Target = "sh" ,
93+ Capabilities = Capabilities ( ) ,
6194 Arguments = new Manifest . Argument [ ] {
6295 CreateManifestAgument ( launchScriptPath ) ,
6396 CreateManifestAgument ( "--exedir={exedir}" ) ,
@@ -79,6 +112,7 @@ private static Manifest WindowsManifest(string buildPath)
79112
80113 Version = ManifestVersion ,
81114 Target = "{exedir}/" + targetFile ,
115+ Capabilities = Capabilities ( ) ,
82116 Arguments = new Manifest . Argument [ ] {
83117 CreateManifestAgument ( "--installdir" , "{installdir}" ) ,
84118 CreateManifestAgument ( "--lockfile" , "{lockfile}" ) ,
@@ -97,6 +131,7 @@ private static Manifest OsxManifest(string buildPath)
97131
98132 Version = ManifestVersion ,
99133 Target = "open" ,
134+ Capabilities = Capabilities ( ) ,
100135 Arguments = new Manifest . Argument [ ] {
101136 CreateManifestAgument ( "{exedir}/" + targetFile ) ,
102137 CreateManifestAgument ( "--args" ) ,
@@ -108,4 +143,4 @@ private static Manifest OsxManifest(string buildPath)
108143 } ;
109144 }
110145 }
111- }
146+ }
0 commit comments