Coder Social home page Coder Social logo

shreyashsaitwal / rush-cli Goto Github PK

View Code? Open in Web Editor NEW
46.0 5.0 24.0 1.36 MB

:zap: A new and improved way of building MIT AI2 extensions.

License: GNU General Public License v3.0

Dart 69.97% Shell 1.02% PowerShell 1.27% Java 3.71% Kotlin 24.02%
rush appinventor2 build-tool appinventor-extension cli dart developer-tools

rush-cli's Introduction

⚡ Rush

Rush is a modern extension builder for MIT App Inventor 2.

Note: This readme is for an unreleased version of Rush. Head over to main for current stable version.

Features

  • Faster builds
  • Maven like dependency management
  • Kotlin language support
  • Support for AndroidManifest.xml

Installation

Note: Before installing Rush, make sure that you have JDK 8 or above installed.

Windows

In PowerShell, run:

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

Linux and macOS

  1. In the terminal, run:

    curl https://raw.githubusercontent.com/shreyashsaitwal/rush-cli/main/scripts/install/install.sh -fsSL | sh
  2. Add $HOME/.rush/bin to the PATH environment variable.

Quick start

Now, that you've installed Rush, let's create a simple extension.

  1. Open the terminal in the directory where you want to create your extension project.

  2. Run rush create <NAME_OF_THE_EXTENSION>. This will show you some prompts.

    • Package name: This is the package name in which your extension class will be placed.
    • Language: The language in which you wish to write your extension. This is just for the sake of sample code generation, you can later manually change the language as per your desire or even use both languages together.
    • IDE: Your favorite IDE or text editor. This is required to generate the file required by these IDEs to support features like code completion and syntax highlighting. You can of course use any other text editor as well, but it's very unlikely that it would work well with Rush projects even if it supports Java.
  3. cd into the generated project directory and run rush build.

  4. That's it, the generated extension file (AIX) can be found in the out directory.

Todo

  • Core concepts of extension dev
  • Faq
  • Contributing
  • Limitations
  • List more features

rush-cli's People

Contributors

hammerhai avatar jewelshkjony avatar shreyashsaitwal avatar zainulhassan815 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rush-cli's Issues

Build Failed each time on 2.0

System: Macos on Intel MacBook Pro
Install:Built from sources
Error

