Rush • A new and improved way of building extensions

Ironically, I was able to compile it with v1.1.2 without any errors…

even worked for me :me:
then the main problem is with old projects :expressionless:

Even i tried this

and it worked

But this not worked

#error

I’d suggest reading this answer on StackOverflow. It says,

Yes. There is a limit of 65535 on the length of a String literal1. It is not stated in the JLS, but it is implied by the structure of the class file; see JVM Spec 4.4.7 and note that the string length field is ‘u2’ … which means a 16 bit unsigned integer.

Note that a String object can have up to 2^31 - 1 characters. The 2^16 -1 limit is for String literals ; e.g. String constants that are embedded in the source code of a Java program.

1 - This limit is actually on the number of bytes in the (modified) UTF-8 representation of the String. If the string consists of characters in the range 0x01 to 0x7f, then each byte represents a single character. Otherwise, a character can require up to 6 bytes.



If you want to a String that represents the first million digits of Pi, then it would be better to read the characters from a file in the filesystem, or a resource on the classpath.

But why there was no error in old version??

TBH, I don’t know. :man_shrugging:

ok then how can i revert back to old version??
you can say i completely want to remove rush

I won’t suggest you do that. Stay with v1.1.2, and try to use some alternative solution, like, using the StringBuilder or storing the long string as a text file in the extension’s assets and read the text from it when needed.

Sharing you something in P.M. have a look

Hey, I get this error:

ERROR

and I see I can solve it by adding this in build.gradle:

SOLUTION

So, how can I modify build.gradle? Is there any other way to solve this error?:sweat_smile:

There is, but it’d be easier if @Shreyash modified the build.gradle.

You get that error when your extension (or one of it’s dependencies) use some Java 8 language feature. Currently, Rush doesn’t support use of Java 8 language features (like lambda expressions, method referencing, etc.).

Although, the upcoming release (v1.2.0) will bring support for Java 8 language features in Rush. I hope to release it by the end of next week.

build.gradle doesn’t exist in Rush as it doesn’t use Gradle. In fact, Rush in itself if a build tool just like Gradle, but designed specifically for building extensions.

4 Likes

Thanks for your explanation, don’t worry, I hope you will release Rush 1.2.0 soon:muscle:

1 Like

#off-topic what ide you use? it is very fancy

That’s not an IDE but just an image made using https://ray.so.

oh thanks for clearing up

The topic is itself a guide.
Isn’t that enough for you?. There is already all things are listed detailed in the topic. If you are stucked at anywhere then you can ask him.

2 Likes

I have Rush 1.1.1 Installed and I want to upgrade it, but seriously I don’t know how to turn off the Microsoft defender. Running (.exe) as Admin doesn’t work.


Anyway, is it okay to continue without upgrade…

You might want to read this :point_down:

https://support.microsoft.com/en-us/windows/turn-microsoft-defender-firewall-on-or-off-ec0844f7-aebd-0583-67fe-601ecf5d774f

As long as your extension isn’t using any dependency, it’s fine.

Spoiler: Tomorrow I plan to release v1.2.0 of Rush, which introduces a new way to install it on your system. So, you might want to wait for it to release?

5 Likes

:sparkles: Rush 1.2.0 :sparkles:


What’s new :eyes:


  • Kotlin Language – The most awaited Kotlin language support has finally landed! You can now:

    • Write your extensions in pure, idiomatic Kotlin
    • Use libraries written in Kotlin, in new or existing extensions
    • Interop Kotlin in your existing extensions

    Learn more, here.

  • Java 8 Language Features – Ever missed those handy lambda expressions when writing extensions? Not anymore, because with Rush 1.2.0 you get access to a bunch of Java 8 language features. You got yet another reason to completely switch to Rush!

  • Upgrade Command – This is the last time that you will have to re-install Rush in order to upgrade it. With the addition of the upgrade command, you will now be able to install all the future releases simply by running rush upgrade.

  • Markdown Support for extension description – Rush now lets you format your extension’s description with Markdown! Here is an example:

    description: |
      **This text is BOLD**
      *And this one italic*
      # Did someone asked for a headline?
      Oh, btw, [links](https://github.com) are also there!
    
  • IDE support for Metadata file – Yes, you can now enjoy the IntelliSense features like auto-completion and syntactical error reporting in your Java IDE! Check out how to enable that, in IntelliJ IDEA, Android Studio, and VS Code, here.

Bug fixes :beetle:


  • Previously, if you tried to build an extension with no blocks, Rush would crash. This is now fixed and instead of crashing, Rush will now warn you about it and move on.

  • Fixed the inconsistent behavior of YAML multiline strings as reported here. All the following snippets should now show the exact same result:

    description: |
      This is a multi-
      line description!!!
    ---
    description: This is a multi-<br>line description!!!
    ---
    description: "This is a multi-\nline description!!!"
    
  • Sometimes, build warnings would get misinterpreted as errors. This is now fixed.

  • Earlier on Linux and macOS, while processing the extension, Rush would fail to produce AndroidRuntime.jar in some rare scenarios. This is no longer the case.

  • Fixed the issue where the extensions migrated from the extension template won’t build if they previously had no icon image.

Improvements :nail_care:


  • Terminal-UI
    • The bright white color, which was used almost everywhere, is now changed to your terminal’s color. It had problems with adapting to some terminal themes, making it too bright (on dark themes) or almost illegible (on light themes).

    • Error and warning messages are no longer printed in all red and yellow colors respectively. This makes them more legible on dark terminal themes.

      Old New
      231x60 240x60
    • After the build finishes, the total number of errors and warnings is printed beside the success/failure message.

Deprecations :skull:


  • release field in the metadata file – The release field is now deprecated and is replaced by the build.release field.

    # ⚠ This is deprecated 
    release:
      optimize: true
    
    # ✔ Use this instead 
    build:
      release:
        optimize: true
    
  • license_url field in the metadata file – The license_url field is not deprecated and is replaced by the license field which accepts both URL and local file path.

    # ⚠ This is deprecated 
    license_url: "https://example.com/license"
    
    # ✔ Use this instead 
    license: "https://example.com/license"
    
  • Rush Installer – The Rush installer (rush-init) is now deprecated. Instead, users can now install Rush using one-line shell commands (read the below section).

Installation :hammer_and_wrench:


You can now install Rush simply by running the following one-line commands from the appropriate shells, no need to download the Rush installer. Also, PowerShell users (only) don’t need to manually update their PATH environment variable, the script automatically updates it!

Using PowerShell (Windows only)

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

Using Bash

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

Feedback :speaking_head:


A lot (literally, a lot) of work has gone into this release. I would love to hear your feedback on the new features and improvements introduced in this release. Also, it’s no surprise that with all these changes, some pesky bugs might have found their way into the codebase. So, let’s find them and help make Rush better, for the better!


Cheers,
Shreyash

14 Likes

awesome!

3 Likes