[Qbs] setup-android, no --system?

Christian Gagneraud chgans at gmail.com
Fri May 15 16:54:05 CEST 2020


On Sat, 16 May 2020 at 01:46, Richard Weickelt <richard at weickelt.de> wrote:
> > I was just surprised that --system is supported by all qbs
> > setup/config tools but qbs-setup-android. I don't see any compelling
> > reason for that, do you?
> > Maybe it was simply never needed, hence never implemented.
>
> Probably. It's a valid suggestion though. Wanna submit a patch?

I'll add that to my TODO list

> > As a side note, i don't install Android the same way. I use what i
> > believe is the new approach: install commandline-tools first, and run
> > sdk manager with a package requirement file, here is mine right now:
> > build-tools;28.0.3
> > ndk;21.0.6113669
> > patcher;v4
> > platform-tools
> > platforms;android-28
>
> Ah thanks. That looks helpful. We should do the same. It would be nice if
> you could post a more comprehensive code snippet once you are done.

ENV ANDROID_PREFIX /opt/android
ENV ANDROID_TOOLS commandlinetools-linux-6200805_latest.zip
ENV PATH $ANDROID_PREFIX/cmdline-tools/tools/bin:$PATH
ADD $ANDROID_TOOLS android-packages /tmp/
RUN mkdir -p $ANDROID_PREFIX/cmdline-tools \
    && unzip -d $ANDROID_PREFIX/cmdline-tools/ /tmp/$ANDROID_TOOLS \
    && echo 'y' | sdkmanager --install \
        $(cat /tmp/android-packages | grep -v -e '^#' -e '^$')

I have comments in my package file, not sure if it's supported or not.
If you don't, then you can use:
echo 'y' | sdkmanager --install /path/to/requirements/file

Similarly, i do:
RUN /tmp/install-qt.sh \
        --version $QT_VERSION \
        --directory $QT_PREFIX \
        --target $QT_TARGET \
        --toolchain $QT_TOOLCHAIN \
        $(cat /tmp/qt-packages | grep -v -e '^#' -e '^$')

Thank you so much for that script!
Mandatory nitpicks:
- use of http, not https
- no integrity checks (sha1, but that's what piss me off, see below)
- can't install cmake/ninja/conan... (you wouldn't like my patch: "The
repository structure is a mess. Try different URL variants")

I never understood why they don't have a master checksum file.
Downloading gazillion of tiny sha1 files kills the MaintenaceTool
friendliness when you're in New Zealand downloading from Japan.
Your script makes the process blazing fast (but unsafe).
Thanks for that <= odd statement

Chris


More information about the Qbs mailing list