Search code examples
androidbuildr

Build android apk with apache buildr


Trying to build my android project with Buildr (Apache), but can't find any info on how to do it, and my attempts all fail. A example buildfile or a "no it dosent work" answer would be good :)


Solution

  • We have generated android packages with buildr.

    1. You have to call the aapt code generator before compiling. There is an example in the buildr wiki how to hook up a source generator.

      system( @aapt, "package", "-m", "-J", to, "-M", _("AndroidManifest.xml"), "-S", _("res"), "-I", @androidjar, from )

    2. For the apk we have a custom package task, which calls dx, aapt and apkbuildr

      system( @aapt, "package", "-f", "-M", ("AndroidManifest.xml"), "-F", apkdir + "/resources.ap", "-S", _("res"), "-I", @androidjar )

      system( @apkbuilder, apkdir + "/" + projectname + "signed.apk", "-z", apkdir + "/resources.ap", "-f", apkdir + "/classes.dex", "-d", "-rj", _(:target, "libs"))

      system( @apkbuilder, apkdir + "/" + projectname + "unsigned.apk", "-z", apkdir + "/resources.ap", "-f", apkdir + "/classes.dex", "-u", "-rj", _(:target, "libs"))