Commit graph

20653 commits

Author SHA1 Message Date
Paul Duffin
452bf39014 Merge "Apply hiddenapi encoding to java_sdk_library .impl" 2020-06-30 10:41:42 +00:00
Colin Cross
25fd77310c Fix finder on symlinks pointing to directories
When finder encountered a symlink pointing to a directory it attempted
to ignore it, but becuase Lstat returns the a *os.FileInfo for the
symlink the child.IsDir() check always returned false.  Call Stat
on the symlink to get the *os.FileInfo for the target of the symlink.

Bug: 157656545
Test: finder_test.go
Change-Id: Ie33d2e05d5c435b48e83eaeadf7b3c9816398404
2020-06-29 23:30:38 -07:00
Colin Cross
7cdad45cf2 Add Stat to finder/fs
Add a Stat method to finder/fs that will be used by finder to read
the mode of the target of a symlink.

Bug: 157656545
Test: fs_test.go
Change-Id: Ie2b4509b7d11857d9a1685de4477088b91d43c63
2020-06-29 23:30:38 -07:00
Colin Cross
7f8aa39abe Move finder_test filesystem helper functions to fs/test.go
Move the filesystem helper functions used by finder_test.go into the
fs package so they can also be used by fs tests.

Bug: 157656545
Test: m checkbuild
Change-Id: I5ac3a1f502d8e2cb7c15dd70ca85a46d20f939a6
2020-06-29 23:30:38 -07:00
Liz Kammer
a66f571e01 Merge "Add relative_install_path property to prebuilt_etc" 2020-06-29 22:50:36 +00:00
Treehugger Robot
1aaad5193f Merge "[cc/pgo] Fix incorrect project name" 2020-06-29 21:23:05 +00:00
Treehugger Robot
e9eacaa061 Merge "Move gen-kotlin-build-file.sh to python" 2020-06-29 21:12:45 +00:00
Paul Duffin
a2058f8b7d Apply hiddenapi encoding to java_sdk_library .impl
Adds a ConfigurationName property, and ConfigurationName() method that
allows a library to separate its name (e.g. framework-tethering.impl)
from the name used in the build configuration,
    e.g. ctx.Config().BootJars().

Updates hiddenapi processing to use ConfigurationName() instead of
ctx.ModuleName().

Changes java_sdk_library to set the ConfigurationName property
of the implementation library to the name of the module instead of
<module>.impl so that it will match the name in the boot jars list.

Bug: 159683330
Test: m framework-tethering
      dexdump ${PRODUCT_OUT}/apex/com.android.tethering/javalib/framework-tethering.jar | grep hiddenapi | wc -l
      Verify that there are >0 hiddenapi entries.
      Add java_sdk_library_import prefer=true for framework-tethering
      and repeat the above to verify that there are 0 hiddenapi entries.
      Apply this change, repeat above and verify that there are the same # of entries as before.
      Remove the prebuilt for framework-tethering
      Repeat the above and verify that there is no change to the # of entries
Merged-In: I6c3016c35d0fcb1b95d4f9b37a307a69878f8e0a
Change-Id: I6c3016c35d0fcb1b95d4f9b37a307a69878f8e0a
(cherry picked from commit c4422106a7)
2020-06-29 19:05:19 +01:00
Liz Kammer
0449a6337e Add relative_install_path property to prebuilt_etc
This supports a more consistent property across modules for specifying a
subdirectory to install a file into for prebuilt_etc modules.

Updates bpfix to rewrite `sub_dir` to `relative_install_path`.

Test: gotest prebuilt_etc_test
Test: gotest bpfix_test
Bug: 156568187
Change-Id: Idd05cd2178c46e290764a3b708faa8275818ca1e
2020-06-29 10:54:03 -07:00
Pirama Arumuga Nainar
9d544a83bf [cc/pgo] Fix incorrect project name
Bug: http://b/159920645

Look for internal profiles at the correct project.

Test: N/A
Change-Id: I6a64adbb043da7e419f99c3182d2ec29240ad8f3
2020-06-29 09:25:51 -07:00
Paul Duffin
ca8d9a5018 Track the current java_sdk_library(_import) deps
Adds some tests to track the current dependencies between
java_sdk_library, java_sdk_library_import and their child modules in
various configurations. This is in preparation for a series of changes
that will update the dependencies to ensure that the java_sdk_library
always depends on the source modules that it creates and
java_sdk_library_import always depends on the prebuilt modules that it
creates.

