Merge remote-tracking branch 'aosp/upstream' into master

* aosp/upstream:
  Randomize cpu affinity
  Be more resilient to directories disappearing during startup
  Pass a Loc into FindEmulator for better warnings
  Add --color_warnings to make warnings/errors like clang
  [AUTHORS] Fix kati instead of glog
  Add Koichi Shiraishi to AUTHORS/CONTRIBUTORS
  [C++] add +build ignore magic comment for go build
  [go] fix ldflags foramt to add '=' for -X flag
  [go] fix stat.Dev type to uint64
  Allow rules to specify custom ninja pools
  Fix some possible performance issues found by clang-tidy

Test: kati tests
Test: multiproduct_build on aosp
Change-Id: I4c427dde2bb9d1a0970e97d1e822e093bd269dfe
tree: 490f25fb9214de750410729a2758ce8d10df5092
  1. .gitignore
  2. .travis.yml
  3. AUTHORS
  4. Android.bp
  5. CONTRIBUTING.md
  6. CONTRIBUTORS
  7. INTERNALS.md
  8. LICENSE
  9. Makefile
  10. Makefile.ckati
  11. Makefile.kati
  12. README.md
  13. affinity.cc
  14. affinity.h
  15. ast.go
  16. bootstrap.go
  17. buf.go
  18. buf_test.go
  19. cmd/
  20. command.cc
  21. command.h
  22. dep.cc
  23. dep.go
  24. dep.h
  25. depgraph.go
  26. doc.go
  27. eval.cc
  28. eval.go
  29. eval.h
  30. evalcmd.go
  31. exec.cc
  32. exec.go
  33. exec.h
  34. expr.cc
  35. expr.go
  36. expr.h
  37. expr_test.go
  38. file.cc
  39. file.h
  40. file_cache.cc
  41. file_cache.h
  42. fileutil.cc
  43. fileutil.go
  44. fileutil.h
  45. fileutil_bench.cc
  46. find.cc
  47. find.h
  48. find_test.cc
  49. flags.cc
  50. flags.go
  51. flags.h
  52. func.cc
  53. func.go
  54. func.h
  55. func_test.go
  56. io.cc
  57. io.h
  58. loc.h
  59. log.cc
  60. log.go
  61. log.h
  62. m2n
  63. main.cc
  64. make-c.sh
  65. make-c/
  66. ninja.cc
  67. ninja.go
  68. ninja.h
  69. ninja_test.cc
  70. ninja_test.go
  71. pack.sh
  72. parser.cc
  73. parser.go
  74. parser.h
  75. pathutil.go
  76. pathutil_test.go
  77. query.go
  78. regen.cc
  79. regen.h
  80. regen_dump.cc
  81. rule.cc
  82. rule.h
  83. rule_parser.go
  84. rule_parser_test.go
  85. runtest.rb
  86. serialize.go
  87. shellutil.go
  88. shellutil_test.go
  89. stats.cc
  90. stats.go
  91. stats.h
  92. stmt.cc
  93. stmt.h
  94. string_piece.cc
  95. string_piece.h
  96. string_piece_test.cc
  97. stringprintf.cc
  98. stringprintf.h
  99. strutil.cc
  100. strutil.go
  101. strutil.h
  102. strutil_bench.cc
  103. strutil_test.cc
  104. strutil_test.go
  105. symtab.cc
  106. symtab.go
  107. symtab.h
  108. testcase/
  109. testutil.h
  110. thread_local.h
  111. thread_pool.cc
  112. thread_pool.h
  113. timeutil.cc
  114. timeutil.h
  115. var.cc
  116. var.go
  117. var.h
  118. version.go
  119. version.h
  120. version_unknown.cc
  121. worker.go
README.md

kati

Build Status

kati is an experimental GNU make clone. The main goal of this tool is to speed-up incremental build of Android.

Currently, kati does not offer a faster build by itself. It instead converts your Makefile to a ninja file.

How to use for Android

Now AOSP has kati and ninja, so all you have to do is

% export USE_NINJA=true

All Android's build commands (m, mmm, mmma, etc.) should just work.

How to use for Android (deprecated way)

Set up kati:

% cd ~/src
% git clone https://github.com/google/kati
% cd kati
% make

Build Android:

% cd <android-directory>
% source build/envsetup.sh
% lunch <your-choice>
% ~/src/kati/m2n --kati_stats  # Use --goma if you are a Googler.
% ./ninja.sh

You need ninja in your $PATH.

More usage examples (deprecated way)

“make clean”

% ./ninja.sh -t clean

Note ./ninja.sh passes all parameters to ninja.

Build a specific target

For example, the following is equivalent to “make cts”:

% ./ninja.sh cts

Or, if you know the path you want, you can do:

% ./ninja.sh out/host/linux-x86/bin/adb