-
-
Notifications
You must be signed in to change notification settings - Fork 51
Project: Generating Patch
To create a patch for e.g. version 1.1.0 of your app, you should create a new subdirectory named 1.1.0
inside the project's Versions folder and copy/move your app's files there. Then, you can then generate the patch using one of the following methods (generated patch files will be located inside the project's Output folder):
Click here to show/hide
Use the Patcher project_generate_patch
command. It takes the following arguments:
- projectRoot: path of the project's directory
- silent: (optional)(flag) progress will not be logged to the console
Example: Patcher project_generate_patch -projectRoot="C:\MyProject"
Click here to show/hide
Namespace: SimplePatchToolCore
public ProjectManager( string projectRoot )
: creates a new ProjectManager instance. It takes the path of the project directory as parameter
ProjectManager SilentMode( bool silent )
: sets whether or not ProjectManager should log anything
bool GeneratePatch()
: starts generating the patch asynchronously in a separate thread. This function will return false, if ProjectManager is already running
There are two ways to fetch ProjectManager's progress:
1. Calling the following methods and properties manually from time to time
string FetchLog()
: fetches the next log that ProjectManager has generated. Returns null, if there is no log in the queue
void Cancel()
: cancels the operation
bool IsRunning { get; }
: returns true if ProjectManager is currently running
2. Using a ProjectManager.IListener object
You can register a listener to ProjectManager using the SetListener
function. This listener will receive the following callbacks:
void LogReceived( string log );
void Finished(); // ProjectManager finished running
Be aware that any expensive operations performed in these callbacks will block the ProjectManager's thread.
PatchResult Result { get; }
: returns PatchResult.Success if patch is created successfully, PatchResult.Failed otherwise. Its value should be checked after IsRunning returns false
Example code: SimplePatchToolConsoleApp.Program.ProjectGeneratePatch
Click here to show/hide
Simply open the Window-Simple Patch Tool window, enter the project directory's path and click Generate Patch.