Commit graph

1079 commits

Author SHA1 Message Date
Paul Duffin
a4973e8fec Add tests for core library neverallow rules am: b6c6bdd1c2
am: 28630e0c47

Change-Id: If9ac14fe90a21e80d8c7748cb505f53c3983d3c5
2019-06-12 03:11:54 -07:00
Paul Duffin
b6c6bdd1c2 Add tests for core library neverallow rules
Bug: 134566750
Test: m
Change-Id: I65e2afdf726937c29fc4f62a317024dc133254bf
2019-06-12 10:50:24 +01:00
Inseob Kim
9b36280d08 Merge "Clean up sortedKeys function" am: b6fd6f75f2
am: a0ea84a72c

Change-Id: I168d2021a29a4f6e5e46ceec964999cc07677fa7
2019-06-10 12:24:16 -07:00
Treehugger Robot
b6fd6f75f2 Merge "Clean up sortedKeys function" 2019-06-10 19:16:14 +00:00
Colin Cross
abcb92804f Merge "Revert "Consolidate *MutatorContext and ModuleContext into BaseModuleContext"" am: 90ef4b9c12
am: 437679ddd1

Change-Id: Ie2ca6bc1c4df204333baaa3ba0d69c0db7842bc7
2019-06-10 11:18:00 -07:00
Colin Cross
380c69aab4 Revert "Consolidate *MutatorContext and ModuleContext into BaseModuleContext"
This reverts commit 7e0a2cb590.

Reason for revert: broke TARGET_BUILD_APPS builds

Change-Id: I5316a62f77bb38f6195e3df5e31b073dbd1eb682
2019-06-10 17:49:58 +00:00
Colin Cross
9d5d72f7a6 Merge changes I9f8df94f,I2d7f5c56,I0ebb7381,Ieefcfc1a am: a6bf56d4be
am: 236ac108f5

Change-Id: Ia0777130add15aceb17739f5dcb613ca4e1bf172
2019-06-10 10:00:33 -07:00
Inseob Kim
1a365c6a7f Clean up sortedKeys function
This introduces a generic function SortedStringKeys which can be used to
get a slice of sorted string keys for all kinds of maps having string
keys.

Bug: N/A
Test: m
Change-Id: I542194c68984d909b7ad1dbf060d4d3a98f0ef23
2019-06-08 16:10:38 +09:00
Colin Cross
7e0a2cb590 Consolidate *MutatorContext and ModuleContext into BaseModuleContext
Following 99bdb2ab4fd5168a71a20aecf10611425be47ec4 in build/blueprint,
move more methods into BaseModuleContext.

Test: m checkbuild
Change-Id: I9f8df94f1ae2b55d3cccf7b9468247f3e7cb2ebd
2019-06-07 13:29:12 -07:00
Colin Cross
0ea8ba82fc Consolidate baseContext, BaseContext, and BaseModuleContext
blueprint.BaseModuleContext is the set of methods available to all
module-specific calls (GenerateBuildActions or mutators).  The
android package split the same functionality across baseContext (nee
androidBaseContext), BaseModuleContext, and BaseContext.
Consolidate all of them into android.BaseModuleContext.

Test: m checkbuild
Change-Id: I2d7f5c56fd4424032cb93edff6dc730ff33e4f1e
2019-06-06 20:01:31 -07:00
Colin Cross
4157e88427 Rename ModuleBase receivers
I3b23590b8ce7c8a1ea1139411d84a53163288da7 renamed AndroidModuleBase
to ModuleBase, but left the receivers called 'a'.  Rename them to
'm' to match the type.

Test: m checkbuild
Change-Id: I0ebb738152febfd9a2a56ac0b197f19f9e01a1e7
2019-06-06 20:01:23 -07:00
Colin Cross
25de6c30d3 Remove repetition in android package names
Types in the android package don't need to be prefixed with 'android'.

Test: m checkbuild
Change-Id: Ieefcfc1a2c4161d9c412f40ef31867149ec21aec
2019-06-06 17:24:01 -07:00
Colin Cross
d6e75e4ef9 Merge "Support tagged module references" am: b4c35f3378
am: a360b2b335

