Rush • A new and improved way of building extensions

Rush is a build tool, built to be a complete replacement for the existing way of developing extensions. It attempts to improve the overall developer experience and reduce the amount of boilerplate code you need to write to make extensions.

With Rush, you no longer need to use annotations to define your extension's metadata and Android manifest tags. Instead, you get a separate metadata file, rush.yml, and direct support for AndroidManifest.xml (more on that below).

Not just that, Rush sports a beautiful interactive CLI that accompanies you from scaffolding to building production-ready optimized builds of your extension.

Installation [Latest release: v1.2.5]


Using PowerShell (Windows only)

iwr https://raw.githubusercontent.com/shreyashsaitwal/rush-cli/main/scripts/install/install.ps1 -useb | iex

Using Shell

curl https://raw.githubusercontent.com/shreyashsaitwal/rush-cli/main/scripts/install/install.sh -fsSL | sh

Note: If you install Rush using shell, you'll need to update your PATH environment variable to include Rush's bin directory. Instructions for the same will be printed by the script after all other steps are complete.

Your very first Rush project


Once you've Rush installed on your system, fire up a terminal app, cd into the directory you wish to create the extension in, and then run rush create <extension_name>. Answer the prompted questions, and woo-hoo, you have a brand new Rush project ready! :partying_face:

rush-create

Now, cd into the created directory and run rush build. Once the build is complete, you'll find your extension in the out directory. Voila! You just built your very first Rush extension! To know more about the build command and its supported flags, check out this wiki.

rush-build

How's Rush different?


If you take a look at the generated Java file for your extension (which you can find in src -> package), you'll find that there are no DesignerComponent and SimpleObject annotations in there. In fact, there is not a single class-level annotation. So, where did all these annotations go?

The Metadata file (rush.yml)


All the annotations related to defining the extension's metadata, like, its name, description, minimum Android SDK, license, etc. are replaced by the metadata file -- rush.yml. It also keeps an entry of all the external libraries and assets required by your extensions.
To know more, check out this wiki.

Note: Dependencies and assets defined in rush.yml are required to be added to ./deps and ./assets directories respectively.

rush.yml file for an extension named Gradients

Android Manifest file


Believe it or not, nothing is worse than having to use Java annotations to define your extension's Android manifest elements. You know the pain if you've ever written large manifest tags using those annotations. Even writing a single one could be ridiculously tedious.

But worry not, with Rush you get out-of-the-box support for directly using an AndroidManifest.xml file. It is located inside the src directory and is generated automatically when you scaffold your extension with the rush create command. It's time to say goodbye to the ugly annotations!

Note: Because of the restrictions imposed by App Inventor's extension system, you can't use every manifest tag. For a detailed list of supported tags, check out this wiki.

Code Optimization and Obfuscation


When you build your extension with the --release flag (-r), Rush obfuscates, shrinks, and optimizes your extension's Java code using ProGuard. You can use the ProGuard rules file (proguard-rules.pro), located inside the src directory, to modify the default behavior.

To turn off the optimization pass --no-optimize flag along with the --release flag. Similarly, you can optimize your code without the --release flag by passing --optimize flag (-o) as well. More on supported build flags here.

Rush is Open-Source


Yes, Rush is open-source and all the code for the CLI as well as the Java annotation processor is available on GitHub under the GPLv3 license.
Go, check it out. And yes, don't forget to :star: both the repos. :wink:

Acknowledgement


A huge thanks to all the alpha and beta testers for their constant helpful feedback throughout the development phase. Without them, this public release won't be possible.

Feedback


For all the types of feature requests and bug reports, file an issue on GitHub.

Also, do let me know your thoughts on this new, and probably, improved way of building extensions in the replies below.

Cheers,
Shreyash

49 Likes

Great job @shreyash :+1: :+1: :+1:

8 Likes

Wow, you are amazing. You created excellent extension (Phase) and also created development environment (Rush) :partying_face: :smiling_face_with_three_hearts: :heart_eyes:

3 Likes

Great work, how do I add permissions for extension? How do I declare them in the rush.yml?

3 Likes

You declare them in AndroidManifest.xml using the uses-permission tag.

7 Likes

Wow, you are the one who changed the world. :star_struck: :heart_eyes: :kissing_heart:
P.S: whether with the rush we must still have the mit app inventor source?
P.S2: can rush make it easier for us to create extensions that contain libs?

4 Likes

To use Rush, all you need is Java JDK 8 or above, and Rush itself. How to install Rush is explained in detail here.

To use external libraries, you need to add the desired ones to the deps folder, and create an entry for them in deps field in rush.yml. Can't say if it's easier], but it's a bit different than the traditional way.

4 Likes

Amazing! I totally surprised when I saw this topic. Really great thing that you made @shreyash

3 Likes

Still I am confused. Do we don't need to use jar files? :sweat_smile::sweat_smile::sweat_smile:

2 Likes

That feature is not yet available. It is planned to be released in the future. :point_down:

4 Likes

replace it with windows 64 bit it's not working for 32bit help

3 Likes

make it work for win 32 bit

2 Likes

You're right. It doesn't work with 32 bit Windows. Sorry for the inconvenience.

4 Likes

Yes, it's not working on Windows 32 bit. It would be really good if it works on it as well.

2 Likes

May Rush make "Widget" on display ?

2 Likes

AFAIK, creating widgets require adding some XML resources to the app. This is currently not possible with App Inventor, and hence, you can't develop extensions that create widgets using Rush.

2 Likes

If edit Manifest and add Xml in Apk Editor, may will work ?)
http://learn-android.ru/news/sozdanie_widget_delaem_vidzhet_na_android_ustrojstvo/2015-04-10-86.html

2 Likes

Editing the Android manifest is supported with Rush, but it's not just that. You need to add layout resources as well, which currently isn't supported by AI2 as well as Rush.

3 Likes

If add from APK Editor: ?

5 Likes

I haven't tried it, but I guess it'd be possible.

2 Likes