Muhammads-MacBook-Pro:testyou muhammadhusnain$ rush build -v
                    __
   _______  _______/ /_
  / ___/ / / / ___/ __ \
 / /  / /_/ (__  / / / /
/_/   \__,_/____/_/ /_/

- Initializing build ✓    ... (0.01s)
┌ Compiling sources
│ debug No manifests found in dependencies; skipping manifest merge             
│ info  Picked 1 source file                                                    
│ debug Bad state: No element                                                   
│ debug #0      ListBase.singleWhere (dart:collection/list.dart:167)
#1      ProcessRunner.runExecutable (package:rush_cli/src/utils/process_runner.dart:23)
<asynchronous suspension>
#2      Compiler.compileJavaFiles (package:rush_cli/src/commands/build/tools/compiler.dart:110)
<asynchronous suspension>
#3      BuildCommand._compile (package:rush_cli/src/commands/build/build.dart:249)
<asynchronous suspension>
#4      BuildCommand.run (package:rush_cli/src/commands/build/build.dart:69)
<asynchronous suspension>
#5      CommandRunner.runCommand (package:args/command_runner.dart:212)
<asynchronous suspension>
#6      main (file:///Users/muhammadhusnain/rush-cli/bin/rush.dart:11)
<asynchronous suspension>
│ debug Bad state: No element                                                   
│ debug #0      ListBase.singleWhere (dart:collection/list.dart:167)
#1      ProcessRunner.runExecutable (package:rush_cli/src/utils/process_runner.dart:23)
<asynchronous suspension>
#2      Compiler.compileJavaFiles (package:rush_cli/src/commands/build/tools/compiler.dart:110)
<asynchronous suspension>
#3      BuildCommand._compile (package:rush_cli/src/commands/build/build.dart:249)
<asynchronous suspension>
#4      BuildCommand.run (package:rush_cli/src/commands/build/build.dart:69)
<asynchronous suspension>
#5      CommandRunner.runCommand (package:args/command_runner.dart:212)
<asynchronous suspension>
#6      main (file:///Users/muhammadhusnain/rush-cli/bin/rush.dart:11)
<asynchronous suspension>
└ ×    ... (0.01s)

• BUILD FAILED (took 0.01s)                                                    
Muhammads-MacBook-Pro:testyou muhammadhusnain$

`rush build` does not generate any extension file on macOS and Linux

Hi Shreyash,

First of all a big thank you for your attempt to deliver a much simpler way creating App Inventor extension files. I have followed your instructions but I have the same issue as 'jaxparrow07'. There is no *.aix file. I also followed your further instructions to 'jaxparrow07' but still no such luck.

Kndrgrds, Johannes (Scotland, UK)

ERR Static interface methods are only supported starting with Android N ?

Hi Sir Shreyash,

ERR Static interface methods are only supported starting with Android N

ERR Static interface methods are only supported starting with Android N (--min-api 24): androidx.browser.trusted.TrustedWebActivityDisplayMode androidx.browser.trusted.TrustedWebActivityDisplayMode.fromBundle(android.os.Bundle)

ERR Compilation failed
Failed

Im try build extension use androidx.browser library(browser-1.3.0.jar),and get error that 🤔
is bug or something ?

Screenshots

error

Desktop

  • OS: [Windows]
  • Version [8 Pro]
  • Java: [OpenJDK ]
  • OpenJDK version "1.8.0_265"
  • OpenJDK Runtime Environment (Zulu 8.48.0.53-CA-win64) (build 1.8.0_265-b11)
  • OpenJDK 64-Bit Server VM (Zulu 8.48.0.53-CA-win64) (build 25.265-b11, mixed mode)

Installation Http status error [502]

Screenshot 2021-04-27 at 12 57 50

Hi Shreyash/Saitwal (apologies for not knowing how to address you!),
Thank you for the update but unfortunately I am not able to install the application.
Have attached screenshot which is self explanatory.
Kndrgrds, Johannes

Build fails if file/directory paths contains whitespaces

Describe the bug
rush build doesn't work on macos

To Reproduce
Steps to reproduce the behavior:

  1. Make a project
  2. Run rush build to build it
  3. Get an error

Expected behavior
It should be built, as nothing is changed.

Screenshots
(Sorry for the japanese screenshot)

javac: Support/.../classes is an invalid flag. 
Usage: javac <options> <source files>
Use -help to view all options

image

Desktop (please complete the following information):

  • OS: macOS Big Sur 11.4 (20F71)
  • Rush Version v1.2.4

Additional context
It seems like it is using "Application Support" folder which contains space in it, so javac is complaining about it.

Cannot find some of the simple app inventor symbols while building?

Describe the bug
When building my extension, rush/java complains about not being able to find some of the symbols that should exist! For example,

To Reproduce
Steps to reproduce the behavior:

Here is the simple test project I am using, which is based off of the sample java file that gets added to each new project. All I have changed is the imports, by adding a few more imports. Looking here, all these symbols should exist, but java is complaining about not finding the SimpleObject symbol. It is clearly able to find SimpleFunction and SimpleProperty just fine.

package test;

import com.google.appinventor.components.annotations.SimpleFunction;
import com.google.appinventor.components.annotations.SimpleObject;
import com.google.appinventor.components.annotations.SimpleProperty;
import com.google.appinventor.components.runtime.AndroidNonvisibleComponent;
import com.google.appinventor.components.runtime.ComponentContainer;
import com.google.appinventor.components.runtime.errors.YailRuntimeError;
import com.google.appinventor.components.runtime.util.YailList;

public class Test extends AndroidNonvisibleComponent {

  public Test(ComponentContainer container) {
    super(container.$form());
  }

  @SimpleFunction(description = "Returns the sum of the given list of integers.")
  public int SumAll(YailList integers) {
    int sum = 0;

    for (final Object o : integers.toArray()) {
      try {
        sum += Integer.parseInt(o.toString());
      } catch (NumberFormatException e) {
        throw new YailRuntimeError(e.toString(), "NumberFormatException");
      }
    }

    return sum;
  }
}
  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
I would expect this project to compile just fine without errors, since Rush says that all I need is JDK8, and no need for a local copy of the App Inventor repo.

Screenshots
image

Desktop (please complete the following information):
Ubuntu 22 on Intel 64-bit

Additional context
Add any other context about the problem here.

Dependency Sync Failed Rush 2.0

This is the verbose of rush deps sync

info  Downloading resolved artifacts...                                       
│ error Exception: Invalid artifact coordinate format: android-33.jar
Expected format: <groupId>:<artifactId>:<version>:<classifier?>
│ debug #0      new ArtifactMetadata (package:rush_cli/src/resolver/resolver.dart:23)
#1      ArtifactResolver.resolveArtifact (package:rush_cli/src/resolver/resolver.dart:321)
#2      SyncSubCommand.sync (package:rush_cli/src/commands/deps/sync.dart:312)
#3      SyncSubCommand.run (package:rush_cli/src/commands/deps/sync.dart:128)
<asynchronous suspension>
#4      CommandRunner.runCommand (package:args/command_runner.dart:212)
<asynchronous suspension>
#5      main (file:///Users/muhammadhusnain/rush-cli/bin/rush.dart:11)
<asynchronous suspension>

[ERROR] java.lang.IllegalArgumentException: Unsupported class file major version 65 on Linux Mint 21.1 Vera

java.lang.IllegalArgumentException: Unsupported class file major version 65
Rush is not compiling extensions on Linux Mint 21.1 Vera.

To Reproduce
Steps to reproduce the behavior:
1.Perform the steps from [rush-cli](https://github.com/shreyashsaitwal/rush-cli) in the Linux MInt 21.1 Vera terminal.
2. Run with rush build.
3. See error.

Screenshots
image

Desktop (please complete the following information):

  • OS: Linux MInt
  • Version 21.1 Vera

Additional context
I tested all the java versions below and the same error occurs.:

image

BASHRC File
export PATH=/opt/ThirdParty-10/platforms/linux64Gcc/gperftools-svn/bin:/opt/paraviewopenfoam510/bin:/opt/ThirdParty-10/platforms/linux64Gcc/cmake-*/bin:/home/iaiaia/OpenFOAM/iaiaia-10/platforms/linux64GccDPInt32Opt/bin:/opt/site/10/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam10/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam10/bin:/opt/openfoam10/wmake:/home/iaiaia/.local/bin:/home/iaiaia/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/openfoam10/bin:$HOME/.rush/bin:/usr/lib/dart/bin

Can't process class [com/sgview/nfccheck/Nfccheck.class] (Unsupported version number [65.0] (maximum 58.0, Java 14)))

Bug Report

Describe the bug
When trying to build an extension using rush CLI, the build process fails with the following error message:

Can't process class [com/sgview/nfccheck/Nfccheck.class] (Unsupported version number [65.0] (maximum 58.0, Java 14))

This indicates that the class file was compiled with Java 21 (version 65.0), which is not supported by the build tools that only support up to Java 14 (version 58.0).

To Reproduce
Steps to reproduce the behavior:

  1. Set up the project with rush CLI.
  2. Attempt to build the project by running rush build.
  3. Observe the error message during the build process.

Expected behavior
The project should compile successfully without any version compatibility errors, producing the expected extension files.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Version: Java 21 (used during compilation), Rush CLI version 1.0.0

Additional context
The issue arises due to a mismatch between the Java version used to compile the classes and the maximum supported version by the build tools. The build tools only support up to Java 14, while the classes were compiled with Java 21. To resolve this, ensure that all class files are compiled using Java 8 or Java 14. Reconfigure your development environment to use a compatible Java version, and update the JAVA_HOME environment variable to point to the correct JDK installation.

Rush Build Failed

Describe the bug
I am having issue always, i cant build the extension.

Screenshots
image
image

Desktop (please complete the following information):

  • OS: Windows

Additional context
I am just doing rush build, its not working . I have java 8

Gradle/Maven Dependencies Support

Is your feature request related to a problem? Please describe.
i want to use libraries/dependencies without adding jar/aar files.

Describe the solution you'd like
add dependencies on gradle like
dependencies {
...
}
or maven

...

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Implement an update mechanism

Currently, to update Rush, users need to re-download the whole rush.zip and replace the old files with the new ones manually. It would be much better if Rush could be updated automatically or with a command like rush update.

Issue in README.md

Describe the bug
In the last (TODO) section of README file, tasks should be listed as checkboxes but some code in the file doesn't preview them like checkboxes but rather like plain text.

Expected behavior
Those text should appear as checkboxes.

Screenshots
image

[Bug] Test Rush Upgrade

Test Rush Upgrade

I dont know is bug or not.
im try new rush version 1.2.0

and try enter command "rush upgrade"

Log

PS C:\Users\kangris> rush upgrade
                      __
     _______  _______/ /_
    / ___/ / / / ___/ __ \
   / /  / /_/ (__  / / / /
  /_/   \__,_/____/_/ /_/

info Fetching data...
Unhandled exception:
GitHub Error: Bad credentials
#0      RepositoriesService.getContents.<anonymous closure> (package:github/src/common/repos_service.dart:573)
#1      GitHub.requestJson (package:github/src/common/github.dart:280)
<asynchronous suspension>
#2      UpgradeUtils.fetchContents (package:rush_cli/commands/upgrade_command/helpers/upgrade_utils.dart:18)
<asynchronous suspension>
#3      UpgradeCommand.run (package:rush_cli/commands/upgrade_command/upgrade_command.dart:36)
<asynchronous suspension>
#4      CommandRunner.runCommand (package:args/command_runner.dart:196)
<asynchronous suspension>
PS C:\Users\kangris>

Desktop (please complete the following information):

  • OS: [Windows]
  • Version [1.0.0]

Error compiling project

I can't compile any project, even though I create a new one and try to compile it afterwards.
My machine is clean and functional.
Is my java correct?
What could it be?
image

Compile issue

When I try to build the extension created with Rush, this error occurs:

user@DESKTOP-BD6HS68 MINGW64 ~/Desktop/SymbolTest/special-chars
$ rush build
                      __
     _______  _______/ /_
    / ___/ / / / ___/ __ \
   / /  / /_/ (__  / / / /
  /_/   \__,_/____/_/ /_/

• Build initialized

┌ Checking project files
│
│  OK Metadata file (rush.yml) found
│
│  OK AndroidManifest.xml file found
└ Done
Unhandled exception:
type 'Null' is not a subtype of type 'DateTime'
#0      BuildCommand.run (package:rush_cli/commands/build_command/build_command.dart:182)
<asynchronous suspension>
#1      CommandRunner.runCommand (package:args/command_runner.dart:196)
<asynchronous suspension>

Well, there is just a single project which seems to work. Which was created while before updating the rust to 1.1.0 or the latest version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.