Comments in the tests highlight the parts that will be affected by the
follow up changes.

Bug: 159902351
Test: m nothing
Change-Id: I8eea3ac80061f5cbbc9dec201750c4b59e224b4b
2020-06-29 13:15:33 +01:00
Thiébaud Weksteen
5e291c238f Fix bpfmt issues and add bpfmt to preupload checks
Test: m nothing
Change-Id: I10526a33685335bdd26cc7692815133379d4e0f6
2020-06-29 09:14:08 +02:00
Jooyung Han
2dfd54d07e apex: add / in file_contexts as system_file
apex_manifest.pb is added to payload.img by the build system and is
supposed to be read by apexd during activation.

So, / and /apex_manifest.pb should be labeled as "system_file" so
that apexd can read it regardless of how file_contexts is defined.

580eb4fe38 adds /apex_manifest.pb and this
change adds / as well to file_contexts.

Bug: 159767275
Test: add an apex with file_contexts with everything as vendor_file
      apexd should activate the apex.
Change-Id: I827fa3af49ca7f20f3f82fcb16868f60d94d9531
2020-06-29 14:54:22 +09:00
Treehugger Robot
0c6f111d7b Merge changes Ifd2858dd,I2585dd99,I65e7a456
* changes:
  apex: use SubName for requiredDeps
  apex: support "vendor: true"
  apex: AndroidMk writes common properties
2020-06-29 02:20:56 +00:00
Roland Levillain
aca944916a Add "art/test" to the list of Core Library projects.
Allow modules under art/test to use `sdk_version: "none"`. This is so
that ART run-test module definitions can use the same settings as
Libcore tests:

  sdk_version: "none",
  system_modules: "core-all-system-modules",

Test: m nothing
Bug: 147814778
Change-Id: Ibb74d6a06a6609be511403c51ca7a02204bf606f
2020-06-27 16:20:00 +01:00
Roland Levillain
e95eb455cc Merge "Add soong.java.testProperties to java_defaults module type." 2020-06-27 14:33:12 +00:00
Colin Cross
9b1aa0cb86 Move gen-kotlin-build-file.sh to python
Kotlin common multiplatform sources support will require more
complexity in gen-kotlin-build-file.sh, move it to python instead.

Test: m checkbuild
Change-Id: I02312160ad781877f1fec971168331c0dcecf136
2020-06-26 22:41:34 -07:00
George Burgess IV
fb81db2f4d soong: globally enable -Wunreachable-code-loop-increment
This warning only flags code that's otherwise pretty trivial to refactor
into something more readable. It also catches nasty bugs, so turning it
on seems like a good idea.

Bug: 150166387
Test: TreeHugger
Change-Id: I0e095d83ba4a2dcd81f680efd8ea3d2a6fe1a970
2020-06-27 01:44:36 +00:00
Matthew Maurer
85a08fc454 Merge "Add clippy-driver build rule" 2020-06-26 20:33:37 +00:00
Treehugger Robot
a8bfdbd131 Merge "Update rustc to 1.44.0" 2020-06-26 19:26:09 +00:00
Nicolas Geoffray
eb2676ea71 Merge "Add platform libraries required for ART chroot testing." 2020-06-26 19:10:30 +00:00
Treehugger Robot
b1af227b4a Merge "Add Matt to OWNERS for Rust" 2020-06-26 17:22:09 +00:00
Chris Gross
8f3386e49b Merge "Use a default exclude filter for JaCoCo in Soong." 2020-06-26 14:59:15 +00:00
Chris Parsons
8f232a2702 Add missing soong_docs inputs
Specifically, make Android.bp.list and soong.variables explicit inputs

While this is not a comprehensive list of all inputs
of this action (as the action depends on all blueprint
files in the source tree), this is closer to the truth.

This is a rollforward CL, which was originally rolled
back, as path validation failed for when OUT_DIR was
an absolute path. Validation has now been relaxed.

Test: Manually verified ninja output, checkbuild approved validation
  for aosp-crosshatch, and manually ran frameworks/rs/build_rs.py with
  patch fix