Change-Id: I61cff6302236ed5c67b86682563eaeae9d0e3363
2019-06-05 10:34:40 -07:00
Roland Levillain
b7dc6845d2 Merge "Remove extra word in soong.android.archMutator's comment." am: 933d2a8e63
am: 97c9f50490

Change-Id: I0315835dcb894e2aa18fcc5d6c92e99705a2a2aa
2019-06-05 10:24:37 -07:00
Treehugger Robot
b4c35f3378 Merge "Support tagged module references" 2019-06-05 17:17:32 +00:00
Treehugger Robot
933d2a8e63 Merge "Remove extra word in soong.android.archMutator's comment." 2019-06-05 17:04:52 +00:00
Patrice Arruda
5c52630d4e Merge "Soong: Define a new Soong module named prebuilt_firmware." am: e52b978c2a
am: 6ed00c6589

Change-Id: I05b0cebe792b6e9d2e53a1236eccb2f5e891cae7
2019-06-05 09:35:56 -07:00
Treehugger Robot
e52b978c2a Merge "Soong: Define a new Soong module named prebuilt_firmware." 2019-06-05 16:17:10 +00:00
Roland Levillain
f5b635d51f Remove extra word in soong.android.archMutator's comment.
Test: n/a
Change-Id: Idb12ebe3f1c1f5bac303fba3ea98aaa569294e90
2019-06-05 14:46:25 +01:00
Colin Cross
41955e8895 Support tagged module references
There are cases where a module needs to refer to an intermediate
output of another module instead of its final output.  For example,
a module may want to use the .jar containing .class files from
another module whose final output is a .jar containing classes.dex
files.  Support a new ":module{.tag}" format in any property that
is annotated with `android:"path"`, which will query the target
module for its ".tag" output(s).

Test: path_properties_test.go, paths_test.go
Test: no unexpected changes in build.ninja
Change-Id: Icd3c9b0d83ff125771767c04046fcffb9fc3f65a
2019-06-04 10:22:51 -07:00
Colin Cross
9cc712aa51 Merge changes I88973671,If5a3b53a am: 2406a123ba
am: 5a927378ea

Change-Id: Ibba9c6d25e075943ffd8d91ee5929a9b591bd25a
2019-06-03 23:30:30 -07:00
Colin Cross
cefa94bd27 Fix data race and ordering consistency in apex modules
apexDepsMutator can be called on multiple apex modules in parallel,
and then two goroutines could call BuildForApex on the same module
in parallel, leading to a data race appending to apexVariations.
This also results in random ordering of the entries in
apexVariations.

Hold a mutex around appending to apexVariations, and sort it before
passing it to ctx.CreateVariations.

Fixes: 134425751
Test: m nothing
Change-Id: If5a3b53a778daacb3e26ac05cde872cf8eb980b3
2019-06-03 15:52:27 -07:00
Patrice Arruda
057a8b1114 Soong: Define a new Soong module named prebuilt_firmware.
There are several firmware files that are being installed to
system/etc/firmware or vendor/firmware. A new module type is
defined to install firmware files to install in the system
or vendor image.

Fixes: b/133711895
Test: Ran lunch, wrote unit test cases, created a sample Android.bp
      with defined prebuilt_firmware Soong and ran mma.

Change-Id: Iaa791cdda4402936037c5a456cc8bf8e6c905b3e
2019-06-03 15:40:22 -07:00
Jaewoong Jung
91cc2a05c8 Merge "Add data property to sh_test." am: 06b2c69cfe
am: d41cf78501

Change-Id: I9fb72312b88b79f1d0b2361e42c801c9a2723e42
2019-05-31 09:41:27 -07:00
Jaewoong Jung
06b2c69cfe Merge "Add data property to sh_test." 2019-05-31 16:05:42 +00:00
patricktu
88b829983c Merge "AIDEGen: Collect the srcjar into out/soong/module_bp_java_deps.json" am: b023fe382b
am: 0fd9fb5299

