I want to build some arbitrary application, for example, found on GitHub: https://github.com/heruoxin/Clip-Stack (I already have the application, so I don’t need to send links to binary builds)
Often, bundled with the application is a wrapper for Gradle, sometimes the project properties from Eclipse, sometimes nothing. The process itself, despite its apparent simplicity, is rather complicated: you need to deflate the SDK / NDK (now they don't give direct references to them, but more on that later), set up environment variables and run ./gradlew , and after ./gradlew 200-300 megabytes of dependencies, very often some kind of error comes out (for example, that proprietary Java 8 is needed). And even if there is no error, the assembly can gobble up 2-3 gigabytes of memory, the entire swap and then fall, citing a lack of memory (after all, now all the rich are developing on the latest generation macbooks, and everyone is in a hurry - so it’s all going in 10 threads, otzhiraya 10 times more memory). In addition, this approach makes it impossible to compile the application on a network-isolated machine: Android Studio Gradle without connecting to the Internet
Question: how to build an application without the use of thick collectors?
Perhaps the main problem is due to the complexity of settling dependencies. For example, to build the application above, I needed:
support-fragment-25.2.0.aar support-compat-25.2.0.aar support-annotations-25.2.0.jar support-core-utils-25.2.0.aar support-core-ui-25.2.0.aar appcompat-v7-22.2.1.aar recyclerview-v7-25.2.0.aar cardview-v7-25.2.0.aar But it quickly became clear that in the 25th version something was changed and it does not fit, the compiled application just crashes. I downloaded a lot of versions of aar-packages and self-made scripts indexed them, creating a self-made base of characters, but I ran into the problem that in some version there is no necessary feature, and after a couple of versions of this feature (or another) anymore. In addition, it is not very clear where and how to get official binaries, without a proprietary SDK Manager. In general, I gave up.
Analysis of Gradle's behavior showed that javac + dx are not used at all, and aapt is used only for processing images.
If someone has the opportunity / wants to write a light-hearted IDE, or at least a script to build applications, then I will gladly join the project.
References:
https://developer.android.com/studio/build/building-cmdline.html - official instructions lead me to the Gradle that I hate
https://stackoverflow.com/questions/41132753/ - this briefly describes the build process via javac + dx + aapt, additional shine from jarsigner + zipalign. It works (checked personally), however, it doesn’t describe how to do it exactly (however, if you read the manuals, it becomes clear), it’s not described how to resolve dependencies, what to do with resources, etc., but also how to install packages from the sdk.
https://metacpan.org/pod/Android::Build - the link is no longer working, but in the archives you can find a wonderful script that could build simple Android applications
A Lex Hobbit is called into question from How to create a modular android application
