Commit graph

20 commits

Author SHA1 Message Date
Jamie Gennis
6cafc2cddc Update import paths to include github 2015-03-21 01:03:36 -04:00
Colin Cross
f5bd828a14 Run bpfmt -w . to reformat Blueprints file
Updates the Blueprints file to the new format and standard layout.

Change-Id: I1bfb67ab106c2a61fbe6f8201195efc3f8ff5566
2015-01-26 16:56:10 -08:00
Colin Cross
3e8e74f276 Move blueprint/* up a directory
Make integrating with go tools easier by putting the blueprint package
files in the top level directory of the git project instead of in a
subdirectory called blueprint.

Change-Id: I35c144c5fe7ddf34e478d0c47c50b2f6c92c2a03
2015-01-23 14:23:27 -08:00
Jamie Gennis
c4ed709a71 bootstrap: Fix abandoned file removal.
This change makes removeAbandonedFiles perform some of the string substitutions
that are done by the bootstrap script before considering whether a built target
still exists.  It fixes a bug where the bootstrap manifest would get deleted
and subsequently regenerated, resulting in more re-bootstrap iterations than
was necessary.

Change-Id: I946c883dcc31fb77496f64d2573b395ad2cf095d
2015-01-23 13:41:49 -08:00
Jamie Gennis
9e2a4c295b bootstrap: Don't export the script-substituted Ninja vars
Change-Id: I8999f9489415cc53661e079401df519f9d83258e
2015-01-23 13:41:48 -08:00
Jamie Gennis
af43556ce3 Add support for removing abandoned files.
This change makes the bootstrapping process remove any files that were
previously created by invoking a Ninja rule (i.e. they appear in the .ninja_log
file) but are no longer a build output target.

Change-Id: I3c78e563393b97f8ca196ac85c7caa2b3866ffa6
2015-01-23 13:41:48 -08:00
Jamie Gennis
debef53c56 Add a Glob func that returns dirs searched
Change-Id: I35ab9a5f1c7425f42d0e667bac38450afa34c738
2015-01-23 13:41:48 -08:00
Jamie Gennis
8762292240 Add support for unpacking properties into nested structs.
Change-Id: Idb67dcb9cc7f857258b9b3409db68199d42a8001
2015-01-23 13:41:47 -08:00
Jamie Gennis
b9cbdae701 Add the blueprint/proptools package.
This change adds some utility functions for manipulating properties structs
using reflection.

Change-Id: I62017ef06bceb68d536421e50b853449a73daed3
2015-01-23 13:41:47 -08:00
Jamie Gennis
2fb2095caa Stop determining package names from the call stack.
This change replaces the automatic caller package divination with a
PackageContext object that must be explicitly passed in by callers.

Change-Id: I139be29ecf75a7cf8488b3958dee5e44363acc22
2015-01-23 13:41:46 -08:00
Jamie Gennis
c15544dbc7 Sort various things for deterministic output.
Change-Id: If6457713ad442ae3e4179e594820fa1e02e9b240
2015-01-23 13:41:46 -08:00
Jamie Gennis
7d5b2f82ce Simplify module and singleton registration.
This change eliminates blueprint.ModuleType and replaces it with simple factory
functions.  Rather than using the explicitly provided ModuleType names to
essentially identify the Go factory function in the generated Ninja files, we
now use the actual factory function name.

Change-Id: Ib7813e850322a82cc35cdc56bebff7d580a5c6ec
2015-01-23 13:41:46 -08:00
Jamie Gennis
7330a23887 Clean up the bootstrap script a little.
This change makes the bootstrap script take two optional flag-based command
line arguments rather than using positional arguments.  The -i argument
replaces the old positional arguments (one of which was simply not needed), and
the -r flag now causes the script to regenerate the bootstrap Ninja file for
use when working on Blueprint itself.

Additionally this change allows all the configuration variables used in the
script to be overridden by environment variables.  This makes it possible to
create a very simple bootstrap script for a customized Blueprint-based build
system by invoking this script after setting up the proper environment
variables.

Change-Id: I60f890061ae237a68719e1e2d345d1a8e87c851c
2014-06-18 12:57:56 -07:00
Jamie Gennis
7ab5f3c4ba Document the bootstrap process.
This change adds a bunch of docs describing the bootstrap process.  It also
renames a couple things in the source to better correspond with the terminology
used in the docs.  On top of that it makes the standalone build to copy minibp
from the .bootstrap/bin directory to the bin directory to make it easier to
find.

Change-Id: Ibae3e607b59e2caf7d764ec3153155fde208ec1e
2014-06-12 12:16:09 -07:00
Jamie Gennis
86179feee4 Sort modules and singletons for output.
This change causes the module and singleton content in generated Ninja files to
be sorted by name.

Change-Id: I6e1fe6d4211111c7dfa25ebe0fc721701a6d0256
2014-06-11 16:30:42 -07:00
Jamie Gennis
b931456573 Add the blueprint/pathtools package
Change-Id: I0706d8b0c0c5cbab1425c4d0b08070fd66a5900b
2014-06-06 14:41:07 -07:00
Jamie Gennis
598fe760ca Change the bootstrap dir to .bootstrap
Change-Id: I016939015144e29f5981b754b725a6c8e48e3b0d
2014-06-06 14:41:07 -07:00
Jamie Gennis
cbc6f86e34 Fix a re-bootstrapping issue.
This change fixes an issue where the re-bootstrapping process would overwrite a
newer bootstrap manifest with one that it generates using its older minibp.  It
fixes the issue by only generating a new bootstrap manifest right after
rebuilding minibp (as part of the bootstrap process).  It then uses an
additional rebootstrap iteration to replace the old bootstrap manifest with the
new one.

Change-Id: I16bad2f30f6ad7f10da07d77105e8745adec3650
2014-06-06 14:41:07 -07:00
Jamie Gennis
1ebd3b838b Make build.ninja.in independent of the build dir.
This change makes the module definition location that's included in the build
manifest comments use paths relative to the top-level source directory.  This
should make the bootstrap build manifest not get regenerated when using a new
build directory.

Change-Id: I350562ad10aa52688c8841c96c6325502b0faa59
2014-06-04 15:33:08 -07:00
Jamie Gennis
1bc967ed43 Initial Blueprint commit.
Blueprint is a build system component that reads Blueprints files defining
modules to be built, and generates a Ninja build manifest that can be used to
perform all the build actions.  It does not dictate or implement much build
policy itself, but rather provides a framework to ease the process of defining
build logic in Go.

The "blueprint" and "blueprint/parser" Go packages contain the functionality
for reading Blueprint files and invoking build logic functions defined in other
Go packages.

The "blueprint/bootstrap" Go package contains just enough build logic to build
a binary that includes Blueprint and any pure-Go (i.e. no cgo) build logic
defined in external Go packages.  This can be used to create a minimal Ninja
file that's capable of bootstrapping a Blueprint-based build system from
source.

The "blueprint/bootstrap/minibp" Go package contains code for a minimal binary
that includes the build logic defined in the "blueprint/bootstrap" package.
This binary can then create the Ninja file for the bootstrapping process.

Change-Id: I8d8390042372a72d225785cda738525001b009f1
2014-06-04 14:23:32 -07:00