Change-Id: I7b29c01628ae43cbd0463ac6ebe1746538399b69
2019-05-30 22:48:02 -07:00
Treehugger Robot
b023fe382b Merge "AIDEGen: Collect the srcjar into out/soong/module_bp_java_deps.json" 2019-05-31 05:29:15 +00:00
Jaewoong Jung
8eaeb0987d Add data property to sh_test.
Fixes: 131861785
Test: sh_binary_test.go, a real sh_test with added data
Change-Id: Ic78022d2db38a530074c70823ef16773d8ba6821
2019-05-30 17:21:29 -07:00
Colin Cross
4f3124ee1c Merge "Port uses-shared library verification and dexpreopting to Soong" am: 7a1fefc2de
am: 38ec6cfbf4

Change-Id: Ib9bbb720605f418d242aba98df9d9904671c29e4
2019-05-30 15:04:09 -07:00
Colin Cross
50ddcc4b69 Port uses-shared library verification and dexpreopting to Soong
Ports 09f3b97f4b488cd3a7b7d72038b173575b02c162 (Add support for
preopt with uses-libraries) from Make to Soong to support verifying
and preopting shared libraries.

This reapplies Id25f55f07a55120bebe2a9b32c094209efc85c8b with fixes
for unbundled builds and builds with ALLOW_MISSING_DEPENDENCIES=true
set.

Bug: 132357300
Test: app_test.go
Test: m checkbuild
Change-Id: I964309a68ec4ed081f3f3154879c71048ecb5455
2019-05-29 19:11:26 -07:00
Colin Cross
11a19ed1cc Merge "Revert "Port uses-shared library verification and dexpreopting to Soong"" am: 7d06395f0c
am: cc50c0c4de

Change-Id: I4e12ee0f7d2dbb293e492c55f2eae66dc9638266
2019-05-29 13:55:14 -07:00
Colin Cross
7d06395f0c Merge "Revert "Port uses-shared library verification and dexpreopting to Soong"" 2019-05-29 20:34:10 +00:00
Colin Cross
c032498336 Revert "Port uses-shared library verification and dexpreopting to Soong"
This reverts commit b66d7b1c20.

Reason for revert: broke unbundled builds

Change-Id: I96ae287885107079de4a26e6b100ad8ed66961c0
2019-05-29 20:28:47 +00:00
Colin Cross
7cb1d9c5e2 Merge changes from topic "verify_uses_libraries" am: 2f4c55e9f7
am: 3c8e809052

Change-Id: I9bd1e0d745c605b3617576f9a6044527421fbfe4
2019-05-29 11:32:23 -07:00
Treehugger Robot
2f4c55e9f7 Merge changes from topic "verify_uses_libraries"
* changes:
  Port uses-shared library verification and dexpreopting to Soong
  Move verify_uses_libraries.sh out of dexpreopt
2019-05-29 18:09:01 +00:00
Martin Stjernholm
cc83276c90 Merge "Allow //visibility:public to override other visibility rules." am: 90e2eef512
am: 551438983b

Change-Id: I1f62a8d1c5ad91b4e2cc4bf4435e887132b96571
2019-05-29 09:07:49 -07:00
Colin Cross
b66d7b1c20 Port uses-shared library verification and dexpreopting to Soong
Ports 09f3b97f4b488cd3a7b7d72038b173575b02c162 (Add support for
preopt with uses-libraries) from Make to Soong to support verifying
and preopting shared libraries.

Bug: 132357300
Test: app_test.go
Test: m checkbuild
Change-Id: Id25f55f07a55120bebe2a9b32c094209efc85c8b
2019-05-28 11:20:09 -07:00
patricktu
18c82ffea7 AIDEGen: Collect the srcjar into out/soong/module_bp_java_deps.json
Build module_bp_java_deps.json without this change:
Build time: 3m53.761s
File size: 12,955,363 Bytes

Build module_bp_java_deps.json with this change:
Build time: 3m49.106s
File size: 13,361,647 Bytes

