Write build definitions directly to output writer

buildDef.WriteTo was calling valueList to convert all the build
parameter ninjaStrings into strings, which uses ValueWithEscaper
to build a strings.Builder.  This results in building a string
only to immediately copy it into the output writer's buffer.

Instead, pass an io.StringWriter to ValueWithEscaper so it can
build the string directly into the output writer's buffer.  This
requires converting ninjaWriterWithWrap into an io.StringWriter.

Test: ninja_writer_test.go
Change-Id: I02e1cf8259306267b9d2d0ebe8c81e13dd443725
4 files changed
tree: 744f36bc03381a11e794a499a91c1727d7c66e0a
  1. .github/
  2. .gitignore
  3. .gofmt.sh
  4. Blueprints
  5. CODEOWNERS
  6. CONTRIBUTING.md
  7. LICENSE
  8. README.md
  9. blueprint.bash
  10. blueprint_impl.bash
  11. bootstrap.bash
  12. bootstrap/
  13. bpfmt/
  14. bpmodify/
  15. context.go
  16. context_test.go
  17. deptools/
  18. doc.go
  19. glob.go
  20. glob_test.go
  21. go.mod
  22. gotestmain/
  23. gotestrunner/
  24. live_tracker.go
  25. loadplugins/
  26. mangle.go
  27. microfactory/
  28. module_ctx.go
  29. module_ctx_test.go
  30. name_interface.go
  31. ninja_defs.go
  32. ninja_strings.go
  33. ninja_strings_test.go
  34. ninja_writer.go
  35. ninja_writer_test.go
  36. package_ctx.go
  37. parser/
  38. pathtools/
  39. proptools/
  40. provider.go
  41. provider_test.go
  42. scope.go
  43. singleton_ctx.go
  44. splice_modules_test.go
  45. tests/
  46. visit_test.go
README.md

Blueprint Build System

build

Blueprint is a meta-build system that reads in Blueprints files that describe modules that need to be built, and produces a Ninja manifest describing the commands that need to be run and their dependencies. Where most build systems use built-in rules or a domain-specific language to describe the logic for converting module descriptions to build rules, Blueprint delegates this to per-project build logic written in Go. For large, heterogenous projects this allows the inherent complexity of the build logic to be maintained in a high-level language, while still allowing simple changes to individual modules by modifying easy to understand Blueprints files.