Change-Id: I4eb0d517f57336dd54eaa4bd31f46df9e93e6da2
2020-06-26 10:36:18 -04:00
Nicolas Geoffray
792ea7359a Add platform libraries required for ART chroot testing.
Those libraries are not in an APEX, and are provided as stubs
in the platform-mainline-sdk. Therefore compile them explicitly and make
them available in the dist directory.

Test: scripts/build-mainline-modules.sh
Bug: 142935992
Change-Id: I919d8c580e907ce9a7b54366653d0c63ab9d00c7
2020-06-26 15:17:47 +01:00
Jeff Vander Stoep
530dccb8c5 Update rustc to 1.44.0
Test: Treehugger
Change-Id: Ib940bc5afbbbec6b16ed7c2879ad31438e58907d
2020-06-26 15:26:49 +02:00
Roland Levillain
b5b0ff3555 Add soong.java.testProperties to java_defaults module type.
This is so that we can use some test properties in a `java_defaults`
module for ART run-tests.

Test: atest art-run-test-001-HelloWorld
Bug: 147814778
Change-Id: Ifb9817ca2f08e64f911c123a4022fbf688405547
2020-06-26 12:51:37 +01:00
Thiébaud Weksteen
92f703b084 Add clippy-driver build rule
Depending on the location of the repository (e.g. external/, vendor/), a
different set of lints will be enabled. Add the clippy property to the
rust_* modules. This property can be used to overwrite the default
behaviour.

Test: m checkbuild
Bug: 157238651
Change-Id: Ife0f723ef4a74abb102597f8486a7b9f30e7d351
2020-06-26 13:31:21 +02:00
Ulyana Trafimovich
3d88ad68be Merge "Move construct_context.sh from Make to Soong. Update OWNERS list." 2020-06-26 08:46:58 +00:00
Jingwen Chen
d06f11ee71 Merge "Support multiple dists per Android.bp module, and dist output selection." 2020-06-26 08:03:27 +00:00
Jeff Vander Stoep
03186ed247 Add Matt to OWNERS for Rust
Test: n/a
Change-Id: Ibecfd0edd9950a161246d9a13179d88f7e957244
2020-06-26 09:23:47 +02:00
Thiébaud Weksteen
9ae615fb99 Merge "Remove duplicate Helper call" 2020-06-26 07:18:02 +00:00
Treehugger Robot
3e2a34dd8d Merge "Dist build.ninja and Android.bp.list" 2020-06-25 22:23:45 +00:00
Colin Cross
8ba7d47bba Dist build.ninja and Android.bp.list
Debugging issues on the build servers can be difficult because the
intermediate files are not visible.  Gzip ninja file and Makefiles
generated by Soong and the ninja files generated by Kati to the dist
directory, and also copy all of the finder output files.

Bug: 157656545
Test: m dist nothing
Change-Id: I48d75305e551ccae81c7a55721981cf58acd838b
2020-06-25 12:50:00 -07:00
Thiébaud Weksteen
5f2de778f4 Remove duplicate Helper call
The testRustContext function is used to prepare the environment for the
unit tests. As such, it is marked as a Helper function. Remove a
second superfluous call within its definition.

Test: m nothing
Change-Id: I37ea9a584b33498794c1cac828a7557d4bea8d7c
2020-06-25 21:25:41 +02:00
Liz Kammer
d9857f83a8 Merge "Add androidmk error for multiple assignments" 2020-06-25 18:11:07 +00:00
Chris Gross
2f748692dd Use a default exclude filter for JaCoCo in Soong.
Instrumented builds should exclude certain classes from instrumenation
by default. (e.g. JaCoCo itself) Leverage the existing
DefaultJacocoExclusionFilter to do this.

Note: Two different default filters exist now (one for Make and one for
Soong), as they have different wildcard rules.

Test: EMMA_INSTRUMENT=true EMMA_INSTRUMENT_STATIC=true m -j32
TeleService and inspected the resulting temporary jar that was
instrumented to confirm that anything from org/jacoco was excluded.
Bug: 159748844

