aboutsummaryrefslogtreecommitdiff
path: root/sh/sh_binary.go
Commit message (Collapse)AuthorAgeFilesLines
* Convert SetProvider to generic providers APIColin Cross2023-12-141-2/+2
| | | | | | | | | Convert all of the callers of SetProvider to use the type-safe android.SetProvider API. Bug: 316410648 Test: builds Change-Id: If58f4b5355264ddab2045bc3591a4eac19cd58fc
* Remove ConvertWithBp2build implementationsColin Cross2023-12-081-121/+5
| | | | | | | | | Remove the ConvertWithBp2build implementations from all the module types, along with the related code. Bug: 315353489 Test: m blueprint_tests Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
* Add source file provider for genrule/srcs, python libraries and rust libraries.Aditya Choudhary2023-12-051-0/+1
| | | | Change-Id: I2d7d4684a10c15aeecc27b8db800ab27a807d2e2
* Move test data installation to SoongColin Cross2023-11-301-30/+17
| | | | | | | | | | | | | | | | | To generate module-info.json in Soong for b/309006256 Soong needs to know the test data paths. Moving test data installation into Soong will also help later for test suite packaging. Add ModuleContext.InstallTestData that installs the files listed in a []DataPath alongside the test. The files will also be passed to Make to allow it to continue packaging them into the test suites for now. Update the module types that are producing LOCAL_TEST_DATA entries in their Android.mk files to go through InstallTestData instead. Bug: 311428265 Test: atest --host toybox-gtests --test-timeout=120000 Change-Id: Ia8b964f86e584ea464667fd86a48d754d118bead
* Add proto for Test ownership metadata.Aditya Choudhary2023-11-151-0/+2
| | | | | | | | | | This Cl adds a new rule to Soong to generate test spec metadata. Also, this CL adds a provider in various test module to provide test spec related data to the Soong rule. Will add providers and test code to other Module in the future changes. Provider added for the following test modules in this change: android_robolectric_test, android_test, bootclasspath_fragment_test, java_test, java_test_host, python_test, python_test_host, sh_test,and sh_test_host. Bug: 296873595 Change-Id: I5f89f72d5874bb7838ae357efdb8c6ca208e18a7
* Update sh_test conversion to handle data_bins and test_configs properlyJason Wu2023-10-101-16/+30
| | | | | | | | sh_test.data_bins are used to mark special executable dependencies which should be installed alongside the test entry point's cwd as siblings. This change makes it such that the Tradefed rule places them at the expected location. In addition, this change also incorporates the `tradefed.TestConfigAttributes` to handle the test_configs conversions. Test: bp2build.sh Bug: 283486885 Change-Id: Ifeb049c13ae208c785dbdc858f589be8f21109d1
* Have ConvertWBp2build use Bp2buildMutatorContextChris Parsons2023-09-201-2/+2
| | | | | | | | | | | | | This no-op refactoring facilitates some upcoming functional changes for "bp2build allowlist v2". The work requires that the bp2build conversion mutator be changed from a TopDown mutator to a BottomUp mutator. Refactoring all bp2build-related methods so that they use Bp2buildMutatorContext makes it easier to make this functional change without touching tens of files and multiple projects. Bug: 285631638 Test: m bp2build Change-Id: I3d1ef3064146e959c6f0dc315350fc9764bf2bd2
* sh_binary: Implement OutputFileProducer for sh_testEdward Liaw2023-09-131-0/+9
| | | | | | | | | | | When added as a data dependency, the output of sh_test does not get included. It needs to define OutputFiles in order to implement the OutputFileProducer interface. Bug: 293944582 Test: N/A Change-Id: Ic27741ed584523f5e1efd7caa8b872fe50cce381 Signed-off-by: Edward Liaw <edliaw@google.com>
* Support java_data in sh_test_hostMakoto Onuki2023-08-241-1/+18
| | | | | | | | | Bug: 297225342 Test: with a custom test rule Test: cd sh && go test ./... (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:de5d265a798ce0e12ad0a2d0a6675942df5cd10b) Merged-In: Ia5a60fa6d917f2c2fde56df543625024ec11877a Change-Id: Ia5a60fa6d917f2c2fde56df543625024ec11877a
* bp2build converter for sh_test followupJason Wu2023-08-221-2/+46
| | | | | | Test: m nothing Bug: 283486885 Change-Id: Ib8229e75dfcd9fd251fb1a83485cf5f88bdc3afb
* Prevent sh_test from migrating as sh_binaryLiz Kammer2023-04-281-6/+8
| | | | | Test: CI Change-Id: I4cb789e3f1351fcb1635d58b72c265eac4bf62d8
* Allow adding extra tradefed options in the Android.bp fileCole Faust2023-01-031-2/+10
| | | | | | | | | | | | Some tests need to add custom tradefed options, but still want to keep most of the soong autogenerated tradefed xml file. Expose a test_options: { tradefed_options: [...] } property that will allow tests to add more options to the autogenerated xml file. Fixes: 184895128 Test: go test, and verified that the ninja files did not change for aosp_arm64 Change-Id: I50d4ad139322e9e207202f1e1a50f5bbb424aa6f
* Revert "Allow adding extra tradefed options in the Android.bp file"Tahsin Loqman2022-12-191-10/+2
| | | | | | | | This reverts commit 8ec823cba166a41eb0e9e5ff8fe679e691fec678. Reason for revert: DroidMonitor: Potential culprit for Bug b/262965953 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. Change-Id: I236cc36981d8b30527ca286632727f8ca267e969
* Allow adding extra tradefed options in the Android.bp fileCole Faust2022-12-091-2/+10
| | | | | | | | | | | | Some tests need to add custom tradefed options, but still want to keep most of the soong autogenerated tradefed xml file. Expose a test_options: { tradefed_options: [...] } property that will allow tests to add more options to the autogenerated xml file. Fixes: 184895128 Test: go test, and verified that the ninja files did not change for aosp_arm64 Change-Id: I75f7eb002c8325ce7cdc76e12e76e16195320620
* Move common test_options properties into the android packageZhenhuang Wang2022-08-171-10/+3
| | | | | | | | | | Multiple modules (e.g. java, cc, python, rust) define the `test_options` field. Extract the common properties in test_options to share across different test rules. Bug: 240928948 Test: `refreshmod` and diff with original module-info.json Change-Id: I404a7a157b4ccaa53d800ee2217559ff695bd825
* Clean up some bp2build technical debtLiz Kammer2022-05-131-1/+1
| | | | | | | | | Previously we ran mutators in bp2build mode to add dependencies, now we look up modules by name directly. Remove workarounds to allow bp2build mode to not fail when adding/handling dependencies. Test: m bp2build Change-Id: Ibf6fd905150cac306e5c395902ef28f609f4df2a
* sh_test: Support per-testcase directoriesJooyung Han2022-02-221-0/+4
| | | | | | | | Similar to cfb0f5e102e2a4a946c4f6e38d429b132ed11fc5 Bug: n/a Test: add a new CTS sh_test_host module with duplicate 'data'; Change-Id: Ie7d183bb5703d616d61d7dcb7c8b44502de429bb
* Propagate data_bins from Soong to Makeyangbill2022-02-171-0/+3
| | | | | | | | | | | | Write the list of a test module's data_bins value to the `LOCAL_TEST_DATA_BINS` Makefile variable defined for each module. This enables downstream tools to correctly set up the runtime environment for execution. And currently only sh_test, cc_tests, and rust_tests has this attribute in Android.bp. Bug: 215234071 Test: m out/soong/Android-aosp_cf_x86_64_phone.mk Change-Id: I8d47f5f9b25afdc5975c6b414405badb38dbde4b
* Support installable propertySundong Ahn2022-01-121-0/+4
| | | | | | | | Support not installing sh_binary when installable property is false Bug: 205065320 Test: m -j Change-Id: I71a0fd24e8867d6cb2527ecdacc775253f12c9f8
* sh_binary: Use pointers for optional attributesLiz Kammer2021-12-211-6/+6
| | | | | | | | Empty strings for filename and sub_dir were unnecessicarily always being propagated to BUILD files. Test: build/bazel/ci/bp2build.sh Change-Id: I39d6af12b1decd1d3813b92daa862ebc025daa7d
* Remove InstallBypassMake and ToMakePathColin Cross2021-12-151-5/+1
| | | | | | | | InstallBypassMake and ToMakePath are obsolete, remove them. Bug: 204136549 Test: m checkbuild Change-Id: Ie5a6f7254b3d317ed6039e114ed6aec35e1ce273
* Use one mutator for all bp2build conversion.Liz Kammer2021-12-141-8/+1
| | | | | | | | | | | | Each conversion required defining a separate mutator, which will each operate on _all_ modules and requires each to repeat checks whether the mutator should operator. Instead, we introduce a single mutator and modules can define a ConvertWithBp2build to implement bp2build conversion for that module. Test: bp2build.sh Bug: 183079158 Change-Id: I99d4b51f441c2903879092c5b56313d606d4338d
* Support filename and sub_dir attributes in sh_binaryYu Liu2021-12-021-3/+18
| | | | | Test: test by building system/timezone/apex:com.android.tzdata Change-Id: I08114910fccbdacf6750e237d3e80ba37fde7651
* Use new soong_cc_rust_prebuilt.mkIvan Lozano2021-11-121-2/+2
| | | | | | | | soong_{cc,rust}_prebuilt.mk has been merged. Use the new file. Bug: N/A, clean-up Test: m Change-Id: I3f03e866815f6394aacd8cb0deba04f381b78c29
* Add symlinks to Soong-installed sh_binaryColin Cross2021-11-091-0/+3
| | | | | | | | | I3f9928c6d6993c381859b80c335b800b1a9769ee moved sh_binary installation to Soong, but the Soong install rules didn't include the symlinks. Bug: 204136549 Test: m checkbuild Change-Id: I8dd663c7d6a3259b397a11787e0869f32d0530cd
* Move sh_binary module installation into SoongColin Cross2021-11-081-0/+4
| | | | | | | | | | | Move sh_binary module installation rules into Soong by overriding InstallBypassMake. Bug: 204136549 Bug: 205530905 Test: m checkbuild Test: m && acloud create --local-instance --local-image Change-Id: I3f9928c6d6993c381859b80c335b800b1a9769ee
* Bp2Build common properties auto-handlingAlex Márquez Pérez Muñíz Díaz Púras Thaureaux2021-10-041-1/+1
| | | | | | | | | | | | | | | | | Introduce `commonAttributes` & `fillCommonBp2BuildModuleAttrs used in CreateBazelTargetModule Adapt `bp2BuildInfo` to use `commonAttrs` instead of `Name`. And thus also all downstream users of `CreateBazelTargetModule`. As initial user, the Soong `required` property will be translated to Bazel's `data`. Bug: 198146582, 196091467 Test: build_converstion_test.go:TestCommonBp2BuildModuleAttrs Test: go test Test: mixed_{libc,droid}.sh Change-Id: Ib500e40f7e2cb48c459f1ebe3188962fc41ec124
* Merge "Add module based host-tools snapshot"Rob Seymour2021-09-141-0/+6
|\
| * Add module based host-tools snapshotRob Seymour2021-09-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new module: host_snapshot { name: "host-snapshot" deps: [ (list of host tools) ], ... } Package host tools using android.PackagingBase to capture host tools and transitive packaging data. Add JSON meta data to snapshot that allows snapshot to be installed via development/vendor_snapshot/update.py Add support to generate a fake host snapshot of all host modules that is used to detect required modules via development/vendor_snapshot/update.py. Bug: 192556798 Bug: 194799048 Bug: 192896149 Test: m HOST_FAKE_SNAPSHOT_ENABLE=true host-fake-snapshot dist -- check snapshot exists in dist Change-Id: I849c4db801cd858408f6fe6a3ce69262a23a5be9
* | Don't create a new module for bp2build conversion.Liz Kammer2021-08-171-19/+1
|/ | | | | | | | | | | | | | | | | | | | | | A performance improvement for bp2build as Blueprint/Soong no longer have the overhead of additional modules. The creation of these modules results in: * traversal of additional modules for each subsequent mutator * synchronization over a go channel to collect newly created modules: https://cs.android.com/android/platform/superproject/+/master:build/blueprint/context.go;l=2594,2600;drc=1602226f23181b8c3fbfcaf3358f0297e839d7d3 We avoid both of these by storing the information directly in the underlying module. Also as a fringe benefit, removes some necessary boilerplate for conversion. For benchmarks, reduces runtime ~1% for 1% converted, ~24% for 100% converted. See more: go/benchmarks-for-https:-r.android.com-1792714 Test: ran benchmarks/tests in bp2build Test: build/bazel/ci/bp2build.sh Change-Id: Ie9273b8cbab5bc6edac1728067ce184382feb211
* [WIP] Switch sh_test_host to unit_tests=true by defaultJulien Desprez2021-06-281-0/+4
| | | | | | Test: presubmit Bug: 192278266 Change-Id: Ief6f8fa753f13f0a4944a0a183a12497f138e1e8
* Add unit_test test option in sh_test_hostDan Shi2021-05-241-0/+12
| | | | | | | | | This change allows sh_test_host to be included in host-unit-tests suite when test option `unit_test` is set to true. Bug: 183209767 Test: m host-unit-tests Change-Id: I5b441d5f49468cb681eb414dade8a1309c6e810a
* Add debug ramdisk variant.Inseob Kim2021-04-291-0/+4
| | | | | | | | | | | | A module will be installed to /debug_ramdisk if debug_ramdisk is set to true. This is a reland of f84e9c05e2103149162e4a78a68f20c164fbbba2, with a fix that removes /first_stage_ramdisk. Bug: 184004542 Test: soong test Change-Id: I739de63cfec6b0fec5a90f7c4741fc4d884d209c
* Revert^3 "Add debug ramdisk variant"Inseob Kim2021-04-221-4/+0
| | | | | | 836a8f3d613a51d496740dcefaf5b66a4cb86ba2 Change-Id: If59529238e26a197bc33b10245b88f538f280ed0
* Revert^2 "Add debug ramdisk variant"Florian Mayer2021-04-221-0/+4
| | | | | | 78ea2f5eacd31b66ab148cd76bd87763b7745bf3 Change-Id: I6a6a2ee82e2807045364bab105ec03a1934b411f
* Revert "Add debug ramdisk variant"Bowgo Tsai2021-04-221-4/+0
| | | | | | | | | | | | This reverts commit f84e9c05e2103149162e4a78a68f20c164fbbba2. Because this breaks the usage of boot-debug.img and vendor_boot-debug.img Bug: 185970130 Bug: 185990198 Test: make bootimage_debug Change-Id: I7886c971982faae1d5bc34688643de8d94d6e201
* Add debug ramdisk variantInseob Kim2021-04-151-0/+4
| | | | | | | | | | A module will be installed to debug_ramdisk (or debug_ramdisk/first_stage_ramdisk if recovery as boot is true) if debug_ramdisk is set to true. Bug: 184004542 Test: soong test Change-Id: Ic5a4d27407e506fffa462de2149e0785f11b2ac7
* bp2build: arch-configurable selects for label list attrs.Jingwen Chen2021-03-301-2/+3
| | | | | | | This CL adds the configurable LabelListAttribute support to bp2build. Test: go test Change-Id: I2ef9e385d9cf1b1845988128eca1d8cda1ecb5e8
* bp2build: add allowlist for package-level conversions.Jingwen Chen2021-03-241-1/+1
| | | | | | | | | | | | | | | | | This CL adds the support for specifying lists of directories in build/soong/android/bazel.go, which are then written into out/soong/bp2build/MANIFEST. Using this configuration, modules/directories can either default to bp2build_available: true or false, while still retaining the ability to opt-in or out at the module level. It also ensures that ConvertWithBp2Build returns true iff the module type has a registered bp2build converter. Test: go tests Test: demo.sh full Test: TreeHugger presubmits for bp2build and mixed builds. Change-Id: I0e0f6f4b1b2ec045f2f1c338f7084defc5d23a55
* Support test fixtures in sh packagePaul Duffin2021-03-091-4/+22
| | | | | | | | | | | | | | | | Restructures the sh package test setup code to create FixturePreparer instances for setting up a test fixture and converts some tests to use it. The goal with this change is not to switch all the sh tests over to directly using the new model but instead to ensure that the majority of the sh tests run with the new model, to allow existing tests to easily switch to the new model when needed and to allow dependent packages to be switched to the new model. Bug: 181070625 Test: m nothing Change-Id: Ib2c6ac2842d6fafde5663d3ee63c3f934913a00e
* Merge "Move bazel.Properties to a BazelModuleBase"Treehugger Robot2021-02-241-4/+3
|\
| * Move bazel.Properties to a BazelModuleBaseLiz Kammer2021-02-231-4/+3
| | | | | | | | | | | | | | | | This allows more direct access to the bazel label and whether the module is bp2build available. Test: go test * Change-Id: I23375835d20fa53d7d94127b2dc2d5bb20487bfb
* | Refactor BazelTargetModuleLiz Kammer2021-02-231-2/+4
|/ | | | | | | | | | | This eliminates the need to remove quotes, delete attributes, and re-checking that name has correct prefix. Additionally, this allows assignment directly to the BazelTargetModuleProperties struct, which allows defaulting unused fields and clarity of which field is being set. Test: go test soong tests Test: ran ./build/bazel/scripts/milestone-2/demo.sh Change-Id: Ia9bfcce76234c793a4ddd5f29a661150f83341c9
* Add ctx to AndroidMkExtraEntriesFuncColin Cross2021-02-191-2/+2
| | | | | | | | | Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to access providers. Test: m checkbuild Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
* Add sh_binary support to bp2build converter.Rupert Shuttleworth2021-02-091-0/+64
| | | | | Test: Added a unit test in this CL. Change-Id: I6e9b3c833a257414daf82e603b733e459535d206
* bp2build: convert paths/module refs to Bazel labelLiz Kammer2021-02-041-4/+5
| | | | | | | | | | | This currently expands all globs, still need to support converting glob syntax. Test: go build_conversion_test Test: GENERATE_BAZEL_FILES=true m nothing Test: m nothing Bug: 165114590 Change-Id: If7b26e8e663d17566fad9614ca87a8da1f095284
* Support python binaries in sh_test_hostAnton Hansson2021-01-071-9/+2
| | | | | | | | Make the code for data_bins/data_device_binds module-type agnostic. Bug: 176581143 Test: m gen_sdk_test Change-Id: I40e8d4c06f583cae523d97ce63822960872907db
* Remove unnecessary snake case variables.Jaewoong Jung2020-12-221-3/+3
| | | | | Test: m nothing + TreeHugger Change-Id: I99f7162944daa6c57c6ae4763261e108bb5cb6b1
* Add test suite handling to central androidmk codeLiz Kammer2020-12-011-1/+1
| | | | | | | | | | | MTS is introducing partial MTS test suites that are per-module, with names of the format: mts-${MODULE}. By centralizing the code for test suites, we can automatically add "mts" test suite when an "mts-${MODULE}" test suite is specified, reducing duplication. Test: m mts Bug: 170318013 Change-Id: I8ce9d3c252fcc0a937bb5f2826d21cb6c6932d82
* Fix path conflict for vendor_ramdisk_availableYifan Hong2020-10-261-0/+8
| | | | | | | | | | | | | | | | | ... and ramdisk_available modules. If a module is both vendor_ramdisk_available and ramdisk_available, on a device that mark recovery_as_boot and move_recovery_resources_to_vendor_boot simultaneously (and incorrectly), both will be installed to recovery/root/first_stage_ramdisk. Fix the path conflict of the two variants by moving the vendor_ramdisk variant to vendor-ramdisk/first_stage_ramdisk instead. Also update comments for Vendor_ramdisk_available. Test: m nothing -j Bug: 156098440 Change-Id: I2b776b6fd8f5a2c361c0f6a89231e3cebc2646f0