Commit graph android_packages_modules_Co.../tools
Message SHA1
Remove dependencies on the 1-variant fallback
When adding a dependencies, if the variants don't match, but the
dependency only has 1 variant anyways, soong will always use that
variant. This makes it hard to add new variants to soong, because the
1-variant fallback stops being used and you start getting missing
variant errors. Make changes to bp files such that all dependencies
correctly specify the variant to use.

Bug: 372091092
Flag: EXEMPT refactor
Test: m nothing
Change-Id: I8d4f59044f268088b44357d27322abbdcdc3001c

Cole Faust   commited 2024-10-22 16:31:00 -07:00
9ff8f4c81b
Update aospify_device for T device
After testing on a T device, update aospify_device.sh to be compatible.

Test: Ran the script against the device, verified AOSP modules installed
      and wifi working.
Change-Id: I0a365335017f9827427ea8a9309ae221005003f5

Remi NGUYEN VAN   commited 2024-05-22 13:10:19 +09:00
8b667ba286
Add a script to AOSPify devices
The script allows forcing devices to run AOSP connectivity modules by
swapping modules on common device builds with AOSP ones. This is useful
for local testing of modified AOSP modules on development devices.

Test: Run the script on T and U devices
Change-Id: Id871106e0314cc389006a08cdd510a59924eebc4

Remi NGUYEN VAN   commited 2024-05-09 18:46:45 +09:00
f231f5fb19
Merge "Add tests to confirm that genjarjar keeps excluded Tests." into main
Chidera Olibie   authored and   Gerrit Code Review   commited 2024-03-14 10:20:01 +00:00
878e1a41e9
Add sdk_version to test libraries
If sdk_version is empty, by default the library will be built against
the implementation of the framework jars. There are on going project to
automatically repackaging flag libraries in the libray which is built
direactly against the implementation of the framework jars.

This change set the right sdk_version for the testing library.

Bug: 310504781
Test: atest jarjar-rules-generator-test and CI
Change-Id: I24d8dc47f7ed83f0b84c632d24396e2bdf932424

