Increase logging for device tests.

Many copies or many tests can make it look like the test is locked up.
Log each copy and execution so we can see what's going on.

Change-Id: I50e1f0d8f51dccd8fef8254a9ef09e3f8506e1de
1 file changed
tree: 48fd86ea1c0324b97c366ef4b4efff08364fdb91
  1. build/
  2. docs/
  3. sources/
  4. tests/
  5. toolchains/
  6. .gitignore
  7. Android.mk
  8. checkbuild.py
  9. CleanSpec.mk
  10. find-win-host.cmd
  11. GNUmakefile
  12. ndk-build
  13. ndk-build.cmd
  14. ndk-gdb
  15. ndk-gdb-py
  16. ndk-gdb-py.cmd
  17. ndk-gdb.py
  18. ndk-which
  19. README.md
  20. realpath
  21. remove-windows-symlink.sh
README.md

Android Native Development Kit (NDK)

The NDK allows Android application developers to include native code in their Android application packages, compiled as JNI shared libraries.

See the Getting Started Guide for an introduction.

See the changelist for a list of changes since the previous release.

Finally, discussions related to the Android NDK happen on the android-ndk Google Group.

Building the NDK

Note: This document is for developers of the NDK, not developers that use the NDK.

Both Linux and Windows host binaries are built on Linux machines. Windows host binaries are built via MinGW cross compiler. Systems without a working MinGW compiler can use build/tools/build-mingw64-toolchain.sh to generate their own and be added to the PATH for build scripts to discover.

Building binaries for Mac OS X requires at least 10.8.

Target headers and binaries are built on Linux.

Components

The NDK consists of three parts: host binaries, target prebuilts, and others (build system, docs, samples, tests).

Host Binaries

  • toolchains/ contains GCC, Clang, and Renderscript toolchains.
    • $TOOLCHAIN/config.mk contains ARCH and ABIS this toolchain can handle.
    • $TOOLCHAIN/setup.mk contains toolchain-specific default CFLAGS/LDFLAGS when this toolchain is used.
  • prebuilt/$HOST_ARCH/ contains various tools to make the build system hermetic.
    • make, awk, sed, python, yasm, and for Windows: cmp.exe and echo.exe
  • ndk-depends and ndk-stack should probably go in prebuilt/ to avoid collisions between host variants.

Target Headers and Binaries

  • platforms/android-N/arch-$ARCH_NAME/ contains headers and libraries for each API level.
    • The build system sets --sysroot to one of these directories based on user-specified APP_ABI and APP_PLATFORM.
  • sources/cxx-stl/$STL/$ABI/ contains the headers and libraries for the various C++ STLs.
  • prebuilt/android-$ARCH/gdbserver/ contains gdbserver.

Others

  • build/ contains the ndk-build system and scripts to rebuild NDK.
  • docs/
  • samples/
  • sources/ contains modules useful in samples and apps via $(call import-module, $MODULE)
  • tests/

Prerequisites

  • AOSP NDK Repository

    • Check out the branch master-ndk

      repo init -u https://android.googlesource.com/platform/manifest \
          -b master-ndk
      
      # Googlers, use
      repo init -u \
          persistent-https://android.git.corp.google.com/platform/manifest \
          -b master-ndk
      
    • The only difference between the NDK branch and master is that the NDK repository already has the toolchain repository checked out and patched.

  • Additional Linux Dependencies (available from apt):

    • texinfo
    • gcc-mingw32
    • wine
    • bison
    • flex
    • dmake
    • libtool
    • pbzip2
  • Mac OS X also requires Xcode.

Host/Target prebuilts

For Linux or Darwin:

$ python checkbuild.py --no-package

For Windows, from Linux:

$ python checkbuild.py --system windows

Packaging

The simplest way to package an NDK on Linux is to just omit the --no-package flag when running checkbuild.py. This will take a little longer though, so it may not be desired for day to day development.

To package the NDK for Windows or Darwin (or if more control over the packaging process is needed), invoke build/tools/package-release.sh directly. This process will be improved in a future commit.

Best Practices for Incremental Builds

  • Do not run build/tools/dev-cleanup.sh which erases all prebuilts.
  • Remove the individual prebuilt directory if new build deletes files. This is rare.
  • Package NDK from prebuilt tarballs in $PREBUILT_PATH. It runs build/tools/build-docs.sh which produces no tarball in $PREBUILT_PATH.
  • Unpack and compare against the previous package.