(--product)
(--sourceDevice)
(--destinationDevice)
(--sourcePackage)
(--destinationPackage)
(--sourcePart)
(--destinationPart)
(--migratePath)
To run the script, open terminal/command prompt inside the SDK folder that has the migrate.js script.
In this case, navigate to migration_script folder using:
$ cd tools/migration_script
For example, let's say you want to switch all the AM263PX examples in the whole of SDK from package ZCZ_S to ZCZ_F. Then, enter this command in your terminal:
$ node migrate.js --product {your_sdk_path}/.metadata/product.json --sourceDevice AM263PX --destinationDevice AM263PX --sourcePackage ZCZ_S --destinationPackage ZCZ_F --migratePath {your_sdk_path}
The arguments sourceDevice and destinationDevice are same in this case, both AM263PX.
When you run this command, the migrate.js script recursively traverses through the whole SDK path, searches for all the examples that are currently in sourcePackage, and then migrates those examples to destinationPackage.
You can also use the script to switch individual examples. Let's say you want to switch only the 'mcasp' examples, than replace the last argument with:
"{your_sdk_path}/examples/drivers/mcasp"
It does in-place modification of example.syscfg, makefile, and example.projectspec files of the examples.
The list of files successfully migrated and files that failed to migrate can be observed from the log_file.txt generated inside the tools/migration_script folder of the SDK.
To understand the list of arguments, their aliases and description enter this command:
$ node migrate.js --help
To skip certain examples from being migrated, add the SDK relative path to those folders in the file exclude_list_am263px.js inside migration_script/soc folder.