/build/blueprint/tests/ |
D | test_tree_tests.sh | 1 #!/bin/bash -ex 4 stat -c %Y $1 11 export TEMPDIR=$(mktemp -d -t blueprint.test.XXX) 16 rm -rf "${TEMPDIR}" 24 cp -r tests/test_tree "${SRCDIR}" 25 cp -r "${TOP}" "${SRCDIR}/blueprint" 32 #confirm no build.ninja file is rebuilt when no change happens 35 OLDTIME_BOOTSTRAP=$(mtime .bootstrap/build.ninja) 36 OLDTIME=$(mtime build.ninja) 41 if [ ${OLDTIME} != $(mtime build.ninja) ]; then [all …]
|
/build/bazel/docs/ |
D | concepts.md | 1 # Android Build System Concepts 4 build system components and concepts of the Android build system and Bazel, 10 Android Platform build system, and how each component maps to a concept in 13 |Android build system component|Description|Mapping to Bazel concepts| 14 |---|---|---| 15 …-compatible front-end. Encodes build logic in `.mk` scripts. Declares buildable units in `Android.… 16 |Blueprint|Build definition syntax. Build syntax parser. Internal data structures like Modules/Vari… 17 …-like front-end. Encodes build logic in Go. Declares build units in `Android.bp`, parsed by Bluepr… 18 |Ninja|Serialized command line action graph executor. Executes Ninja graph generated from Kati and … 20 |Blueprint + Kati + Soong + Ninja + atest|The entire build pipeline for Android.|Conceptually simil… [all …]
|
/build/soong/tests/ |
D | bootstrap_test.sh | 1 #!/bin/bash -eu 3 set -o pipefail 5 # This test exercises the bootstrapping process of the build system 18 local bootstrap_mtime1=$(stat -c "%y" out/soong/.bootstrap/build.ninja) 19 local output_mtime1=$(stat -c "%y" out/soong/build.ninja) 21 local bootstrap_mtime2=$(stat -c "%y" out/soong/.bootstrap/build.ninja) 22 local output_mtime2=$(stat -c "%y" out/soong/build.ninja) 26 fail "Bootstrap Ninja file did not change on null build" 30 fail "Output Ninja file changed on null build" 37 local mtime1=$(stat -c "%y" out/soong/.bootstrap/build.ninja) [all …]
|
/build/blueprint/bootstrap/ |
D | doc.go | 7 // http://www.apache.org/licenses/LICENSE-2.0 17 // such a build are: 19 // 1. A Ninja binary 27 // Blueprint library and the build logic specific to the source tree. It is 28 // used to generate the Ninja file that describes how to build the entire source 34 // sets primaryBuilder to true the build will fail. 46 // "my/custom/build/logic" 54 // // The top-level Blueprints file is passed as the first argument. 57 // // Create the build context. 77 // the build bootstrapping: [all …]
|
D | build.ninja | 1 # Included by .minibootstrap/build.ninja, which is written by bootstrap.bash 4 # topFile - The path to the top-level Blueprints(etc) file 5 # extraArgs - Any extra arguments to pass to minibp (-t) 6 # bootstrapBuildDir - The path to the build directory 10 myGlobs = ${bootstrapBuildDir}/.minibootstrap/build-globs.ninja 13 rule build.ninja 14 …command = ${builder} ${extraArgs} -b ${bootstrapBuildDir} -n ${builddir} -d ${out}.d -globFile ${m… 19 bootstrapNinja = ${bootstrapBuildDir}/.bootstrap/build.ninja 21 build ${bootstrapNinja}: build.ninja ${topFile} | ${builder}
|
D | command.go | 7 // http://www.apache.org/licenses/LICENSE-2.0 63 flag.StringVar(&CmdlineArgs.OutFile, "o", "build.ninja", "the Ninja file to output") 64 …flag.StringVar(&CmdlineArgs.GlobFile, "globFile", "build-globs.ninja", "the Ninja file of globs to… 65 flag.StringVar(&CmdlineArgs.BuildDir, "b", ".", "the build output directory") 66 flag.StringVar(&CmdlineArgs.NinjaBuildDir, "n", "", "the ninja builddir directory") 68 flag.StringVar(&CmdlineArgs.DocFile, "docs", "", "build documentation file to output") 73 flag.BoolVar(&CmdlineArgs.RunGoTests, "t", false, "build and run go tests during bootstrap") 74 …flag.BoolVar(&CmdlineArgs.UseValidations, "use-validations", false, "use validations to depend on … 76 …flag.BoolVar(&CmdlineArgs.EmptyNinjaFile, "empty-ninja-file", false, "write out a 0-byte ninja fil… 101 result = append(result, "-t") [all …]
|
D | glob.go | 7 // http://www.apache.org/licenses/LICENSE-2.0 32 // The build.ninja file needs to be regenerated any time a file matching the glob is added 33 // or removed. The naive solution is to have the build.ninja file depend on all the 35 // non-matching file is added to a traversed directory, including backup files created by 39 // don't match the glob by having the build.ninja file depend on an intermedate file that 41 // depends on the traversed directories via a depfile. The depfile is used to avoid build 42 // errors if a directory is deleted - a direct dependency on the deleted directory would result 43 // in a build failure with a "missing and no known rule to make it" error. 52 Command: fmt.Sprintf(`%s -o $out -v %d $args`, 67 Build(pctx blueprint.PackageContext, params blueprint.BuildParams) methodSpec [all …]
|
/build/blueprint/ |
D | blueprint_impl.bash | 1 if [ ! "${BLUEPRINT_BOOTSTRAP_VERSION}" -eq "2" ]; then 8 if [ -z "$BLUEPRINT_LIST_FILE" ]; then 12 mkdir -p "$(dirname ${OUR_LIST_FILE})" 14 find . -mindepth 1 -type d \( -name ".*" -o -execdir test -e {}/.out-dir \; \) -prune \ 15 -o -name $TOPNAME -print | sort) >"${TEMP_LIST_FILE}" 16 if cmp -s "${OUR_LIST_FILE}" "${TEMP_LIST_FILE}"; then 33 # Build the bootstrap build.ninja 34 "${NINJA}" -w dupbuild=err -f "${BUILDDIR}/.minibootstrap/build.ninja" 36 # Build the primary builder and the main build.ninja 37 "${NINJA}" -w dupbuild=err -f "${BUILDDIR}/.bootstrap/build.ninja" [all …]
|
D | bootstrap.bash | 5 # with no arguments from the desired build directory. 7 # It can also be invoked from another script to bootstrap a custom Blueprint- 8 # based build system. To do this, the invoking script must first set some or 23 set -e 28 # either an absolute path or one relative to the build directory (which of 30 if [ -z "$BOOTSTRAP" ]; then 33 # WRAPPER should only be set if you want a ninja wrapper script to be 36 [ -z "$WRAPPER" ] && WRAPPER="`dirname "${BOOTSTRAP}"`/blueprint.bash" 40 # either an absolute path or a path relative to the build directory. Whether 41 # its an absolute or relative path determines whether the build directory can [all …]
|
D | blueprint.bash | 3 # This script is intented to wrap the execution of ninja so that we 4 # can do some checks before each ninja run. 8 # Blueprint-based build system. When used by another script, the following 13 # NINJA 19 # For embedding into a custom build system, the current directory when this 23 set -e 25 # BUILDDIR should be set to the path to store build results. By default, 27 # if the custom build system only wants to install their own wrapper. 28 [ -z "$BUILDDIR" ] && BUILDDIR=`dirname "${BASH_SOURCE[0]}"` 30 # NINJA should be set to the path of the ninja executable. By default, this [all …]
|
D | ninja_defs.go | 7 // http://www.apache.org/licenses/LICENSE-2.0 25 // A Deps value indicates the dependency file format that Ninja should expect to 48 // A PoolParams object contains the set of parameters that make up a Ninja pool 52 Depth int // The Ninja pool depth. 55 // A RuleParams object contains the set of parameters that make up a Ninja rule 58 // These fields correspond to a Ninja variable of the same name. 59 Command string // The command that Ninja will run for the rule. 62 Description string // The description that Ninja will print for the rule. 63 Generator bool // Whether the rule generates the Ninja manifest file. 64 Pool Pool // The Ninja pool to which the rule belongs. [all …]
|
D | singleton_ctx.go | 7 // http://www.apache.org/licenses/LICENSE-2.0 52 // return value can always be type-asserted to the type of the provider. The return value should 53 // always be considered read-only. It panics if called before the appropriate mutator or 67 …// build rules after an error, allowing it to report additional errors in a single run, but in cas… 71 …// Variable creates a new ninja variable scoped to the singleton. It can be referenced by calls t… 75 …// Rule creates a new ninja rule scoped to the singleton. It can be referenced by calls to Build … 79 // Build creates a new ninja build statement. 80 Build(pctx PackageContext, params BuildParams) methodSpec 82 …// RequireNinjaVersion sets the generated ninja manifest to require at least the specified version… 85 // SetNinjaBuildDir sets the value of the top-level "builddir" Ninja variable [all …]
|
/build/blueprint/.github/workflows/ |
D | build.yml | 1 name: build 11 build: 12 runs-on: ubuntu-latest 16 name: Build and test on go ${{ matrix.go }} 19 - name: Set up Go ${{ matrix.go }} 20 uses: actions/setup-go@v2 22 go-version: ${{ matrix.go }} 25 - name: Check out code 28 - name: Install ninja 30 mkdir -p ${GITHUB_WORKSPACE}/ninja-bin; cd ${GITHUB_WORKSPACE}/ninja-bin [all …]
|
/build/make/core/ |
D | ninja_config.mk | 2 NINJA ?= prebuilts/build-tools/$(HOST_PREBUILT_TAG)/bin/ninja 4 NINJA ?= prebuilts/build-tools/$(HOST_PREBUILT_TAG)/asan/bin/ninja 7 KATI_OUTPUT_PATTERNS := $(OUT_DIR)/build%.ninja $(OUT_DIR)/ninja%.sh 9 # Modifier goals we don't need to pass to Ninja. 17 ECLIPSE-% \ 20 build-art% \ 21 build_kernel-nodeps \ 22 clean-oat% \ 28 dump-products \ 31 online-system-api-sdk-docs \ [all …]
|
/build/soong/ui/build/ |
D | soong.go | 7 // http://www.apache.org/licenses/LICENSE-2.0 15 package build package 51 // This uses Android.bp files and various tools to generate <builddir>/build.ninja. 53 // However, the execution of <builddir>/build.ninja happens later in 54 // build/soong/ui/build/build.go#Build() 59 // 1. We use "Microfactory", a simple tool to compile Go code, to build 61 // parts of soong_build that are needed to build itself. 63 // that describe itself and emits .bootstrap/build.ninja that describes 64 // how to build its full version and use that to produce the final Ninja 66 // 3. soong_ui executes .bootstrap/build.ninja [all …]
|
D | kati.go | 7 // http://www.apache.org/licenses/LICENSE-2.0 15 package build package 33 const katiCleanspecSuffix = "-cleanspec" 34 const katiPackageSuffix = "-package" 36 // genKatiSuffix creates a filename suffix for kati-generated files so that we 37 // can cache them based on their inputs. Such files include the generated Ninja 41 // Currently that includes the TARGET_PRODUCT and kati-processed command line 45 katiSuffix := "-" + config.TargetProduct() 49 katiSuffix += "-" + spaceSlashReplacer.Replace(strings.Join(args, "_")) 55 shortSuffix := "-" + fmt.Sprintf("%x", md5.Sum([]byte(katiSuffix))) [all …]
|
D | build.go | 7 // http://www.apache.org/licenses/LICENSE-2.0 15 package build package 32 // Run soong_build with Kati for a hybrid build, e.g. running the 42 // can be parsed as ninja output. 44 ensureEmptyFileExists(ctx, filepath.Join(config.OutDir(), ".out-dir")) 60 {{end -}} 65 {{end -}} 70 …// If we're in SkipKati mode but want to run kati ninja, skip creating this file if it already exi… 79 ctx.Fatalln("Failed to create combined ninja file:", err) 84 ctx.Fatalln("Failed to write combined ninja file:", err) [all …]
|
D | ninja.go | 7 // http://www.apache.org/licenses/LICENSE-2.0 15 package build package 30 // Constructs and runs the Ninja command line with a restricted set of 31 // environment variables. It's important to restrict the environment Ninja runs 34 ctx.BeginTrace(metrics.PrimaryNinja, "ninja") 37 // Sets up the FIFO status updater that reads the Ninja protobuf output, and 38 // translates it to the soong_ui status output, displaying real-time 39 // progress of the build. 44 executable := config.PrebuiltBuildTool("ninja") 46 "-d", "keepdepfile", [all …]
|
/build/soong/docs/ |
D | perf.md | 1 # Build Performance 3 ## Debugging Build Performance 7 soong_ui has tracing built in, so that every build execution's trace can be 8 viewed. Just open `$OUT_DIR/build.trace.gz` in Chrome's <chrome://tracing>, or 10 stored in `build.trace.#.gz` (larger numbers are older). The associated logs 24 …0:00 build out/target/product/generic_arm64/obj/FAKE/sepolicy_neverallows_intermediates/policy_2.c… 25 …0:04 build out/target/product/generic_arm64/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_n… 26 …0:13 build out/target/product/generic_arm64/obj/ETC/plat_sepolicy.cil_intermediates/plat_sepolicy.… 27 …0:01 build out/target/product/generic_arm64/obj/ETC/plat_pub_versioned.cil_intermediates/plat_pub_… 28 …0:02 build out/target/product/generic_arm64/obj/ETC/vendor_sepolicy.cil_intermediates/vendor_sepol… [all …]
|
/build/soong/bazel/ |
D | constants.go | 6 // Platform Build systems. Each run name represents an unique key 9 // Perform a bazel build of the phony root to generate symlink forests 10 // for dependencies of the bazel build. 11 BazelBuildPhonyRootRunName = RunName("bazel-build-phony-root") 13 // Perform aquery of the bazel build root to retrieve action information. 14 AqueryBuildRootRunName = RunName("aquery-buildroot") 16 // Perform cquery of the Bazel build root and its dependencies. 17 CqueryBuildRootRunName = RunName("cquery-buildroot") 19 // Run bazel as a ninja executer 20 BazelNinjaExecRunName = RunName("bazel-ninja-exec")
|
/build/soong/scripts/ |
D | diff_build_graphs.sh | 1 #!/bin/bash -eu 9 # http://www.apache.org/licenses/LICENSE-2.0 17 set -e 20 # changes to the generated ninja files. This is to reduce the effort required to be confident 32 Usage: diff_build_graphs.sh [--products=product1,product2...] <OLD_VERSIONS> <NEW_VERSIONS> 34 This file builds and parses the build files (Android.mk, Android.bp, etc) for each requested 35 product and for both sets of versions, and checks whether the ninja files (which implement 36 the build graph) changed between the two versions. 38 …Example: diff_build_graphs.sh 'build/soong:work^ build/blueprint:work^' 'build/soong:work build/bl… 41 --products=PRODUCTS comma-separated list of products to check" [all …]
|
D | reverse-deps.sh | 3 set -eu 11 # http://www.apache.org/licenses/LICENSE-2.0 19 # Tool to evaluate the transitive closure of the ninja dependency graph of the 28 Evaluate the reverse transitive closure of ninja targets depending on one or 33 -(no)quiet Suppresses progress output to stderr and interactive 34 alias -(no)q prompts. By default, when stderr is a tty, progress gets 39 -sep=<delim> Use 'delim' as output field separator between notice 43 -csv Shorthand for -sep=',' 46 $ source build/envsetup.sh 49 to setup the build environment, choose a target platform, and build the ninja [all …]
|
/build/soong/cmd/soong_build/ |
D | main.go | 7 // http://www.apache.org/licenses/LICENSE-2.0 58 flag.StringVar(&delvePath, "delve_path", "", "Path to Delve. Only used if --delve_listen is set") 61 flag.StringVar(&docFile, "soong_docs", "", "build documentation file to output") 62 …QueryViewDir, "bazel_queryview_dir", "", "path to the bazel queryview directory relative to --top") 102 // Bazel-enabled mode. Soong runs in two passes. 103 // First pass: Analyze the build tree, but only store all bazel commands 105 // TODO(cparsons): Don't output any ninja file, as the second pass will overwrite 119 // Second pass: Full analysis, using the bazel command results. Output ninja file. 136 // Run the code-generation phase to convert BazelTargetModules to BUILD files. 187 // Blueprint to BUILD files before everything else. [all …]
|
/build/make/ |
D | README.md | 1 # Android Make Build System 3 This is the Makefile-based portion of the Android Build System. 5 For documentation on how to run a build, see [Usage.txt](Usage.txt) 11 [build-system.html](/core/build-system.html). Our Android.mk files look similar, 12 but are entirely different from the Android.mk files used by the NDK build 14 platform build system -- most are not. 16 This Makefile-based system is in the process of being replaced with [Soong], a 17 new build system written in Go. During the transition, all of these makefiles 18 are read by [Kati], and generate a ninja file instead of being executed 19 directly. That's combined with a ninja file read by Soong so that the build [all …]
|
/build/soong/makedeps/ |
D | deps_test.go | 7 // http://www.apache.org/licenses/LICENSE-2.0 32 // These come from the ninja test suite 35 input: "build/ninja.o: ninja.cc ninja.h eval_env.h manifest_parser.h", 37 Output: "build/ninja.o", 39 "ninja.cc", 40 "ninja.h", 75 input: `Project\Dir\Build\Release8\Foo\Foo.res : \ 82 Output: `Project\Dir\Build\Release8\Foo\Foo.res`, 108 // Ninja includes a number of '=', but our parser can't handle that, 119 en@quot.header~ t+t-x!1 \ [all …]
|