Change-Id: I5466b0a03957edfbe53971d5d1a7729fdb8337db
2020-06-25 16:45:44 +00:00
Martin Stjernholm
c4fe0dd3cc Merge "Disable flattening only for unbundled apps." 2020-06-25 13:49:30 +00:00
Ulya Trafimovich
5cb30c5820 Move construct_context.sh from Make to Soong. Update OWNERS list.
This script belongs with other manifest-related scripts, and the future
plan is to rewrite it in Python and share common functionality with
other scripts.

Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Change-Id: I4b90129e5023ca1a2c818fc160c34b0b7da943ef
2020-06-25 14:46:35 +01:00
Jingwen Chen
40fd90ae52 Support multiple dists per Android.bp module, and dist output selection.
This CL adds "dists" to the base property struct to support multiple
dist file configurations, and generic tag support to dist tagged outputs
of modules.

Fixes: b/152834186
Test: soong tests and `m sdk dist`

Change-Id: I80c86bc9b7b09e671f640a4480c45d438bdd9a2a
Signed-off-by: Jingwen Chen <jingwen@google.com>
2020-06-25 12:42:07 +00:00
Jooyung Han
efb184e499 apex: use SubName for requiredDeps
apexBundle keeps the required dependencies for native modules which are
external dependencies and then records it in .mk file as
LOCAL_REQUIRED_MODULES key.

LOCAL_REQUIRED_MODULES should list module name which are made of
cc.BaseModuleName() + SubName.

By the way, because a use_vendor:true apex is supposed to be installed
in /system/apex, we don't append SubName(.vendor) suffix.

Bug: 159211312
Bug: 155841765
Test: m
Change-Id: Ifd2858dda0b373110a0cd18a0c55db41f0fc2a99
2020-06-25 17:14:25 +09:00
Treehugger Robot
670ed3d97d Merge "Avoid race condition over ExportedSystemIncludeDirs" 2020-06-25 07:35:54 +00:00
Jooyung Han
85d61767b5 apex: support "vendor: true"
When an apex sets "vendor: true", it becomes a vendor apex.

Vendor apexes use vendor variants for native modules and are
installed in /vendor/apex.

Bug: 159211312
Test: m
Change-Id: I2585dd990ba857a2ab3ec6ab24e09d4652e867f2
2020-06-25 15:37:47 +09:00
Jooyung Han
2ed99d00b4 apex: AndroidMk writes common properties
AndroidMkEntries handles bunch of common properties(e.g. LOCAL_INIT_RC,
LOCAL_VINTF_FRAGMENTS, etc).

However apex defines its own Custom() writer, so those properties should
be handled manually.

For example, when an apex defines "init_rc" properties, the value should
be passed to Make via LOCAL_INIT_RC.

Bug: 159211312
Test: m
Change-Id: I65e7a456486c9f5fe70c91b78ff181425035fcf2
2020-06-25 15:30:26 +09:00
Jooyung Han
dd85fd89b0 Merge "apex: add apex_manifest.pb in file_contexts" 2020-06-25 06:21:40 +00:00
Jooyung Han
83f107cdfb Merge "Check base property before using it" 2020-06-25 03:13:16 +00:00
Treehugger Robot
0acb0fb2b7 Merge "Only look for profiles when we have a profile dir" 2020-06-25 01:28:52 +00:00
Jooyung Han
14a08f5b28 Merge "apex/apk: enforce min_sdk_version of all deps" 2020-06-25 01:18:52 +00:00
Jooyung Han
5c17ac003a Check base property before using it
OverrideModule's `base` property should point a valid
module(OverridableModule).

It should be checked before using it.

Bug: 159503211
Test: add `override_apex` without `base`
      m emits error, not panic.
Change-Id: I1d7c9395cc9a7461e317dd4b6ddbec3a9e68e9bf
(cherry picked from commit 3851b0c1fe8e8ffd3d30b4b8a5289f39a2c98270)
2020-06-25 09:17:59 +09:00
Dan Willemsen
78d51b00de Only look for profiles when we have a profile dir
Right now, it's looking for *.prof files at the top of the source
directory.

For devices that don't specify the profile dir (everything on AOSP,
etc), this saves a couple percent of the globs that we check during
every build (and would re-execute if you add or remove files from the
top directory)

Bug: 159845846
Test: treehugger
Change-Id: I10d43422a2b5ae25e6557d435ecc89fe43536dd7
2020-06-24 16:33:31 -07:00