aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
Commit message (Collapse)AuthorAgeFilesLines
* fileslist: hash the content of symlink, not the file it points to.Sen Jiang2017-03-301-11/+19
| | | | | | | | | | | | | IsDir() doesn't handle the case where the file is a symlink to a directory, which cause fileslist to crash. The hash is used to validate whether system image is the same, so hashing the content of symlink makes more sense. Bug: 36274890 Test: joule builds Change-Id: I6359418a5b28f8da13f85b01a30a72228fecf4ce (cherry picked from commit 1b4141fbdf2d6b277d70e06c6e594583d7ca05b3)
* Add fileslist.go to calculate hashes in parallelMakoto Onuki2017-03-282-0/+185
| | | | | | | | Bug: 36274890 Test: Manual Change-Id: I548da5607cf3b993ad21cbb04a57fcbd5bfb7f51 (cherry picked from commit 620e6ad3819a3124404c8358729cd6a20139e6f9)
* Added functionality in soong_zip that supports adding root prefix.Nan Zhang2017-03-201-63/+79
| | | | | | | | | | | | | | | Added -P flag in soong_zip: It provided a path prefix which will be added in front after -f/-l was applied with -C. eg. ./soong_zip -o /path1/../ -P a/c -C d/e -f d/e/test.txt zip_dest: a/c/test.txt Bug: b/31676493 Test: go build -a to build a real soong_zip, and test it with real files. Change-Id: Ic924ba252e963ca5847c370f733058888426b696
* Refactor compressWholeFile to take a zipEntryandroid-n-mr2-preview-2Dan Willemsen2017-03-151-18/+5
| | | | | | Test: m -j vts; compare android-vts.zip Test: soong_zip -C ./ -f short_test.sh -f log -o test.zip Change-Id: I9a843c6f8436ecfacc7948915e50f25c04497057
* Preserve executable bit in soong_zipDan Willemsen2017-03-151-2/+10
| | | | | | Bug: 36292596 Test: m -j vts; zipinfo out/host/linux-x86/vts/android-vts.zip Change-Id: If595641544cc387019d93b99e0a7890e0b7a9453
* Fix `dist` if $DIST_DIR/logs doesn't existDan Willemsen2017-03-011-3/+4
| | | | | | Bug: 35886901 Test: rm -rf out; m -j dist Change-Id: I1008d9eef884d60766e35a543e72df5df01d61de
* Updates for the new ckati dropDan Willemsen2017-02-241-2/+1
| | | | | | | | | | | | | We can start removing out directories again in multiproduct_kati, since the opendir bug has been fixed. Add --color_warnings to the Kati command line. Since this is different from Make, take this opportunity to reorder the command line to make more sense. This wasn't done before because kati forces a regen whenever the command line changes. Test: USE_SOONG_UI=true m -j blueprint_tools Change-Id: I5ad03359fbc16db482722946202297c1ae0f2b90
* Don't use runtime.Version() to find the current go versionDan Willemsen2017-02-221-1/+15
| | | | | | | | | That will be the go version at compile time. So read $GOROOT/VERSION, or fall back to executing `$GOROOT/bin/go version` to find the go version currently in GOROOT. Test: Ensure everything rebuilds when switching between go1.8rc2 and go1.8 Change-Id: I8738a7aa249a088b1e0668af260fa3974844dab7
* increase javac_filter line length limit to 2MBColin Cross2017-02-191-0/+4
| | | | | | | | | Some javac wrappers output the entire list of java files being compiled on a single line, which can be very large, set the maximum buffer size to 2MB. Test: pipe the grok build output through soong_javac_wrapper Change-Id: Ib208461dca02ced4959433b7695ec760dc134468
* Add soong_javac_filter toolColin Cross2017-02-093-0/+202
| | | | | | | | | | | | | | | | The soong_javac_filter tool will take the output of the javac tool on stdin and produce a colorized version similar to what clang produces on stdout. It also strips the useless "warning there are warnings" messages: Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Modules that want the warnings can pass the appropriate -Xlint options. Test: javac_filter_test Change-Id: Ic8d337d95ae6c48146771f2982fd1316cb7d82be
* Ship the build log and trace on the build serversDan Willemsen2017-02-072-4/+11
| | | | | Test: m -j; m -j dist Change-Id: I4718e7a0cda6719bbab4243038ea2666c212cf19
* Add build tracingDan Willemsen2017-02-064-11/+32
| | | | | | | | | | | This creates a rotating build.trace.gz in the out directory that can be loaded with chrome://tracing. It'll include start and end timings for make/soong/kati/ninja, and it will import and time-correct the ninja log files. Test: m -j; load out/build.trace.gz in chrome://tracing Test: multiproduct_kati -keep; load out/multiproduct*/build.trace.gz Change-Id: Ic060fa9515eb88d95dbe16712479dae9dffcf626
* Add multiproduct_katiDan Willemsen2017-02-063-8/+218
| | | | | | | | | | | | | | | This is a replacement for build/tools/kati_all_products.sh using the new Soong ui/build package. It doesn't even attempt to run ninja, and it can be configured to run only the product config, or only the product config and Soong. For AOSP on my machine: -only-config 1.4s -only-soong 1m20s <none> 13m Test: multiproduct_kati Change-Id: Ie3e6e7bdf692e46a8b8eb828f437190f8003500b
* Add microfactory to bootstrap a go program with minimal overheadDan Willemsen2017-02-063-0/+971
| | | | | | | | | | | | | | | | | | | | | | | | | microfactory is a tool to incrementally compile a go program. It's similar to `go install`, but doesn't require a GOPATH. A package->path mapping can be specified as command line options. All input files are hashed, and if any change, the necessary packages will be rebuilt. microfactory can (re)build itself as necessary, so combined with a shell script that runs `go run microfactory.go` the first time, it can bootstrap a go program entirely from sources with just a working goroot. Time to build soong_ui only using source & GOROOT: first time no-change incremental microfactory 1400ms 15ms go install 670ms 130ms While microfactory takes longer the first time, almost half of that time is from `go run` and building microfactory for use later. If microfactory only has to build soong_ui, it's about 580ms. Test: USE_SOONG_UI=true m -j blueprint_tools Test: go test -bench . build/soong/cmd/microfactory/microfactory_test.go Change-Id: I4d2b9825788144fa10042bbd804482e44f459a54
* Add a Go replacement for our top-level Make wrapperDan Willemsen2017-02-062-0/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now this mostly just copies what Make is doing in build/core/ninja.mk and build/core/soong.mk. The only major feature it adds is a rotating log file with some verbose logging. There is one major functional difference -- you cannot override random Make variables during the Make phase anymore. The environment variable is set, and if Make uses ?= or the equivalent, it can still use those variables. We already made this change for Kati, which also loads all of the same code and actually does the build, so it has been half-removed for a while. The only "UI" this implements is what I'll call "Make Emulation" mode -- it's expected that current command lines will continue working, and we'll explore alternate user interfaces later. We're still using Make as a wrapper, but all it does is call into this single Go program, it won't even load the product configuration. Once this is default, we can start moving individual users over to using this directly (still in Make emulation mode), skipping the Make wrapper. Ideas for the future: * Generating trace files showing time spent in Make/Kati/Soong/Ninja (also importing ninja traces into the same stream). I had this working in a previous version of this patch, but removed it to keep the size down and focus on the current features. * More intelligent SIGALRM handling, once we fully remove the Make wrapper (which hides the SIGALRM) * Reading the experimental binary output stream from Ninja, so that we can always save the verbose log even if we're not printing it out to the console Test: USE_SOONG_UI=true m -j blueprint_tools Change-Id: I884327b9a8ae24499eb6c56f6e1ad26df1cfa4e4
* Move globbing to BlueprintColin Cross2016-11-042-100/+0
| | | | | | | | | | | | Move Soong's globbing-with-dependencies support into Blueprint so it can be used for subdirs= lines in Android.bp files. Blueprint has a slight change in behavior around subname= lines, it now always uses the subname and doesn't fall back to Blueprints. To support the Blueprints files in build/blueprint, use them directly with build=. Test: build, add source file that matches glob, rebuild Change-Id: Ifd0b0d3bc061aae0a16d6c7ca9a1cd8672656b4d
* Move registration into android packageandroid-n-mr1-preview-2android-n-mr1-preview-1Colin Cross2016-10-121-3/+1
| | | | | | | | Mutator registration is tightly coupled with the android package, move all registration from the soong package to the android package. Test: build.ninja identical Change-Id: Ie183d0b52cc7431c9e05b231934d189208ef1efe
* Move Android.bp definitions into subdirsDan Willemsen2016-08-255-0/+120
| | | | | Test: m blueprint_tools still produces the same tools Change-Id: Ia1e2e43c62cb6035616bef9fbef56417b46cf3a4
* Rename soong_jar to soong_zipDan Willemsen2016-08-112-5/+5
| | | | | | | This is a general purpose tool that happens to contain some jar specific features. Change-Id: I05f4654d4517c245ad7a3c15492e0d2368bbf64f
* soong_jar: Parallel compressionDan Willemsen2016-08-112-37/+522
| | | | | | | | | | | | | | | | | This compresses multiple files in parallel, and will split up larger files (5MB+) into smaller chunks (1MB) to compress in parallel. There is a small size overhead to recombine the chunks, but it's only a few bytes per chunk, so for a 1MB chunk, it's minimal. Rough numbers, with everything in the page cache, this can compress ~4GB (1000 files) down to 1GB in 6.5 seconds, instead of 120 seconds with the non-parallel soong_jar and 150 seconds with zip. Go's DEFLATE algorithm is still a bit worse than zip's -- about 3.5% larger file sizes, but for most of our "dist" targets that is fine. Change-Id: Ie4886c7d0f954ace46e599156e35fea7e74d6dd7
* Add zip2zip tool to copy zip entries from one file to anotherDan Willemsen2016-08-101-0/+128
| | | | | | | | | | | | | | | | This doesn't do any decompression / recompression, but just copies over the already compressed contents. So it's similar to zip -U, but allows rewriting of the paths. The first expected usecase is to replace img_from_target_files during the build, since it does the equivalent of this: zip2zip -i <target-files.zip> -o <img.zip> OTA/android-info.txt:android-info.txt IMAGES/*:. Except it decompresses and recompresses the images, which takes over a minute instead of a few seconds. Change-Id: I88d0df188635088783223873f78e193272dbdf1c
* soong_jar: Hardcode timeDan Willemsen2016-08-051-1/+1
| | | | | | We want reproducible builds, so timestamps are not useful. Change-Id: I5144bc62ac37c3c9d7e0638f3b3648a60d887702
* soong_jar: Implement symlinks, fix directoriesDan Willemsen2016-08-051-5/+45
| | | | | | | | | | | | | | | Ensure that we only create one directory entry, not one with a / at the end and another without. Clean incoming paths to prevent other similar duplicates. When adding directories specified directly as inputs, use the relative path just like files, not the full path. Instead of traversing symlinks, addg them to the zip file directly. Present an error instead of crashing when an input does not exist. Change-Id: Id6d6561fe12c28398f6096bf9bcae602bb7aa491
* Fix govet issueColin Cross2016-05-301-1/+1
| | | | Change-Id: I67705c5c1240bea6a21b7d62fd26d296d49735d4
* Rename common to androidColin Cross2016-05-181-2/+2
| | | | | | | | | | | | | | | | Rename the "common" package to "android", because common is too generic. Also removes all android.Android naming stutter. Ran: gomvpkg -from 'android/soong/common' -to 'android/soong/android' gorename -from '"android/soong/android".AndroidModuleContext' -to 'ModuleContext' gorename -from '"android/soong/android".AndroidBaseContext' -to 'BaseContext' gorename -from '"android/soong/android".AndroidModuleBase' -to 'ModuleBase' gorename -from '"android/soong/android".AndroidBottomUpMutatorContext' -to 'BottomUpMutatorContext' gorename -from '"android/soong/android".AndroidTopDownMutatorContext' -to 'TopDownMutatorContext' gorename -from '"android/soong/android".AndroidModule' -to 'Module' Change-Id: I3b23590b8ce7c8a1ea1139411d84a53163288da7
* Delay dependency errors to ninja time for unbundled buildsColin Cross2015-12-181-0/+2
| | | | | | | | | Unbundled builds may use a subset of the tree, which can bring in unused modules but not their dependencies. Delay handling of dependency errors for unbundled builds to ninja time, which will prevent errors if only modules with satisified dependencies are built. Change-Id: Ib93bae93fcfa0b55df500a30d8e35231ffb0987c
* Use SRCDIR as a working directoryDan Willemsen2015-09-171-2/+2
| | | | | | | | | | | The existing behavior of using the build directory as the working directory is useful if you want to move/copy the output directory around and SRCDIR still refers the the source. But, it's more useful to have the source directory be the working directory. Tools like cpp(__FILE__) and other debug prints embed relative paths from the working directory. We also have tools that expect the working directory to be $TOP. Change-Id: Ia0f1d3c6b7df72d61cf5628efa2baa98bd19775b
* Use the blueprint plugin infrastructureDan Willemsen2015-09-151-5/+0
| | | | | | | | Instead of using this hardcoded list, use the blueprint plugin infrastructure to find them at build time and load them. Bug: 23567252 Change-Id: Iae87e8c9bf020f4beb42c418b9a6bf8b0fe8b601
* Read product variables from soong.variablesColin Cross2015-09-141-1/+1
| | | | | | | Refactor the soong.config loading code to support reading in product variables from soong.variables. Change-Id: I389e6bb5c501b53167267d5f5d0d25557811cf72
* use init functions to register module types, etc.Colin Cross2015-07-091-53/+8
| | | | | | | | Instead of putting all the blueprint registrations in soong_build, put them all in init() functions. This puts the registration next to the implementation. Change-Id: Ide1a749518f5e9d1367a18ab3bb1d91da3310c76
* Add per-directory build targetsColin Cross2015-06-171-1/+1
| | | | | | | | | | | Build a map of blueprint directory to modules built from that directory, and then add phony rules to build.ninja that emulate the behavior of mma in the current build system. Also fixes checkbuild to depend on checkbuild files and installable files, but not installed files. Change-Id: I8bad6e93387940df7439dbd4554f6d79f924c65f
* Separate HostOrDevice out of ArchColin Cross2015-05-091-0/+1
| | | | | | | | | | Take HostOrDevice out of Arch, and put it into AndroidModuleBase instead. Also separate out the host vs. device mutator from ArchMutator. This will make it possible for genrules to depend on a host tool, regardless of which host arches it is compiled for. Change-Id: I22bbfd28b65c3eebdfa101a712f90dd615148dc8
* Add cc_benchmark module typeColin Cross2015-05-071-0/+2
| | | | Change-Id: I83bed375fa77518baaab4260e714a9368761f0bc
* Add support for genruleColin Cross2015-04-291-0/+1
| | | | | | | | | Add genrule, which uses a host executable (possibly built by the build system) to generate a single source file. This differs slightly from gensrcs, which takes a list of sources and translates them through a host executable to individual source files. Change-Id: I94bda62c4c53fb3f3817def190e6a7561508d297
* ndk: Use prebuilt NDK CRT objects.Dan Albert2015-04-291-0/+1
| | | | Change-Id: Ie8d58fa7c4ef2a62338c20c3078603ac98be0f9c
* soong_jar: ignore directories passed to jar unless -d is setColin Cross2015-04-271-0/+7
| | | | | | | | | Java resource lists created by globs like "**/*" may include directories. Ignore them when creating the zip file unless -d was passed on the command line. Fixes read: is a directory errors. Change-Id: Ifa6fd4fbd8262f700bed1f4a7268f11618dc305c
* soong_jar: combine zipWriter and zipInfo into a classColin Cross2015-04-271-32/+43
| | | | | | | | Combine the zipWriter and info arguments that are passed into every function into a single writer class, and make all the functions methods on the new class. Change-Id: I29d0164578894974ceaed9482349604633de6533
* Add support for building android appsColin Cross2015-04-201-0/+1
| | | | | | | | Add support for running aapt to generate R.java and Manifest.java, compiling java into jar, adding resources to the jar to convert it into an apk, signing the apk, and zipaligning the apk. Change-Id: I7a73fef590d07f35b3d0b56a8571780c09bb10ae
* Move SDK prebuilts to new prebuilt_sdk module typeColin Cross2015-04-131-0/+1
| | | | | | | | | | | SDK prebuilts need to be treated differently than other prebuilts. They are used like a normal Java prebuilts when compiling java files, but they are also used as aapt includes when compiling apps, and they provide prebuilt aidl files when compiling aidl sources. Create a new module type so dependers can determine what kind of dependency they are. Change-Id: If426da63cfadcb4b14abda58c7b346554912a07a
* Add logtags source file supportColin Cross2015-04-131-0/+1
| | | | | | | | | Add support for converting logtags files to source files. Each .logtags file is converted to a .java file, but only after all .logtags files have been combined into a merged text file by the logtagsSingleton. Change-Id: I375d82874029bd26a7c528e46add2a638ba123f9
* Move config into common and provide helperColin Cross2015-04-081-3/+2
| | | | | | | | | Using ctx.Config().(Config) everywhere is a mouthful, and it is inefficient to do the type assertion. Put the Config interface into the context, and provide an AConfig() to return the Config already converted to the right type. Change-Id: I301a1fd7d2a005580aabca7866a37c5d42ad8c69
* Support java libraries, binaries, and prebuiltsColin Cross2015-04-032-0/+228
| | | | | | | | Add support for compiling java libraries (.jar files with or without .dex), java binaries (.jar files with a wrapper script to run them), and java prebuilts (for the SDK .jars) Change-Id: Id624da64c92cf20c6d9577c6bb06e5b212af0d1b
* Support excludes in globsColin Cross2015-04-031-1/+22
| | | | | | | | | Java resource support requires globbing directories while ignoring specific filenames. Add support for multiple -e options to soong_glob to specify filenames to exclude, and split out Glob into GlobRule to insert a rule to generate a glob file list. Change-Id: Ia911dd68bd1638452881d18378572d015fd4e31a
* Support cc_test_hostColin Cross2015-03-271-0/+1
| | | | | | Support cc_test_host for gtest tests compiled for the host. Change-Id: I632d2c211075ba9391d934609f1bf368459397e1
* Add support for building NDK modules.Dan Albert2015-03-261-0/+3
| | | | Change-Id: I2c5ede530e40a635e26ae45950580ef450e7dcc6
* Support dependencies on environment variablesColin Cross2015-03-262-0/+56
| | | | | | | | | | | | | | | | | | | Ninja can't depend on environment variables, so modifying build behavior based on environment variables requires coordinating between the soong script that invokes ninja and the soong_build manifest generator. Allow any module to call Config.Getenv to get the contents of an environment variable while registering a dependency on it. After all modules have been processed write out the state of all used environment variables to a JSON file called .soong.environment. During the next build the soong script will use the soong_env tool to compare the contents of .soong.environment to the current environment, and force a build manifest regeneration by deleting the .soong.environment file if any variables have changed. Change-Id: Id0d81933a857bc2fc1cd7a393a3c6cec73dc4824
* Add art_cc_library module typeColin Cross2015-03-251-0/+4
| | | | Change-Id: I7aba376b755f3ce431f7b2f555a85a0ef5323453
* Export cc types for art to inherit fromColin Cross2015-03-251-11/+11
| | | | | | | | | | | | Art needs a custom module type in order to perform complicated build logic like depending on environment variables and varying cflags based on cpu variant. Export enough of the types and functions from cc for art_cc_library to inherit from cc_library. While I'm touching every line, also rename the New* methods to *Factory. Change-Id: I7123aa47019c4ced7a1ab57c394225bc7844b5ea
* Update import paths for changes to blueprintColin Cross2015-03-231-2/+2
| | | | | | | Blueprint has been modified to include a canonical import path, update soong to match. Change-Id: If29d31afbf3bf2e6364961a66456fa5f8f738455
* Allow cc_test to build a test per source fileColin Cross2015-03-191-0/+1
| | | | | | | | | Some cc_test modules want a test per source file, for example when there is global state that needs to be reset between each test suite, but no way to reset it. Allow them to specify test_per_src: true, which will cause a separate test to be built for each source file. Change-Id: I3dbf1202fb070437cb0109f195dc11a6440061ee