aboutsummaryrefslogtreecommitdiffstats
path: root/bpfix
Commit message (Collapse)AuthorAgeFilesLines
* soong_config: bool_variables shortcutDan Willemsen2020-04-032-0/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using a lot of boolean variables can become very verbose without adding really any new information: variables: ["a", "b", "c"], } soong_config_bool_variable { name: "a", } soong_config_bool_variable { name: "b", } soong_config_bool_variable { name: "c", } Now turns into: bool_variables: ["a", "b", "c"], } Bug: 153161144 Test: built-in tests Change-Id: If5455a38433431c7ecbce1e5b32cfbb47f42602a Merged-In: If5455a38433431c7ecbce1e5b32cfbb47f42602a (cherry picked from commit 2b8b89cfa2f3678ec01c6ef576bd9c88b1e8a248)
* bpfix: remove hidl_interface typesSteven Moreland2020-01-212-0/+47
| | | | | | | | These were needed to create/track dependencies, but since we use src jars now, they are no longer needed. Test: bpfix_test Change-Id: Ife7942f937cf94c66547af92821a4c11bd747e3f
* Move partner androidmk and bpfix files to match their package pathColin Cross2019-11-113-7/+5
| | | | | | | | | | | | Using a gomod-aware editor with build/soong requires that files in build/soong can be mapped to the android/soong package path. Move the partner androidmk and bpfix files such that their path matches the package path when the android/soong package prefix is replaced with the build/soong path prefix. Test: go test ./... Test: m bpfix androidmk partner_bpfix partner_androidmk Change-Id: Ic7f7aad9e5eb9178eef0383f0b37e4fb93ce8314
* bpfix: remove empty HIDL libsSteven Moreland2019-11-062-0/+111
| | | | | | | | | libhidltransport/libhwbinder are empty and disallowed in Android.bp (motivation is ~4kb per empty library per process overhead). Bug: 135686713 Test: bpfix Change-Id: I964215ad35068465217af74c5ef1322b43476428
* Add support to extend commands bpfix and androidmkJustin DeMartino2019-10-254-37/+106
| | | | | | | | | Allows our partners to maintain partner-specific fixes in their repos. Converts most of androidmk into a library similar to bpfix. Makes some methods and types public for use by extended versions. Bug:140727544 Test: Ran unit test cases && ran test conversions with sample Change-Id: I7e1fbf3a6a7a8bd47334f43fe3eb68cbbd3426c1
* Rename product_services to system_extJustin Yun2019-07-091-9/+9
| | | | | | Bug: 134359158 Test: build and check if system_ext.img is created Change-Id: Ice3229baf97a94c24a6eea22e7d4571941d7f843
* Soong: Add mk2bp conversion for prebuilt_firmare.Patrice Arruda2019-06-041-5/+7
| | | | | | | | | | There are a couple of makefiles that have etc with $(TARGET_OUT)/etc/firmware, $(TARGET_OUT_VENDOR)/firmare as the local module path. Added the conversion in androidmk for target. Bug: b/133711895 Test: Unit test cases. Change-Id: I74aca18a7eb8aa4dd692cde680fa4e112edcf6d1
* Merge "androidmk conversion logic for android_app_import"Jaewoong Jung2019-05-232-21/+111
|\
| * androidmk conversion logic for android_app_importJaewoong Jung2019-05-152-21/+111
| | | | | | | | | | | | Test: androidmk_test.go, bpfix_test.go Bug: 128610294 Change-Id: Ide183ba1e696fa0ffb4245e3288ffc47535b39af
* | Soong: Add mk2bp conversion for prebuilt_font.Patrice Arruda2019-05-161-2/+2
|/ | | | | | | | | | | | There are a couple of makefiles that have etc with $(TARGET_OUT)/fonts and $(TARGET_OUT_PRODUCT)/fonts as the local module path. Added the conversion in androidmk for target. bug: b/123403785 Test: Wrote and ran unit test cases, did a test conversion on * platform/external/google-fonts/dancing-script/Android.mk * internal/external/google-fonts/arbutus-fonts/Android.mk Change-Id: Id67e10f80b32b27c5027cd274a7944801dad0880
* Soong: Add mk2bp conversion for prebuilt_usr_share.Patrice Arruda2019-05-101-36/+50
| | | | | | | | | | | | There are a couple of makefiles that have etc with $(TARGET_OUT)/usr/share as the local module path. Added the conversion in androidmk for target and host. Bug: b/132123818 Test: Wrote and ran unit test cases, did a test conversion on external/neven/Android.mk makefile. Change-Id: Iafed89f4cee499f561a1235f8870b1f1329e99bc
* Fix crash in mergeListPropertiesSasha Smundak2019-03-111-0/+8
| | | | | | | | | | | | | | | The value of a property to be merged may be a reference to a variable. When we first create an attribute for a makefile variable (e.g. we create 'android_static_libs' from LOCAL_STATIC_ANDROID_LIBRARIES), we set its type correctly. However, reparse in bpfix erases this information, so by the time 'android_static_libs' attribute is to be merged with 'static_libs', it has no type and merge occurs. It isn't easy to fix properly, so just don't merge in such case, Soong will complain and it will be fixed manually. Fixes: 125519127 Test: unit tests in androidmk_test.go Change-Id: Ic66d7ab686a2fdde987f32e2b204c72d9bf0d026
* Handle LOCAL_MODULE_PATH assignment for android_test modulesSasha Smundak2019-02-222-0/+61
| | | | | | | | | | | | | | | Many Android.mk files for the CTS tests have LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS) statement. This can be dropped during the conversion to blueprint files. Also, ignore the assignments to obsolete LOCAL_CTS_TEST_PACKAGE variable. Fixes: 125405331 Test: Internal tests, selectively run androidmk on Android.mk's in cts/ directory Change-Id: I2ed88acd3c8837f96b84be6eb7c7b9b0b5405f57
* Convert BUILD_PREBUILT with LOCAL_MODULE_CLASS=ETC to prebuilt_etcSasha Smundak2019-01-242-0/+213
| | | | | | | | | | | | The conversion is a two-step process: first, when processing BUILT_PREBUILT, convert LOCAL_SOURCE_PATH to a variable reference+fixed subpath path in the blueprint AST. Then, set various boolean flags depending on variable being referenced. androidmk_test.go has a test for each handled case. Change-Id: Iabd18d5f8645ca7077536863cd6640df5b24d24a Fixes: 122906526 Test: treehugger
* Add BUILD_CTS_* to androidmkDan Willemsen2019-01-152-0/+121
| | | | | | Bug: 122617736 Test: new unit tests Change-Id: Ibce6b4bbe49015a1ca6cf88cd43badc6b5cc078e
* Add java_import_host handling logic.Jaewoong Jung2019-01-072-0/+89
| | | | | | | | | Now java_import with a host flag set to true is converted to java_import_host. Bug: 122372359 Test: bpfix_test.go + manual test with real examples. Change-Id: Ie38fa51a44c83c434927db4b742d6839c64b3d63
* Fix `go vet` issuesDan Willemsen2018-07-221-1/+0
| | | | | Test: go vet ./... Change-Id: Ifb936ccc5e2b5a2c3fcbbbcb54f680e2973ea1b3
* Translate java libraries to java_libraryColin Cross2018-07-112-2/+114
| | | | | | | | | | In androidmk, translate BUILD_JAVA_LIBRARY to java_library plus installable: true, and BUILD_STATIC_JAVA_LIBRARY to java_library. In bpfix, rewrite java_library_static to java_library. Bug: 110885583 Test: androidmk_test.go, bpfix_test.go Change-Id: I63c2f759ae9c62a43f3439526552d2cd8e8cedc3
* Add support for android_test modulesColin Cross2018-05-241-5/+96
| | | | | | | | | android_test module are APKs that can be run as tests, either as standalone unit tests or as instrumentation tests for another APK. Test: m checkbuild Change-Id: I16661701637e4048fd99442029c3e195ebf373a4
* Reduce boilerplate around bpfix passesColin Cross2018-05-242-84/+73
| | | | | | | | Make it easier to add bpfix passes by putting them in a single list. Test: bpfix_test.go Change-Id: I194aeeb88457800545d58aceb5d1616c6752274a
* Remove the unused `tags` propertyDan Willemsen2018-05-151-0/+75
| | | | | | | | And fix up androidmk / bpfix to provide warnings about what to do instead. Test: m blueprint_tools (runs the tests, ensures there aren't any tags left) Change-Id: I1a3ad8600211050420041740207d6957f44463c8
* bpfix: Convert local_include_dirs removal to PatchListDan Willemsen2018-05-142-22/+185
| | | | | | | | | This way we can remove the line the property was on, not just the property itself. Test: `m blueprint_tools` to run the unit tests Test: diff bpfix results on all of AOSP before/after this change Change-Id: I61fdd945e6ee711c620b79683dfee7b7c751b3c4
* bpfix: Add reorderCommonPropertiesDan Willemsen2018-05-142-42/+212
| | | | | | | | | | | | | | | | | | | This will move the common properties: name defaults device_supported host_supported To be listed first (and in that order) for every module. Other properties are untouched. This also adds a helper to test individual passes in an end-to-end manner, and a helper to run passes that use PatchLists. Test: `m blueprint_tools` to add the new tests Test: Diff bpfix results over all of aosp before/after this change Change-Id: I746a00a3731cb7597d2613ef2dc45a99654cd122
* Merge changes I52f88bfd,I4263b7d5android-build-prod (mdb)2018-05-081-1/+1
|\ | | | | | | | | | | * changes: Fix usage of bytes.NewBuffer in bpfix Add a dependency fixer for proto deps
| * Fix usage of bytes.NewBuffer in bpfixDan Willemsen2018-05-071-1/+1
| | | | | | | | | | | | | | | | | | According to the documentation: "NewBuffer creates and initializes a new Buffer using buf as its initial contents. The new Buffer takes ownership of buf, and the caller should not use buf after this call." Test: Run bpfix twice, only wrote the first time. Change-Id: I52f88bfd9247240436b46f396c9196157774615b
* | bpfix: Remove local_include_dirs if we remove the last entryDan Willemsen2018-05-072-9/+21
| | | | | | | | | | | | | | | | | | This still leaves a blank line in it's place, but that's a more general problem. Test: m blueprint_tools Test: Run bpfix over AOSP, diff. Change-Id: I55c1d1c183cfa49beeca07abd539348bc2524c5a
* | Fix androidmk converting cc librariesDan Willemsen2018-05-051-0/+5
|/ | | | | | | | The java library rewrites should only happen for java modules, not cc modules. Test: Ran androidmk on a number of Android.mk files Change-Id: Ife2cfb5a69d7db37216671f08317033b99fcd3a1
* Add more androidmk translations for android librariesColin Cross2018-04-161-3/+49
| | | | | | | | | | | | | | | Add support for translating LOCAL_MANIFEST_FILE, LOCAL_RESOURCE_DIR LOCAL_SHARED_ANDROID_LIBRARIES, and LOCAL_STATIC_ANDROID_LIBRARIES. Use the presence of non-empty LOCAL_RESOURCE_DIR, LOCAL_SHARED_ANDROID_LIBRARIES or LOCAL_STATIC_ANDROID_LIBRARIES to convert a java_library_static into an android_library module, and then squash LOCAL_SHARED_ANDROID_LIBRARIES into LOCAL_SHARED_LIBRARIES and LOCAL_STATIC_ANDROID_LIBRARIES into LOCAL_STATIC_LIBRARIES. Test: androidmk_test.go Change-Id: I3ad2a3561f69ebd097eca97cb170754d64e06123
* Merge matching properties in bpfixColin Cross2018-04-162-0/+261
| | | | | | | | | androidmk will start to generate multiple static_libs: properties in a single module, add a pass in bpfix to fix them up into a single property. Test: bpfix_test.go Change-Id: I30955b6efbb767c02ba77f2f18d44951ef094bad
* Make bpfix not modify the input treeColin Cross2018-04-163-23/+66
| | | | | | | | Make a new object called Fixer to hold the state of the tree, and make a copy of the input tree so the original doesn't get modified. Test: bpfix_test.go Change-Id: I1dc6fd99158c8b0e1db029df99e6cf72699a5e63
* Fix format string issuesColin Cross2018-03-281-1/+1
| | | | | | | Fix issues caught by go vet. Test: m checkbuild Change-Id: Ib8d740457c15432dabe1575a6707726ddaf93084
* Remove unused propertyJeff Gaston2018-02-281-0/+13
| | | | | | | | Bug: 72552085 Test: androidmk prebuilts/sdk/current/support/Android.mk \ | grep LOCAL_UNINSTALLABLE_MODULE && echo failed Change-Id: Idcdd571812594599267985dfef2cc2fc6efbb5ba
* Fix java_import and android_library_import conversionsColin Cross2018-02-221-1/+50
| | | | | | | | | | | | | | java_import and android_library_import modules can't be handled directly in androidmk because the results may depend on properties that haven't been parsed yet. Add a bpfix pass (which is automatically included at the end of androidmk) to select android_library_import vs. java_import based on the extension of the prebuilt file, and convert the srcs property to jars or aars as appropriate. Bug: 73724997 Test: androidmk_test.go Change-Id: I1024742e9e96d5e1e88c3cc139eeb0d5a2f6849b
* Don't pretend *parser.List is immutableColin Cross2018-02-223-30/+30
| | | | | | | | | | | | The functions in bpfix that take a *parser.List and return a modified *parser.List are always returning the same pointer and mutating the target of the pointer. Remove the extra unnecessary return value. Also extract the getLiteralListProperty function. Test: androidmk_test.go Change-Id: I08d8aff955c72b7916741cda8083974a49af4d6f
* Have bpfix not remove empty listsJeff Gaston2017-10-051-37/+1
| | | | | | | | Since in some cases they're not the default value. Test: echo "cc_defaults{ system_shared_libs:[] }" | bpfix | grep system_shared_libs > /dev/null && echo ok Bug: 66979076 Change-Id: I760b34f980281b955972819676bd62154a6c73f5
* Revert "Revert "Initial implementation of bpfix""Jeff Gaston2017-06-194-0/+530
| | | | | | | | | Bug: 38351765 Test: bpfix Android.bp This reverts commit a8cc9c53fa5eb7004bc07c5c0ca8613761afd49b. Change-Id: I60f02a8dd920346aa17b9044f834ffe94fa693c6
* Revert "Initial implementation of bpfix"Jeff Gaston2017-05-264-530/+0
| | | | | | | | This reverts commit de4b0463f220c069af1aa10d594b39ceafdfa78b. Reason for revert: postsubmit build broken Change-Id: If68a4af22e517b7be0876343a81c1319fa4d7046
* Initial implementation of bpfixJeff Gaston2017-05-244-0/+530
Bug: 38351765 Test: bpfix Android.bp Change-Id: Ia94602f93bc40db3d006174c39102ac5fd29a64c