Skip to content

Migrate command

Shreyash Saitwal edited this page Apr 27, 2021 · 1 revision

The migrate command lets you migrate your old extensions (currently, only the ones built using MIT's extension template) to Rush. No matter how big your extension is, it'll migrate it in just a few seconds.

How to migrate

To migrate your extension built using the extension template follow the below steps:

  • Install Rush.
  • Fire up your terminal and cd into the extension template's root directory (the directory in which the src directory and the build.xml file are situated).
  • Then run rush migrate and let Rush do the hard work.
  • If the migration fails, there are likely some errors in your extension source file. Fix them and re-run rush migrate.
  • If the build succeeds, congrats! Your extension is now migrated to Rush and can be found in one directory up with the same as your extension.
  • The last thing you need to do now is to open your extension's Java file in the newly created Rush project and remove the annotations and imports that Rush doesn't support (like, @DesignerComponent, @SimpleObject, @UsesPermissions, @UsesAssets, etc).

FAQs

  1. Can I migrate more than one extension at a time?
    👉 Currently, no. The migration will fail if you've more than one extension in the extension template. In the future, it might be possible to do this.

  2. Why do I get the "No extension found" error?
    👉 Most likely, as the error says, Rush was unable to find any extension in the src directory of your extension template. But if you are sure that there's an extension in the src directory, start a new discussion here and we will try to find out what's the issue.

  3. Why am I unable to build the migrated extension?
    👉 Did you removed the unsupported annotations from your extension's source file? Here's a list of unsupported AI2 annotations:

    • Replaced by rush.yml

      • @SimpleObject
      • @DesignerComponent
      • @UsesAssets
      • @UsesLibraries
    • Replaced by AndroidManifest.xml

      • @UsesPermissions
      • @UsesActivities
      • @UsesActivityMetaData
      • @UsesApplicationMetaData
      • @UsesBroadcastReceivers
      • @UsesContentProviders
      • @UsesPermissions
      • @UsesServices
    • Miscellaneous

      • @IsColor
      • @SimplePropertyCopier
Clone this wiki locally