Zhi Dou   commited 2024-02-19 18:36:40 +00:00
e521ae306a
[DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5

Aditya Choudhary   commited 2024-01-31 12:34:50 +00:00
01b5ede2b2
gn2bp: delete obsolete version in p/m/C
This code has moved to external/cronet/android/tools/gn2bp.

Test: none
Change-Id: I3e95de24f01f01c937a223ae6cf501bc505f9de2

Patrick Rohr   commited 2023-03-29 16:23:45 -07:00
b1726f7019
gn2bp: Turn off allocator_shims for musl only
* I've investigated turning off `allocator_shims` globally for all of Cronet but
this didn't sound like a good option. allocator_shims are used for security measures,
where sometimes malloc caller forget to check for NULL which happens on oom. allocator_shims would
instantly kill the app instead of depending on the caller to do the validity check.
* The solution here was to manually remove the files and add them to `android` and `glibc` only so allocator_shims
is never compiled for musl.
* Chromium does not support musl so there's no flag for `musl` with allocator_shims.

Test: mma
Change-Id: I2a63b14482a526d06a089647e6f61eea9f1691dc

Mohannad Farrag   commited 2023-03-24 11:37:22 +00:00
8c5b578a0d
Add tests to confirm that genjarjar keeps excluded Tests.
This adds tests for aosp/2498795.

Test: atest jarjar-rules-generator-test
Change-Id: I8077f0e74190bb4f6a35cb6c0d866c7453ca0ca0

Chidera Olibie   commited 2023-03-23 12:55:38 +00:00
aa44ef3b2f
gn2bp: Remove soong_namespace
* This was causing the infra to ignore the modules and masking build errors.

Test: TH
Change-Id: Ic5aa3557353488d5370f4d9c4240954820bfe52b

Mohannad Farrag   commited 2023-03-23 12:14:04 +00:00
16ba062336
Merge "Do not jarjar tests if explicitly excluded."
Chidera Olibie   authored and   Gerrit Code Review   commited 2023-03-23 08:26:47 +00:00
fb94c31fc0
gn2bp: Restrict visibility
Bug: 273656868
Test: ./update_results.sh, TH
Change-Id: Ieb8285b0308495c0cf2d9281ed54714280b7ebb0

Motomu Utsumi   commited 2023-03-23 11:00:03 +09:00
136f5106af
Do not jarjar tests if explicitly excluded.
Test: m
Change-Id: I0ebd5f2d5566d12a1cf0136fcf3e588899757b7c

Chidera Olibie   commited 2023-03-20 23:05:40 +00:00
694295717c
Add cronet_tests target
Test: m cronet_aml_components_cronet_android_cronet_tests__testing
Bug: 267353182
Change-Id: Ib2f555e3d36a5590387a282f4ce8c2ecca2f66d0

Chidera Olibie   commited 2023-03-20 22:28:01 +00:00
26076f9ee6
gn2bp: Add boringssl change to gn2bp generator
Test: None
Change-Id: I5c32d3ec6e0e7351650896b96dd9f2755fe9ca1b

Mohannad Farrag   commited 2023-03-20 19:02:56 +00:00
1e68691ac2
[Cronet] Remove static_libs from genrules
Also adds soong_namespace to bp: cc: aosp/2493857

Test: th
Bug: 274094720
Change-Id: Iddcfee5da5d155708ba164783242c9e1e13b070d

Chidera Olibie   authored and   Patrick Rohr   commited 2023-03-20 18:48:57 +00:00
32f47411d0
gn2bp: Fix some protos include_dirs
* Some net files have different include_dirs for protos generated. If the generated file is at A/B/C/src/D/E. The net file expect the
export include dir to be A/B/C/src/

Test: None
Change-Id: I9ebe54094ea6bd2b00645be2bf724889dbcb3c1f

Mohannad Farrag   commited 2023-03-14 14:43:01 +00:00
aa9159f937
gn2bp: Fix action_foreach with GnRunBinary
* Remove the python3 calls and replace them with the binary right away.
* Fix action_foreach where sources can be used with {{source_file_name}}

Test: None
Change-Id: I0c2e6fd5135de70339168b9ba5d3b7f3a6866fdc

Mohannad Farrag   commited 2023-03-14 14:31:01 +00:00
b6016b6ba4
gn2bp: Remove sqlite from net_unittests
Apply https://chromium-review.googlesource.com/c/chromium/src/+/4166159

Test: None
Change-Id: I297718dddd86a838367e86b8a0449d23114439b6

Mohannad Farrag   commited 2023-03-14 14:30:41 +00:00
cf3a6e698e
Revert "gn2bp: Convert cc_objects to cc_static_library"
This reverts commit 379d79d1b0.

Reason for revert: This is breaking the symbols of test library.

Test: None
Change-Id: I3a2e8a9a6ec6ce04038ed34489ece6a1ca053cef

Mohannad Farrag   commited 2023-03-14 11:02:48 +00:00
c1d95117d3
gn2bp: Update desc json and Android.bp.swp
For manual Android.bp change in aosp/2475845

Bug: 265674359
Test: ./update_results.sh
Change-Id: Ie94708167479a67a52bbc1c7fd629a8206585cfd

Motomu Utsumi   commited 2023-03-14 15:54:17 +09:00
5eff4fbbcf
gn2bp: Add an helper to drop unneeded third_party dependencies
Use a more expressive always_disable function to disable unneeded
third_party dependencies.

Test: Android.bp.swp output is equivalent
Change-Id: Ib21646dfa076fc6f745b7871851744d6ed18eaf3

Stefano Duo   commited 2023-03-13 13:28:35 +00:00
f5954480f5
gn2bp: Drop upstream boringssl build rules in favor of local Android.bp
Due to AOSP's FIPS requirements, AOSP-Cronet's BoringSSL must be
built differently than Chromium-Cronet's BoringSSL. The downstream way
of building BoringSSL is manually mantained in
//external/cronet/third_party/boringssl. So, whenever a target depends
on upstream's boringssl translate that to the downstream custom target.

Test: m && CtsNetHttpTestCases
Change-Id: I34a69de79397c35358745388be433934c203d2b2

Stefano Duo   commited 2023-03-13 13:28:35 +00:00
170dc8e82c
Remove module for creating license for gn2bp script
The license file has moved to external/cronet/Android.extras.bp
in aosp/2469561

Test: m
Change-Id: I2b99de4970a8bf8275195b73b9ad603477bcaf24

Chidera Olibie   commited 2023-03-10 19:54:53 +00:00
25957f5872
gn2bp: Convert cc_objects to cc_static_library
* cc_objects are more like source-sets. However, they are not commonly used in AOSP which makes it risky to rely on them.
* Clang native code coverage is not working for cc_objects. Which is needed for the dashboard.

Size Delta to .SO
x64: -0.1MB
x86: 0MB
arm: 0MB
arm64: 0MB

Test: m
Bug: 270027426
Change-Id: I1d74e0293dac91334bded73b0e89465b7af7480c

Mohannad Farrag   commited 2023-03-02 11:33:19 +00:00
379d79d1b0
gn2bp: Move cronet_aml_api_java to Android.extras.bp
Test: mma
Change-Id: Ia195d7d8505933167478c2f7c116709e1d17a31f

Mohannad Farrag   commited 2023-02-27 18:42:23 +00:00
5d17632032
gn2bp: Update desc_*.json due to overwriting
desc_*.json has been overwritten by https://android-review.git.corp.google.com/c/platform/packages/modules/Connectivity/+/2429636/5

Test: None
Change-Id: I4ffc7c9fa48aaf8f9842871b5d07f69eaeeaeeea

Mohannad Farrag   commited 2023-02-22 18:42:52 +00:00
1413126366
gn2bp: Only compile x64 for host machines
* The generated desc_*.json files except the compiling(not target) cpu architecture to be x64. which
  was an issue because Soong tries to compile for both x32 and x64.

Test: mma
Change-Id: I6be5ed045a25e4020e69bf0157f919f43e68e2c0

Mohannad Farrag   commited 2023-02-22 18:42:18 +00:00
5b8779110f
gn2bp: Change stem for test targets
* Stem should be the name of the target under GN build system as this is the one expected in the source code
as seen here https://source.chromium.org/chromium/chromium/src/+/main:components/cronet/android/test/javatests/src/org/chromium/net/CronetTestRule.java;l=244?q=loadLibrary%5C(%5C%22cronet_tests&ss=chromium%2Fchromium%2Fsrc

Test: None
Change-Id: I758b9b265d0187c93b4fc8ab48491cc5f7a5a750

Mohannad Farrag   commited 2023-02-22 18:41:47 +00:00
b5aa8ea1c8
gn2bp: Duplicate cronet_aml_java for testing
Test: None
Change-Id: Ib7cd19697ac39362cc67ad97e4c6bcf1c516e287

Mohannad Farrag   commited 2023-02-22 18:41:41 +00:00
5127480bb5
gn2bp: Duplicate genrules that affect the JNI/Jarjar
* Most of the genrules doesn't affect the JNI/jajar. Only genrules that uses
the following scripts must be jarjared
  * //base/android/jni_generator/jni_generator.py
  * //base/android/jni_generator/jni_registration_generator.py

Test: None
Change-Id: I2f750e151002b8b21fa2bfd557ad1bbaf5110dff

Mohannad Farrag   commited 2023-02-22 18:40:59 +00:00
f27cd35ddc
gn2bp: Duplicate modules reachable from test targets
* The current testing situation for Cronet is dire due to the presence of Cronet on the platform,
As cronet is on the platform, we can't run any unit-tests as they'll link against the platform version
and not the statically-linked cronet. We could avoid this by jarjaring the code however this is impossible.

* It's impossible to jar-jar the code as the C++ code which does JNI expects jar-jared java classes. So the
only possible solution here would be to duplicate the C++ modules, one for testing(with no jarjar) and another
for platform(with jarjar)

* Java sources/actions are not collected for testing modules until a proper solution has been figured out.

Test: None
Change-Id: I20bbad13d83e9e3c7956f028f3f0493b24d0f8bc

Mohannad Farrag   commited 2023-02-22 18:34:49 +00:00
edb2fd014b
gn2bp: Prevent collection of source files for testing modules
Test: none
Change-Id: I72a2a23021b01bbf7a78fd458405340349503ea5

Mohannad Farrag   commited 2023-02-22 18:34:08 +00:00
fc05430542
gn2bp: Add cronet_unittests_android to the generated Android.bp
* This is a test suite containing 90 unit tests which passes currently on AOSP. using a custom test runner that will be pushed
in upcoming commits

Test: m
Change-Id: Ifa2aa82c5a36ab5b5f9f91dc52dfe803a429a074

Mohannad Farrag   commited 2023-02-22 18:32:57 +00:00
6f8b0bfe1d
Merge changes I549d78ba,I2a3bbe64,Id48dabf8
* changes:
  gn2bp: Add linker script to modules
  gn2bp: Add missing linker flags
  gn2bp: Fix C++ warning showing up as errors when compiling cronet tests

Mohannad Farrag   authored and   Gerrit Code Review   commited 2023-02-22 17:57:17 +00:00
752afc0974
Merge "gn2bp: Fix arch-dependent cc_genrule"
Mohannad Farrag   authored and   Gerrit Code Review   commited 2023-02-22 17:56:56 +00:00
3015f6bcac
Merge "gn2bp: Fix actionSanitizer for gn_run_binary"
Mohannad Farrag   authored and   Gerrit Code Review   commited 2023-02-22 17:56:46 +00:00
6c84e98b7c
Merge "gn2bp: Extract aidl srcs and include dirs"
Mohannad Farrag   authored and   Gerrit Code Review   commited 2023-02-22 17:56:07 +00:00
d5f026395a
gn2bp: Add linker script to modules
Test: m
Change-Id: I549d78baf94b1abec07782df006269ba00e2776c

Mohannad Farrag   commited 2023-02-22 13:00:23 +00:00
0bf6a696a6
gn2bp: Add missing linker flags
* Tests usually shim memory allocations for metrics purposes through linker flags.

Test: m
Change-Id: I2a3bbe648f155469721cf1df25439ca60afee6b5

Mohannad Farrag   commited 2023-02-22 12:56:14 +00:00
875d83b140
gn2bp: Fix C++ warning showing up as errors when compiling cronet tests
Test: m
Change-Id: Id48dabf893fb7dc7698973f8d52a802134d77e82

Mohannad Farrag   commited 2023-02-22 12:55:10 +00:00
6f59224b16
gn2bp: Fix arch-dependent cc_genrule
* The cmd of the `cc_genrule` is now arch-dependent. So we no longer generate a genrule for each arch.
  The propagation of the arch-dependent genrule was broken due to an old if-statement.

Test: m
Change-Id: I4b9b522c429f32fe74d141b00bd856f6c39498d7

Mohannad Farrag   commited 2023-02-22 12:54:54 +00:00
75bc2b175b
gn2bp: Fix actionSanitizer for gn_run_binary
* This is a python script that runs a binary on files to generate output files for testing.
* The python script is not really needed as we can run the binary right away.

Test: m
Change-Id: I3be64e7f51380f2c028dec3168c924451076db95

Mohannad Farrag   commited 2023-02-22 12:54:06 +00:00
631b5c5703
gn2bp: Extract aidl srcs and include dirs
* Aidl `local_include_dirs` was hardcoded. This change should handle extracting the srcs and local include dirs for any
aidl action.

Test: m
Change-Id: I7893dd3897f292f96c1934b192d20b97c26c54cb

Mohannad Farrag   commited 2023-02-22 12:41:41 +00:00
cdbfeb8c45
gn2bp: Add Android.extras.bp support
Test: TH
Change-Id: I66bbbb17446ea1f87e07b3d63d2c4e1ffa9d1a51

Mohannad Farrag   commited 2023-02-22 11:36:52 +00:00
9749911bef
gn2bp: Add unwind related cflags to cflag_allowlist
Bug: 265913942
Test: ./update_results.sh
Change-Id: I264449b31972e963e7833b0647d5f0634e92756f

Motomu Utsumi   commited 2023-02-13 03:48:47 +00:00
925a9d508e
gn2bp: Update args.gn in gen_desc_json
Update gen_desc_json to use the same args.gn with release build job
args.gn was taken from following build job
https://ci.chromium.org/ui/p/chrome/builders/ci/cronet-arm/13133/overview
https://ci.chromium.org/ui/p/chrome/builders/ci/cronet-arm_64/13142/overview
https://ci.chromium.org/ui/p/chrome/builders/ci/cronet-x64/13110/overview
https://ci.chromium.org/ui/p/chrome/builders/ci/cronet-x86/13106/overview

Update desc json and Android.bp following args.gn update.

Bug: 265913942
Test: ./update_results.sh
Change-Id: I676431180e9d25e75612c84b6ce6c03585aed1af

Motomu Utsumi   commited 2023-02-13 03:48:17 +00:00
8d9a62269c
Merge "gn2bp: Add use_nss_certs = false to gen_desc_json"
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-02-10 15:18:28 +00:00
e3e84d0fc3
Merge "gn2bp: Update desc.json & Android.bp after trimming third-parties"
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-02-10 10:48:41 +00:00
39fd1af819
gn2bp: Add use_nss_certs = false to gen_desc_json
nss_certs are only used for host net unittestings.
Android.bp is not affected because the tests are not pulled-in yet.

Test: None
Change-Id: Idef23174d1ecd89c2db90318bfb0cf67a4e70145

Mohannad Farrag   commited 2023-02-10 10:29:14 +00:00
a6f43306c0