Skip to content

flexjs migration shell

Harbs edited this page Oct 19, 2017 · 6 revisions

Migration Shell Script for FlexJS Projects

To run the script, save the script to a file ( i.e. migrateflexjs.sh) and place the script in the main directory of your project. Run the script from the command line using . migrateflexjs.sh

#!/bin/bash

find . -iregex ".*\.as" -type f -exec perl -i -ne 's/org\.apache\.flex/org\.apache\.royale/g;print;' {} \;
find . -iregex ".*\.mxml" -type f -exec perl -i -ne 's/org\.apache\.flex/org\.apache\.royale/g;print;' {} \;
find . -iregex ".*\.as" -type f -exec perl -i -ne 's/\@flexjsignorecoercion/\@royaleignorecoercion/g;print;' {} \;
find . -iregex ".*\.mxml" -type f -exec perl -i -ne 's/\@flexjsignorecoercion/\@royaleignorecoercion/g;print;' {} \;
find . -iregex ".*\.as" -type f -exec perl -i -ne 's/IFlexJSEvent/IRoyaleEvent/g;print;' {} \;
find . -iregex ".*\.mxml" -type f -exec perl -i -ne 's/IFlexJSEvent/IRoyaleEvent/g;print;' {} \;
find . -iregex ".*\.as" -type f -exec perl -i -ne 's/ns\.apache\.org\/flexjs/ns\.apache\.org\/royale/g;print;' {} \;
find . -iregex ".*\.mxml" -type f -exec perl -i -ne 's/ns\.apache\.org\/flexjs/ns\.apache\.org\/royale/g;print;' {} \;
find . -name "*.xml" -type f -exec perl -i -ne 's/FLEXJS_HOME/ROYALE_HOME/g;print;' {} \;
find . -name "*.xml" -type f -exec perl -i -ne 's/flex-config/royale-config/g;print;' {} \;
find . -name "asconfig.json" -type f -exec perl -i -ne 's/flexjs/royale/g;print;' {} \;
find . -name "asconfig.json" -type f -exec perl -i -ne 's/"config":\s?"flex"/"config": "royale"/g;print;' {} \;
find . -name "asconfig.json" -type f -exec perl -i -ne 's/JSFlex/JSRoyale/g;print;' {} \;
find . -name "tasks.json" -type f -exec perl -i -ne 's/--flexHome/--royaleHome/g;print;' {} \;
Clone this wiki locally