Migration Support
In order to simplify the migration of existing applications based on previous qooxdoo releases to a newer release, qooxdoo comes with convenient migration scripts. Of course, the dynamic nature of JavaScript and your personal coding style will not allow for a completely automatic process for any release change. But even a semi-automatic process that requires your manual action significantly reduces the total amount of work and is less error-prone. The script output contains detailed information in form of a checklist, including line numbers in the original files.
In the following command you need to replace some placeholders with your indiviual values:
APPLICATION_CLASSES_DIRECTORYis the relative or absolute path to the directory that contains the JavaScript files you would like to migrateTARGETVERSIONis the qooxdoo release number you would like to migrate to$qxdenotes the the folder of your new qooxdoo version (SVN checkout or SDK) that you would like to migrate to
$qx/frontend/framework/tool/generator.py --class-path APPLICATION_CLASSES_DIRECTORY \ --migrate-source --migration-target TARGETVERSION
To migrate for example from 0.6.1 to 0.6.5 you have to execute the following commands:
$qx/frontend/framework/tool/generator.py --class-path APPLICATION_CLASSES_DIRECTORY \ --migrate-source --migration-target 0.6.2 $qx/frontend/framework/tool/generator.py --class-path APPLICATION_CLASSES_DIRECTORY \ --migrate-source --migration-target 0.6.3 $qx/frontend/framework/tool/generator.py --class-path APPLICATION_CLASSES_DIRECTORY \ --migrate-source --migration-target 0.6.4 $qx/frontend/framework/tool/generator.py --class-path APPLICATION_CLASSES_DIRECTORY \ --migrate-source --migration-target 0.6.5
Suppose you are inside the skeleton folder. The following command would migrate all your JavaScript class files in the source/class folder to qooxdoo 0.6.5 (implicitly from version 0.6.4 as mentioned above):
$qx/frontend/framework/tool/generator.py --class-path source/class \ --migrate-source --migration-target 0.6.5
After the migration, do not forget to edit your application’s Makefile to point to the folder of the new qooxdoo version.
Makefiles have been reworked and substantially improved by release 0.6.4. You cannot continue to use the existing Makefiles without changes for 0.6.4. You have the choice between the following two options:
- Do some minor fixes to the existing Makefile of your application or
- Upgrade to a new Makefile that now includes support for internationalization and is also the basis for future qooxdoo application development
We strongly argue to chose the latter option! Maybe you are on a tight time schedule and you cannot afford to upgrade to the new Makefile now, and therefore you may want to do the quick fixes? Fair enough, but remember that without upgrading to the Makefiles of 0.6.4 you cannot take advantage of the most significant improvements of release 0.6.4 (like internationalization, etc.). It should not be to hard to transfer your individual settings over to the new Makefile.
For more detailed info on the options of the generator script, please consult the article for generator.py.
The migration support is much more powerful in versions 0.6.2 and above than the older scripts that only supported simple replacements based on regular expressions. The new migration is based on the actual parse tree of the JavaScript input files and allows for very sophisticated changes.
As a drawback, the migration support does not fully support other input files than pure JavaScript files (.js file extension) any longer. To be fair, it has never been a good idea to mix different languages (e.g. html markup and JavaScript).
But it is possible to use the purely regexp based part of the migration data to also update HTML, PHP or other files. In this case you define additional migration inputs, which could look like this:
$qx/frontend/framework/tool/generator.py --class-path source/class \ --migration-input source/html --migrate-source --migration-target 0.6.5
You can use multiple script and migration inputs.
Usually it is helpful to permanently save the output to a file on your harddisk in addition to reading the infos on the screen. You can easily use tee for this:
cd frontend framework/tool/generator.py --class-path APPLICATION_CLASSES_DIRECTORY \ --migrate-source --migration-target TARGETVERSION | tee FILENAME
This will output all info to the console, as before, but also logs it to FILENAME.
