Creating a Patch
Mobile Designer provides patch and diff tools with sample scripts so that you can create patch files. For an example of how to use the patch and diff tools, see the Function Demo sample project.
To create a patch file
1. Build your project using one of the following Ant targets:
Be sure you select the Retain output build files in the Multi Build dialog.
Be sure you set the retain option to true.
2. Locate your project’s Build folder, which Mobile Designer creates during the build process.
3. In the Build folder, locate the cross-compiled version of your code.
Specifically, look for your code in the following folder:
project/Builds/x.y.z/device/_temp_/_language_edit_
In the folder location above:
project is the name of your project.
x.y,z is the version number you specified for the build.
device is the name of a device for which
Mobile Designer built your application.
language is the language into which your application code was cross compiled, for example, java.
4. Review the cross-compiled code and make any minor code adjustments needed to correct the issues you are encountering so that your code compiles as expected on the target platform.
5. Run the patch_maker script that Mobile Designer provides in the following project folder:
project/Builds/x.y.z/device/_temp_
When Mobile Designer builds your project, it places versions of the cross-compiled code in both of the following project folders:
_
language_ folder
_
language_edit_ folder
The version of the cross-compiled code in the _language_edit_ folder includes any patch that you might have already applied.
When you run the patch_maker script, Mobile Designer generates a diff file with the differences between the two folders.
6. Save the diff file that the patch_maker script created in the project’s main folder using the names specified in the following table.
Platform | Patch Name |
Android | android_java.diff |
iOS | ios_cpp.diff |
Windows Phone | winphone_csharp.diff |
Windows RT | win8rt_csharp.diff |
Windows 8 | win8str_csharp.diff |
Note: | If you want to give your diff file an alternate name, for example, if two targets for the same platform require different diff files, you can use a custom name for a diff file. You still save the diff file to the project’s main folder. However, if you name your diff file differently from the names specified in the table above, you must add the patch.name property to the target device file in the project’s targets folder. Set the value of the patch.name property to the name of the diff file to use for the device. |