Bug: 132407603
Test: 1. SOONG_COLLECT_JAVA_DEPS=false make nothing
      2. SOONG_COLLECT_JAVA_DEPS=true make nothing
      3. Check module_bp_java_deps.json in /out/soong.
         In SettingsProvider section there should contain
         "srcjars": [
             "out/soong/.intermediates/frameworks/base/packages/SettingsProvider/SettingsProvider/android_common/gen/R.jar"
         ]

Change-Id: I800a4d4f13b280d7ef87005e599cbd0aaf8c93f4
2019-05-27 11:34:10 +00:00
Martin Stjernholm
226b20dc15 Allow //visibility:public to override other visibility rules.
However only allow it when they are merged from different defaults.

Extend the tests to cover that and other cases with visibilities in
defaults.

Also avoid dumping the whole visibility spec in the error message when a
visibility check fails, because it gets noisy for long visibility lists, and
can be confusing when //visibility:public gets merged with other visibility
rules.

Test: Soong self test
Bug: 112158820
Bug: 130796911
Change-Id: I242513975a3f824b9ea2eab5b94b194b9af2481b
2019-05-24 16:33:50 +01:00
Dimitry Ivanov
16e7643f54 Merge "Apply native_bridge suffix to all cc_modules" am: 7636b362e1
am: 158ca2bfa2

Change-Id: I09fd0978f62c8812b3ba7e3ea02608b278448a11
2019-05-24 01:47:32 -07:00
Dimitry Ivanov
7636b362e1 Merge "Apply native_bridge suffix to all cc_modules" 2019-05-24 08:28:55 +00:00
Martin Stjernholm
a161caf5d7 Merge "Add some more visibility test cases." am: d14e5c6ed4
am: 295630abf8

Change-Id: I410c1917c3e9e08cf4165a4eae53648b8b71ece1
2019-05-23 11:04:39 -07:00
Treehugger Robot
d14e5c6ed4 Merge "Add some more visibility test cases." 2019-05-23 16:31:49 +00:00
dimitry
4320449c97 Apply native_bridge suffix to all cc_modules
This fixes the problem with cc_object not having this suffix and
as a result overriding non-bridged variants for modules using mk files.

Bug: http://b/77159578
Test: build 4arch product
Change-Id: Ie958f997c6f54f93d8b2987ca5ba605004e1eb70
2019-05-23 13:31:10 +02:00
dimitry
962029a8c6 Merge "Native bridge modules are not translated second archs" am: 989d83ce1d
am: 1d7bb4fb21

Change-Id: Ibd70ff04a1016b0569be623da1e2e83961c1f71a
2019-05-22 21:19:09 -07:00
dimitry
628db6faa4 Native bridge modules are not translated second archs
Ignore native_bridge targets when detecting whether second
architecture is translated or not.

The concept of second translated architectures is almost deprected
and will be removed once all affected products are switched to
native_bridge support from the build system.

Bug: http://b/77159578
Test: make 4arch target
Change-Id: Ife93ccc60f5c1a4020f66b2cf862b709889d9d6b
2019-05-22 15:21:15 +00:00
Martin Stjernholm
8edeb6372e Add some more visibility test cases.
Bug: 112158820
Test: Soong self test
Change-Id: Ia359c35c0c124bac2693926ce8f05dd20435f05d
2019-05-21 20:36:00 +01:00
Colin Cross
1f547cfaac Merge changes I3dc3fded,Ic1276329,I6be04dec am: 045f0f1f30
am: 4c18d670df

Change-Id: I0c32a4d28740aa23c4a8ee90a879b19374f915ed
2019-05-17 18:40:13 -07:00
Colin Cross
0d99f7cd84 Don't create a second host arch for tests on darwin
Only x86_64 darwin is supported, not x86.  Don't create an x86
host arch when running tests on darwin.

Test: all soong tests
Change-Id: Ic12763298345e32a1340f8fbef338d2ab4d62b2e
2019-05-17 08:43:36 -07:00
Jaewoong Jung
b16dc74729 Merge "Fix override_android_app dependency issues." am: 105920a792
am: ac5ee3559f

Change-Id: Ie6447241cc069f507d053e10d78ba540d9cc84f9
2019-05-16 08:31:45 -07:00