androidjs-builder icon indicating copy to clipboard operation
androidjs-builder copied to clipboard

Fixed build script when it doesn't run on a *curses terminal and dropped hardcoded prefix for package name

Open blacklight opened this issue 4 years ago • 4 comments

This PR provides:

  • A (very dirty) fix for #126. When androidjs build is run from a non-interactive terminal (e.g. a Docker build, a Makefile, an F-Droid build, or launched/piped from a non-interactive script) it won't have access to the *curses primitives, and therefore calls to methods such as clearLine and cursorTo will fail. Note however that this is a very dirty fix that simply skips those calls if the methods aren't available, but will still print out a lot of ugly all-on-one-line content that was supposed to be a progress bar. The intent is to open a discussion on what's the best approach to deal with this case - I see two options: either entirely disable the ProgressBar output if the advanced terminal drawing features are not available, or add some kind of --no-interactive option to run the script without terminal drawing options.

  • Removed the com.androidjs hardcoded prefix in the manifest generator. Hardcoding the package prefix will almost certainly conflict with the package-name specified on the package.json and result in failures when trying to upload the app to any store.

blacklight avatar Mar 02 '21 00:03 blacklight

@Chhekur this is just a workaround to get things to work, and on a non-interactive terminal this will still print lots of progress bars but without newlines, so it's probably not the right approach. The cleanest approach would probably be to completely disable the progress bar if clearLine or cursorTo are not available.

blacklight avatar Mar 04 '21 10:03 blacklight

@Chhekur this is just a workaround to get things to work, and on a non-interactive terminal this will still print lots of progress bars but without newlines, so it's probably not the right approach. The cleanest approach would probably be to completely disable the progress bar if clearLine or cursorTo are not available.

I got your point but the problem is I don't have so much time to actively work on this, right now! if you can fix this in a better way that would be great :)

Chhekur avatar Mar 04 '21 13:03 Chhekur

It was a great proposition. Please, can you provide a similar solution? I'm actually facing a similar problem as his description at the top.

dannickstark avatar Mar 07 '22 00:03 dannickstark

This has been left so long!

@Chhekur please accept this PR or the other PR (https://github.com/android-js/androidjs-builder/pull/66 ), it's a blocker for using AndroidJS in CICD systems.

Issue within this repo that would be fixed: https://github.com/android-js/androidjs-builder/issues/67

Issue within the androidjs repo that could be removed when this is fixed: https://github.com/android-js/androidjs/issues/161

AlexStormwood avatar Jan 27 '24 03:01 AlexStormwood