Migration Support (migrating to 0.7.x versions)
qooxdoo 0.7 has an improved migration support. Migrating skeleton-based application to the newest qooxdoo release is now easier than ever before.
make distclean prior to make migration. As all the “made” files will be out of date after migration this is a good idea anyway.
Migration from qooxdoo 0.6.4 or newer
With 0.6.4 the Makefiles have been reorganized. This allows us to add additional make target to the skeletons without the need to change the existing application Makefiles. Follow those steps to migrate to the newest qooxdoo version 0.7.x:
- Backup your project.
- Download and unpack the qooxdoo SDK (0.7.x)
- Point the
QOOXDOO_PATHandQOOXDOO_URIvariables in your application Makefile to the new qooxdoo version. - add a
QOOXDOO_VERSIONvariable to your application Makefile. This variable must contain the original qooxdoo version of your application. - optionally, you can customize the pretty printer using the Makefile variable
PRETTY_PRINT_OPTIONS. This variable holds options for the pretty printer. - call
make migration
Now all JavaScript files should get updated. A full log of the migration process is saved into a file named migration.log in the Makefile’s directory.
Migration from qooxdoo 0.7 pre-releases
To migrate the pre-releases (0.7-pre, etc.!) to the newest 0.7 release the following steps are needed:
- Backup your project.
- Download and unpack the qooxdoo SDK (0.7.x)
- Point the
QOOXDOO_PATHandQOOXDOO_URIvariables in your application Makefile to the new qooxdoo version. - add a
QOOXDOO_VERSIONvariable to your application Makefile. Attention: This variable must set to 0.6.6 in order to perform a successful migration - optionally, you can customize the pretty printer using the Makefile variable
PRETTY_PRINT_OPTIONS. This variable holds options for the pretty printer. - call
make migration
Now all JavaScript files should get updated. A full log of the migration process is saved into a file named migration.log in the Makefile’s directory.
Migration from qooxdoo 0.6.3 or older
For qooxdoo releases 0.6.3 or older the migrator script of the new qooxdoo release (0.7.x) must be executed directly. The migrator is a Python program, which is located at QOOXDOO/frontend/framework/tool/migrator.py.
Make sure you made a backup of your existing application!
To migrate all your application classes invoke the migrator script from the top level directory of your application with the following options:
$ migrator.py --class-path source/class --from-version=0.6.3
–from-versionmust contain the original qooxdoo version of your application–class-pathis the root directory of your application’s JavaScript class files
The format of the pretty-printed files can be customized by the pretty printer options documented in Code Style.
The JavaScript files are now migrated to the current qooxdoo version. As a second step it is highly recommended to update the existing Makefile used for your application. It is best to take the Makefile from the skeleton folder in the new qooxdoo release, copy it to your application folder and modify it to fit your application’s requirements. Make sure the usual make and make build commands run properly with your new Makefile.
Migration of applications not based on skeleton
If the JavaScript classes of your application to be migrated are organized in namespaces just like qooxdoo or the skeletons, the project can be migrated using the same approach as skeleton-based qooxdoo projects older than 0.6.4.
If the JavaScript files are organized in a different way, each file has to be migrated individually (see next paragraph).
Migration of individual files
It is possible to migrate individual files using the migrator script. This functionality can be very useful, to preview how the migrated files would look like after migration.
To migrate just one file call the migrator like this:
$ migrator.py --from-version=0.6.4 --input source/class/custom/Application.js
This prints the migrated file content to the console. The original file will not be changed.
It is of course possible to redirect the result of the migration into an output file:
$ migrator.py --from-version=0.6.4 --input source/class/custom/Application.js > Application.migrated.js
That way source/class/custom/Application.js remains unchanged and Application.migrated.js contains the migrated version.
Command line options for the migrator
Execute the following command to see a full description of available options:
$ ./migrator.py --help
usage: migrator.py [options]
options:
-h, --help show this help message and exit
-v, --verbose Verbose output mode.
--class-encoding=ENCODING
Encoding of the files to migrate.
Migrator Options:
-m MAKEFILE, --from-makefile=MAKEFILE
Makefile of the skeleton project to migrate (optional)
--from-version=VERSION
qooxdoo version used for the project e.g. '0.6.3'
-i FILE.js, --input=FILE.js
Migrate just one JavaScript file. Writes the generated
file to STDOUT.
--class-path=DIRECTORY
Define a class path.
Pretty printer options:
--pretty-print-indent-string=PRETTYPINDENTSTRING
String used for indenting source code; escapes
possible (e.g. "\t"; default: " ")
--pretty-print-newline-before-open-curly=[aAnNmM]
Defines whether "{" will always [aA] or never [nN] be
on a new line; the default is mixed [mM] behaviour
according to complexity of the enclosed block
--pretty-print-indent-before-open-curly
Indent "{" (default: False)
--pretty-print-inline-comment-padding=PRETTYPCOMMENTSINLINEPADDING
String used between the end of a statement and a
trailing inline comment (default: " ")
--pretty-print-indent-align-block-with-curlies
Align a block of code with its surrounding curlies
(obviously not with the opening curly when it is not
on a new line); use in combination with --pretty-
print-indent-before-open-curly, otherwise the result
might look weird (default: False)
