[Qbs] building android aab package help

Raphael Cotty raphael.cotty at gmail.com
Fri Apr 17 13:03:54 CEST 2020


The android tool aapt2 manages resources. Some output files required for
the aab package need to be in the protobuf format. Also the R.java
generated by aap2 is different from apk to aab.
That's what I meant by context.
The aab package doesn't need the apk package to be built.

Because both packages need exactly the same input and because some of the
rules are the same (java ones, dex one) I think it makes sense to build
both packages by the same product.

Le ven. 17 avr. 2020 à 09:16, Christian Kandeler <christian.kandeler at qt.io>
a écrit :

> [Redirecting back to the mailing list]
>
> On Thu, 16 Apr 2020 20:17:47 +0200
> Raphael Cotty <raphael.cotty at gmail.com> wrote:
>
> > Le mer. 15 avr. 2020 à 09:48, Christian Kandeler <
> christian.kandeler at qt.io>
> > a écrit :
> >
> > > Building an aab is similar to building apk. They both take the same
> inputs
> > > > (including java files) and generate a java file (R.java) but in a
> > > different
> > > > way.
> > > >
> > > > I first tried to add the android.aab type to the product type
> property in
> > > > order to build both types.
> > > > But I can't find a way to redirect all java files + the R.java apk
> to the
> > > > next apk rule and all the java files + R.java aab to the next aab
> rule
> > > > (without changing the java module).
> > >
> > > I don't understand this part. What is a "next rule"? What do you mean
> by
> > > "redirect"?
> >
> > If I could duplicate the java modules I'd do this:
> > I'd tag all java files in the product to java.java-apk and java.java-aab.
> > The the R.java generated for apk will be tagged java.java-apk
> > The the R.java generated for aab will be tagged java.java-aab
> >
> > One copy of the java modules will have this rule:
> > [java.java-apk] => [java.class-apk]
> > The other copy:
> > [java.java-aab] => [java.class-aab]
> >
> > I'd also have 2 rules for the dex step (identical prepare script)
> > [java.class-apk] => [dex-apk]
> > [java.class-aab] => [dex-aab]
> >
> > Then the 2 final steps (different prepare script):
> > [dex-apk] => [apk]
> > [dex-aab] => [aab]
> >
> > That's obviously horrible. But that shows the 2 paths.
> >
> > But can this be done with qbs without to duplication of code?
>
> The answer depends on my earlier question you did not answer:
>
> > > And what is the apk/aab "context"?
> > > Are you saying you need to build both the APK and the AAB file? If so,
> > > what is the relationship between them?
>
>
> Christian
> _______________________________________________
> Qbs mailing list
> Qbs at qt-project.org
> https://lists.qt-project.org/listinfo/qbs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20200417/0d099993/attachment.html>


More information about the Qbs mailing list