aboutsummaryrefslogtreecommitdiffstats
path: root/genrule
Commit message (Collapse)AuthorAgeFilesLines
* Refactor factoriesColin Cross2017-06-302-10/+12
| | | | | | | | | Change module factories from returning a blueprint.Module and a list of property structs to returning an android.Module, which holds the list of property structs. Test: build.ninja identical except for Factory: comment lines Change-Id: Ica1d823f009db812c518f271a386fbff39c9766f
* Make absolute OUT_DIR work with sboxJeff Gaston2017-06-121-11/+8
| | | | | | | | Test: make OUT_DIR=/tmp/abspath Test: make OUT_DIR=relative-out Bug: 35562758 Change-Id: I688d5f6117b194440c5d01c1040033b5671187c2
* Have Soong try to enforce that genrules declare all their outputs.Jeff Gaston2017-06-091-8/+38
| | | | | | | | | | | This causes Soong to put the outputs of each genrule into a temporary location and copy the declared outputs back to the output directory. This gets the process closer to having an actual sandbox. Bug: 35562758 Test: make Change-Id: I8048fbf1a3899a86fb99d71b60669b6633b07b3e
* Prettify soong ninja build descriptionsColin Cross2017-05-101-4/+10
| | | | | | | | | | | | | | | | | Descriptions currently look like: [ 0% 4/29328] cc out-soong/.intermediates/external/clang/lib/Sema/libclangSema/android_arm_armv7-a-neon_denver_static_core/obj/external/clang/lib/Sema/SemaCodeComplete.o This is not very helpful - most of the characters are used to show the output path, which contains useful information like target architecture, but also contains most of the path to the source files twice, and less useful information like the exact variant name used by soong. Make the descriptions look like: [ 0% 3/29329] //external/clang/lib/Sema:libclangSema clang++ SemaTemplateInstantiate.cpp This is //path/to/module:modulename tool relative/path/to/source/file Test: builds, looks pretty Change-Id: I3087aa7d4eb1860ef6239d77407b8b35445616d7
* Fix genrule documentationDan Willemsen2017-05-091-1/+1
| | | | Change-Id: Ieffb2bd7d739527db129ff300d8aec70d82c278a
* Exit early on genrule command parsing failureColin Cross2017-04-191-0/+1
| | | | | | | | cmd may be empty if android.Expand fails, and continuing results in a panic. Return immediately. Test: m -j checkbuild Change-Id: Ibf4d57ce048db9f7f16ce118ed9e9ecea5a6551c
* Use a minimal set of mutators, module types, and singletons for testsColin Cross2017-03-161-2/+2
| | | | | | | | | | | | Calling android.NewContext() in tests results in a context that contains all the mutators, module types, and singletons, which causes unexpected interactions in unit tests. Create an empty context instead, and add in only the necessary mutators, module types, and singletons. Bug: 36366816 Test: soong tests Change-Id: Ic61262c37e3436b3ad4ccaca18b737021c304be6
* Merge "Support data properties for test binaries"Colin Cross2017-02-061-1/+7
|\
| * Support data properties for test binariesColin Cross2017-02-021-1/+7
| | | | | | | | | | | | | | | | | | | | | | Allow tests to specify a data property that lists files or filegroup modules that will be packaged alongside the test. Also add a path property to filegroup modules to allow shifting the path of the packaged files, and add ExpandSourcesSubDir to expand the filegroup sources while including a shifted relative path in the Paths objects. Test: soong tests, manually adding data to a module Change-Id: I52a48942660e12755d313ef13279313361b4fc35
* | Allow non-tool dependencies in genrulesColin Cross2017-02-041-2/+0
|/ | | | | | | | | | | The genrule tool dependency handling was rejecting any dependencies that were not tools. This caused a failure when ExtractSourceDeps added a source file dependency on a filegroup module. Remove the unnecessary check in the tool handling. Test: builds Bug: 35002681 Change-Id: Ibd8dff306be3ef55aac2e12a28ddc187be2234d9
* Allow genrules to reference generated sourcesColin Cross2017-01-131-12/+10
| | | | | | | | Call ExtractSourceDeps on genrule srcs properties. Bug: 34283327 Test: no change to build.ninja Change-Id: I934a418f32d4c94400728579543ca5c910bf7dfc
* Support filegroupsColin Cross2016-12-172-0/+65
| | | | | | | | | | filegroup is a module that contains a list of files, and can be used to export files across package boundaries. filegroups (and genrules) can be referenced from srcs properties of other modules using the syntax ":module". Test: m -j Change-Id: I3d6fc4819c0b4225b474e0ad42f0d947f55a5961
* genrule: let Android.bp file specify exported header dirsColin Cross2016-11-221-6/+16
| | | | | | | | Instead of exporting the generated sources dir as headers, let the Android.bp file specify subdirectories as exported. Test: m -j checkbuild Change-Id: I18dd900d63ce7485c8fbfcc39dc77abad6f733d7
* genrule: support deps filesColin Cross2016-11-221-4/+24
| | | | | | | | If a genrule sets deps_file: true, use a file in the gen directory as a GCC-style deps file. Test: m -j libLLVMObject Change-Id: Id410165847e4eaea1853a392512e38787c431523
* Support genrules with multiple toolsColin Cross2016-11-071-54/+74
| | | | | | | | | | | | | | | To allow genrules with more than one tool, rename the tool property to tools and make it an array, replace $tool with $(location <label>), and use $() for other variables for consistency. Also remove the host bin directory from the genrule path, and the $srcDir variable, using either of them would have caused dependency issues. Bug: 31948427 Test: compare build.ninja Change-Id: Icf6d3bce2bea00fec1363fd65c0bdf96d09281bf (cherry picked from commit de6bd86d240b98b7ea7ff6a0454a13edc639a163)
* Add subdir to GenPathDan Willemsen2016-11-021-1/+1
| | | | | | | | | We were emulating this for proto files, standardize it and make the other generators use it as well. Test: Compare out/soong/build.ninja before/after change Test: mmma -j system/tools/hidl Change-Id: I1888c7b981749060a398387bbb9b481270bf6d75
* Control mutator orderColin Cross2016-10-121-3/+1
| | | | | | | | Register mutators inside lambdas that are called in a defined order to correctly order mutators before and after the arch and deps mutators. Test: build.ninja identical Change-Id: Iefe2a3515aee8570e76a6e76925db4cda0e9e822
* Move registration into android packageandroid-n-mr1-preview-2android-n-mr1-preview-1Colin Cross2016-10-121-3/+2
| | | | | | | | 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
* Support multiple outputs for genruleDan Willemsen2016-09-281-7/+13
| | | | | | | | | | | The underlying code to expose outputs to other modules has suppported this already for gensrcs (which runs the command multiple times to create multiple outputs). This allows a genrule to run a command once, and output multiple files. Bug: 31742855 Test: Add multi-output genrule; Inspect build.ninja Change-Id: I72054cc39c0d0e3e44feebba72005e5af1a1709a
* Parse genrule's cmd propertyDan Willemsen2016-09-281-3/+26
| | | | | | | | | | | Instead of just passing this to ninja, use os.Expand to parse the variable substitutions. While we're here, define a new "genDir" variable that is the root of this module's generated directory. Bug: 31742855 Test: Ensure invalid variables cause error Test: Inspect commands in build.ninja Change-Id: Iff6d0499ab57367669e73df52ab7c647358da13b
* Make BottomUpMutators parallelColin Cross2016-08-111-1/+1
| | | | | | | | Append .Parallel() to all of the RegisterBottomUpMutator calls to tell Blueprint it can run them in parallel. Test: identical build.ninja, passes race detector Change-Id: I969a0689522d4cba7c8ff51e2aa00fe2fd338a89
* Simplify arch target handlingColin Cross2016-06-021-2/+1
| | | | | | | | | | | | Soong's multi-architecture building has grown complex, with the combination of HostOrDevice+HostType+Arch necessary to determine how to build a variant of a module, and three separate mutators to split each into its variations. Combine HostOrDevice+HostType into Os, which will be Linux, Darwin, Windows, or Android. Store Os+Arch as a single Target. Change-Id: I92f2e2dac53617d595a35cc285d2bd348baa0fbd
* Revert "Simplify arch target handling"Colin Cross2016-06-031-1/+2
| | | | | | This reverts commit 6713fb26cbcadf525cd75e47d7d0cbc23d282b3e. Change-Id: Ic473cea2563b0b37dc08b0bc5d3a0ac8c4b6afe6
* Simplify arch target handlingColin Cross2016-06-021-2/+1
| | | | | | | | | | | | Soong's multi-architecture building has grown complex, with the combination of HostOrDevice+HostType+Arch necessary to determine how to build a variant of a module, and three separate mutators to split each into its variations. Combine HostOrDevice+HostType into Os, which will be Linux, Darwin, Windows, or Android. Store Os+Arch as a single Target. Change-Id: Iae677eff61a851b65a7192a47f2dc17c1abb4160
* Rename common to androidColin Cross2016-05-181-29/+29
| | | | | | | | | | | | | | | | 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
* Add genrule tool_file to better handle depsDan Willemsen2016-04-211-16/+36
| | | | | | | | This will allow modules to specify a local script file that will be expanded to the proper path in $tool, and will automatically be added to the dependencies. Change-Id: Icea4046b1fe2fd7c543aa33913d1a53201b15353
* Fix generated sources and headersDan Willemsen2016-04-201-0/+9
| | | | | | | | | | | | | | | | | Add two cc properties: `generated_sources` and `generated_headers`, instead of just adding genrule modules to `deps`. Label these with the dep tagging mechanism, add the generated_headers paths to the include paths, and add dependencies to generated headers for each compile. Add dependencies so that regular sources can include generated yacc headers, not just other generated lex/yacc files. Static/shared specific sources still don't have dependencies to or from regular sources though. Switch from an implicit dependency on generated files to an orderonly dependency, since the depfile will take care of the necessary implicit dependencies for incremental builds. Change-Id: I436675acb1f57329d98b81c56dcb4384201a68ea
* Use blueprint DependencyTagsColin Cross2016-04-121-1/+1
| | | | | | | | Blueprint now requres DependencyTags to be passed to AddDependency calls. Use the tags to avoid setting member variables on modules, which will be lost after the mutators have been called. Change-Id: I8c1d9ed1db85a300e14394b911a516d361ba9f75
* Fix gofmtColin Cross2015-12-171-3/+3
| | | | Change-Id: Ib5e4db599a6dd858b3a1b1cdb75017b01eac4911
* Use `Path` instead of string for file pathsDan Willemsen2015-12-091-23/+20
| | | | | | | | | | | | This centralizes verification and common operations, like converting the path to a source file to the path for a built object. It also embeds the configuration knowledge into the path, so that we can remove "${SrcDir}/path" from the ninja file. When SrcDir is '.', that leads to paths like './path' instead of just 'path' like make is doing, causing differences in compiled binaries. Change-Id: Ib4e8910a6e867ce1b7b420d927c04f1142a7589e
* Support cross-compiling Windows binaries on LinuxDan Willemsen2015-11-301-2/+4
| | | | | | | | This defines another mutator between HostOrDevice and Arch that will expand host modules into a module for each host type (Darwin/Linux/Windows) that is currently being built. Change-Id: I4c8ac6b616c229f6bd45ad8a35902652fb6a4fff
* Remove EarlyMutators and DynamicDependenciesColin Cross2015-11-031-5/+8
| | | | | | | | | | EarlyMutators are identical to BottomUpMutators, except they run before DynamicDependencies. DynamicDependencies can be replaced with a BottomUpMutator. Replace both EarlyMutators and DynamicDependencies with BottomUpMutators, which allows setting the order between all mutators through registration order. Change-Id: Id1305d798d3d2da592061c89d7c10a71780b71a3
* use init functions to register module types, etc.Colin Cross2015-07-091-0/+6
| | | | | | | | 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 exclude_* and remove arch_subtract / "-file"Dan Willemsen2015-07-011-2/+2
| | | | | | | | To align with the current make build system, add exclude_srcs and exclude_java_resource_dirs. These replace the functionality of arch_subtract and glob exclusions that use "-file" to exclude a file. Change-Id: I91c23d5e3c9409f2d9f7921f950153a03a68ad61
* Improve property comments for docsColin Cross2015-06-291-16/+18
| | | | | | | | | | | | | | | | Improve the comments associated with properties to work better with Blueprint's auto-documenting feature. Make all properties structs into named types so that thet types can be found using reflection and cross-referenced to the source code to auto-extract docs. Remove the leading <property>: text from properties, the documentation will include the lowercased name of the property. Add filter tags to the nested arch properties. Change-Id: I4ef5db86358886fe61456c24eb2dbe6f7b876115
* Allow common.Glob to be called by singletonsColin Cross2015-06-171-2/+2
| | | | | | | | | Make common.Glob take an interface that is the intersection of blueprint.ModuleContext and blueprint.SingletonContext used by Glob and GlobRule, allowing it to be called on either. Also move ExpandSources and Glob into AndroidModuleContext. Change-Id: I8d1a3160c5dd201033afdb37210e82d8065b137d
* Use far dependency for genrule toolColin Cross2015-05-121-1/+2
| | | | | | | | A far dependency will not inherit any of the variations from the current module, allowing a device genrule to depend on a host tool to generate the sources. Change-Id: I7f622ddd31a81d605f55d5946a109ea53e864084
* Add support for genruleColin Cross2015-04-291-35/+120
| | | | | | | | | 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
* Support subtracting sources from globsColin Cross2015-04-081-3/+1
| | | | | | | | Support -file or -path/glob in file lists that contain globs to subtract files from the resulting glob. Also move source file prefixing and handling into a common function. Change-Id: Ib6d74ce22f53cae7348c4ba35b779976d90359a6
* Move config into common and provide helperColin Cross2015-04-081-5/+1
| | | | | | | | | 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
* Export cc types for art to inherit fromColin Cross2015-03-251-1/+1
| | | | | | | | | | | | 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
* Add gensrcs module typeColin Cross2015-03-191-0/+97
gensrcs allows sources to be generated by a specified command. Change-Id: I725086fcdcd72bfe6c07fb8903e7b520678a247f