Commit graph

10486 commits

Author SHA1 Message Date
Jiyong Park
c95714ed0d Arch-specific source for prebuilt_apex
Arch-specific source can be specified for prebuilt_apex as follows.

arch: {
    arm64: {
        src: "myapex-arm64.apex",
    },
},

A note on the implementation. The Src property was not tagged as
`android:"arch_variant"` as usual. Instead, multiple Src properties are
explicitly declared like

struct Arch {
    struct Arm {
        struct Src *string
    }
    ...
}

Corresponding Src property is manually selected according to the
MultiTargets()[0].

This is because prebuilt_apex is mutated only for android_common, in
order to have the same arch variant with the apex module type.
Therefore, we can't rely on the arch_variant tag.

Bug: 127789981
Test: m (apex_test amended)

Change-Id: I77dbe626171d8975f549bdb4af3c487232cf05f7
2019-03-30 14:11:37 +09:00
Jaewoong Jung
939ebd5f33 Add prebuilt_apex.
Bug: 127789981
Test: apex_test.go + com.android.tzdata.apex
Change-Id: I09bb0a4b2acf310c55c789569da3c9d755638232
2019-03-28 15:56:22 -07:00
Yi Kong
ac7f27eab0 Merge "Switch to clang-r353983b" 2019-03-27 15:52:05 +00:00
Colin Cross
eae12cf400 Merge "Always package JNI libs into android_test modules" 2019-03-27 15:39:17 +00:00
Patrice Arruda
39302bbcb9 Merge "Soong: Add synopsis to soong_namespace module." 2019-03-27 15:37:17 +00:00
Colin Cross
47fa9d3d83 Always package JNI libs into android_test modules
android_test modules should always have native libraries packaged
into the APK even when use_embedded_native_libs: false is set.

Fixes: 129298278
Test: TestJNIPackaging
Change-Id: Idfcc630f7c6579c1280a920b5d71808b0a502e06
2019-03-27 15:09:52 +00:00
Jaewoong Jung
c7dd408f89 Merge "Add package_name property to android_app." 2019-03-27 14:13:15 +00:00
Nikita Ioffe
ca57e57837 Merge "Add support for clang-tidy -warnings-as-errors in Android.bp files" 2019-03-27 10:18:15 +00:00
Yi Kong
5d7aeeac24 Switch to clang-r353983b
Test: TreeHugger
Bug: 122993569
Bug: 128427449
Bug: 128937182
Bug: 128973188
Change-Id: I300efbbad47973d265f636645b83dad0c4d6630a
2019-03-27 02:09:40 +00:00
Jaewoong Jung
6f373f60c4 Add package_name property to android_app.
This enables users to override the package name of their apps either
directly in android_app or through override_android_app.

Bug: 122957760
Test: app_test.go
Change-Id: I98080a4076ce970fc85e58fc33495ba9b363eec9
2019-03-26 15:17:17 -07:00
Nikita Ioffe
32c4986268 Add support for clang-tidy -warnings-as-errors in Android.bp files
Test: manually change Android.bp and checked clang-tidy invocation cmd
Change-Id: I51a64b3f7da82428b896f46f739c93d76a050aaf
2019-03-26 20:47:08 +00:00
Patrice Arruda
64765aaef9 Soong: Add synopsis to soong_namespace module.
Synopsis was missing to soong_namespace module. Also added documentation
to imports properties. This required the namespaceProperties struct to be
pulled out of the NamespaceModule struct in order for the documentation
tool to extract the property documentation.

Bug: b/128337482
Test: Ran the doc generation command and verified that the synopsis was
added to soong_namespace and imports properties is listed too.

Change-Id: I519b14629bdbc85f35fbc8fa03e78dc2ad3f655e
2019-03-26 09:09:41 -07:00
Paul Duffin
d637872f44 Merge "Add java_test_helper_library" 2019-03-26 14:01:02 +00:00
Treehugger Robot
0aad00631a Merge "Soong: Add synopsis to several modules under cc package." 2019-03-26 03:39:13 +00:00
Yi Kong
ff58c0e248 Merge "Support LLD ThinLTO cache/threshold option" 2019-03-26 00:02:36 +00:00
Patrice Arruda
c249c718ab Soong: Add synopsis to several modules under cc package.
Added synopsis to the following modules under cc package:
    * cc_binary
    * cc_binary_host
    * cc_defaults
    * cc_genrule
    * cc_test
    * cc_test_host

Bug: b/128337482
Test: Generated the documentation and verified that the
synopsis was added to each of the module.

Change-Id: I23b7eda449c340783d7cc592df5d2bd399255bf9
2019-03-25 14:21:29 +00:00
Paul Duffin
42df144fd4 Add java_test_helper_library
Extracts testSuiteComponent() function to reduce duplication.

Bug: 128969758
Test: atest CtsJdwpTestCases
Change-Id: I23746b18112d22f8670666f429a665b34b1955fd
2019-03-25 11:48:01 +00:00
Sasha Smundak
fc22e4eeba Treat stl: "system" the same way as default.
Test: verify that adding `stl: "system"` does not change the module
build.

Change-Id: I55fbde223e4a4695df7524213e1bf3671da84e8e
2019-03-24 14:17:56 -07:00
Treehugger Robot
789b84b12f Merge "ATest: GTest auto gen config support run_test_as in Android.bp ." 2019-03-23 14:45:45 +00:00
Treehugger Robot
6d75c9d18e Merge "Don't visit disabled modules with SOONG_COLLECT_JAVA_DEPS=true" 2019-03-23 14:41:37 +00:00
Treehugger Robot
4ada982da9 Merge "Rename jetifier property and add it to androidmk" 2019-03-23 06:09:25 +00:00
Colin Cross
c48428a6bb Don't visit disabled modules with SOONG_COLLECT_JAVA_DEPS=true
Calling AndroidMk() on a disabled module may not be safe because
the module will not have had GenerateAndroidBuildActions() called
on it to initialize the data structures that AndroidMk() expects
to exist.  Check module.Enabled() before generating IDE info.

Fixes: 129089976
Test: SOONG_COLLECT_JAVA_DEPS=true m nothing
Change-Id: Icd79088c532c1842801f2bf89d92bc1a67109936
2019-03-23 04:42:57 +00:00
yelinhsieh
9fc6040efe ATest: GTest auto gen config support run_test_as in Android.bp .
Feature request from developer, support setting uid in Android.bp.

This relands I5604af5f20c45728d19f4c01396a20a74997f8a8 on top of
I2210c15b84f9b30e1cc23b426d463b34cf9ef94f.

Bug: 113359343

Test: source build/envsetup.sh ; lunch
    vim platform_testing/tests/example/native/Android.bp
    add
    test_options: {
        run_test_as: "1234",
    },
    in cc_test
    make hello_world_test
    cat out/target/product/xxxx/testcases/hello_world_test/hello_world_test.config
    Will see  <option name="run-test-as" value="1234" />
    below <test class="com.android.tradefed.testtype.GTest" >

Change-Id: I0b167c44c00ff0eab51443fc93dd8fa2abbe54cf
2019-03-23 04:42:48 +00:00
Yi Kong
630b960fb5 Support LLD ThinLTO cache/threshold option
LLD has different option syntax for specifying ThinLTO cache. Change it
to LLD syntax and drop the support for GOLD, since there aren't many
projects that are linked with it.

Test: USE_THINLTO_CACHE=true m
Change-Id: I5c6c5281a05793414a6387d52ae48d9b43822ee9
2019-03-22 21:32:45 -07:00
Jaewoong Jung
66f2e8701e Merge "Add synopsis for prebuilt_apis." 2019-03-22 17:16:45 +00:00
Colin Cross
663716bc35 Merge changes If670f20d,I8cf5f3b8
* changes:
  Panic if logging is attempted after Close
  Wait for ninja proto processing to finish when exiting
2019-03-22 16:49:29 +00:00
Colin Cross
1001a7971a Rename jetifier property and add it to androidmk
Rename jetifier_enabled to jetifier since there are no users
yet and it is more consistent with the rest of the Soong
properties.  Also add it to androidmk translation.

Fixes: 123524520
Test: androidmk_test.go
Change-Id: Ib4c688cf3cb171a822ddf7dd49467522c4c1276c
2019-03-22 15:25:30 +00:00
Jaewoong Jung
e9665723da Merge "Add override_android_app module type." 2019-03-22 14:36:04 +00:00
Treehugger Robot
ebe2b86cbc Merge ":module syntax support properties in apex_key" 2019-03-22 06:57:33 +00:00
Colin Cross
1aeb049a54 Panic if logging is attempted after Close
Attempt to catch places where logs are truncated by panicing if
logging is attempted after Close.

Test: m nothing
Change-Id: If670f20d08832ed65b63af5589b548e9815f2f0d
2019-03-21 21:17:04 -07:00
Colin Cross
b98d3bcf4e Wait for ninja proto processing to finish when exiting
Wait for the ninja proto processing goroutine to notice the fifo
has closed and exit before continuing.

Test: m nothing
Change-Id: I8cf5f3b8bf6a91496c6d2bbbd3e811eb7f0c9d21
2019-03-21 21:17:04 -07:00
Treehugger Robot
7446606eeb Merge "Tell make that sh_test is a NATIVE_TEST" 2019-03-22 02:58:42 +00:00
Jiyong Park
6788256d09 :module syntax support properties in apex_key
public_key and private_key properties support :module syntax so that the
key pairs can be dynamically created during the build, which is useful
for one-time keys.

Bug: 128960614
Test: m (apex_test amended)

Change-Id: I249b1d29f247784193b0d733a7b6a20274ece105
2019-03-22 11:41:09 +09:00
Peter Collingbourne
df59655fa3 Merge "Pass -fsanitize-hwaddress-abi=platform when building with hwasan." 2019-03-22 02:14:34 +00:00
Treehugger Robot
6b200500cc Merge "Fix checking of empty slice properties" 2019-03-22 01:22:11 +00:00
Jaewoong Jung
5fb5b2a7f5 Add synopsis for prebuilt_apis.
Test: m soong_docs
Change-Id: I0e2cefd3dd24e5c8483d32cc325a37e96d3d495c
2019-03-21 17:44:11 -07:00
Peter Collingbourne
e726ba56ac Pass -fsanitize-hwaddress-abi=platform when building with hwasan.
Reduces size of walleye_hwasan-userdebug system.img by another 4.5MB.

Bug: 122363025
Change-Id: I6d15c237dc5f330ad574a73147b2b2c712fe125e
2019-03-21 16:22:00 -07:00
Jaewoong Jung
525443aa22 Add override_android_app module type.
This is a new implementation of overriding module types that makes use
of local variants. With this, product owners can use PRODUCT_PACKAGES to
decide which override module to include in their products.

Bug: 122957760
Bug: 123640028
Test: app_test.go
Change-Id: Ie65e97f615d006b6e9475193b6017ea9d97e8e97
2019-03-21 13:26:20 -07:00
Dan Willemsen
3db041948b Tell make that sh_test is a NATIVE_TEST
So that it ends up in VTS's DATA/nativetest like a cc_test, and
otherwise acts like a test.

Test: convert external/linux-kselftest to sh_test
Change-Id: I44b7cfca45f8fe5d7fbb6eaa845a79bd70f155ef
2019-03-21 12:44:57 -07:00
Inseob Kim
6e93ac9a32 Fix checking of empty slice properties
Properties can be empty (not nil), and in that case some weird error
messages will happen to be emitted.

Bug: N/A
Test: try to build with api_pacakges: [] and srcs: []
Change-Id: I492077616e742072696265796520737465616b21
2019-03-21 22:04:01 +09:00
Anton Hansson
53c88448fd Separate device and product overlays
This change adds book-keeping of whether an overlay came from
DEVICE_PACKAGE_OVERLAYS or PRODUCT_PACKAGE_OVERLAYS. This is
later used when writing the output to soong_app_prebuilt.mk, to
use either LOCAL_SOONG_[DEVICE|PRODUCT]_RRO_PACKAGES depending
on the original source.

This change is intended to be a noop on its own, but allows a
follow-up make change to customize the location of the auto-generated
RRO packages.

Bug: 127758779
Test: verify noop on presubmit targets
Change-Id: Ib24fe1d05be132c360dd6966f7c83968c9939f77
2019-03-21 11:25:46 +00:00
Treehugger Robot
21c81326ff Merge "Notice support for APEX" 2019-03-21 06:04:14 +00:00
Vic Yang
efd249e62a Add support for no-vendor-variant VNDK
When no-vendor-variant VNDK is enabled, the vendor variant of VNDK
libraries are not installed.  Since not all VNDK libraries will be
ready for this, we keep a list of library names in cc/vndk.go to
indicate which libraries must have their vendor variants always
installed regardless of whether no-vendor-variant VNDK is enabled.

Also add --remove-build-id option to the strip script to facilitate
the check of functional identity of the two variants.

Bug: 119423884
Test: Add a dummy VNDK library and build with
      TARGET_VNDK_USE_CORE_VARIANT := true, with the corresponding
      build/make change.

Change-Id: Ieb1589488690e1cef1e310669a8b47a8b8759dac
2019-03-21 04:29:24 +00:00
Treehugger Robot
f8d3be9cb7 Merge "Export genrules to Make as phony packages" 2019-03-21 00:07:21 +00:00
Jiyong Park
52818fcde8 Notice support for APEX
Notice file for an APEX is created by merging notice files for the
modules included in it (plus the notice file for the APEX itself if
specified).

Notice files having the same content are not duplicated; it is emitted
only once.

Bug: 128701495
Test: m (apex_test is amended)
Test: m and inspect $(PRODUCT_OUT)/obj/NOTICE.txt to check there are
license entries for /system/apex/*.apex files

Change-Id: I169d91038291a6c71615de97cf5b03174afab5d4
2019-03-21 08:05:50 +09:00
Yi Kong
5a3f31b284 Merge "Turn on string-plus-int warning" 2019-03-20 21:33:46 +00:00
Pirama Arumuga Nainar
3c21c0b1d9 Enable lld for windows
Bug: http://b/110800681

The following flags that the binutils linkers support are not available
in lld for Windows:
  -soname
  --no-undefined
  -rpath

Windows also uses "import libraries", which are stub libraries used only
for linking.  The binutils linkers accepted a DLL and treated them as an
import library.  But lld issues the following error:

  lld-link: error: ...DLL: bad file type. Did you specify a DLL instead
  of an import library?

To resolve this, pass '-out-implib=libFoo.a' to lld when linking
libFoo.dll.  Add libFoo.a as an implicit output to the 'ld' build rule.

Rewrite the shared libraries for a library/binary to use the import
library instead of the DLL.  As a side-effect, this also (correctly)
uses the AdbWinApi.a that's alongside
development/host/windows/prebuilt/usb/AdbWinApi.dll

Test: Run Windows tests (go/android-llvm-windows-testing) and check
absence of regressions.

Change-Id: I15a178589aa6882caa6e7e38650cc6ef48109764
2019-03-20 21:07:47 +00:00
Peter Collingbourne
967511a4e8 Pass -hwasan-allow-ifunc when building with hwasan.
Now that the toolchain and bionic both support ifuncs in
static executables, we can turn this on. Reduces size of
walleye_hwasan-userdebug system.img by 11MB.

Change-Id: I2f19b22518153328eee3fdca79d0c851cc513c3a
2019-03-20 19:42:42 +00:00
Colin Cross
a4ad2b0921 Export genrules to Make as phony packages
Export genrules to Make, which will allow it to support
dist-for-goals.

Test: m PRODUCT-sdk_phone_armv7-win_sdk sdk_repo dist
Bug: 80494441
Bug: 128878015
Change-Id: Idb8dfcec2be5bfab94d17395826ef451b0dd9b63
2019-03-20 19:37:58 +00:00
Colin Cross
8a49795df1 Replace ctx.ExpandSources with android.PathsForModuleSrc
Move the logic from ctx.ExpandSources into android.PathsForModuleSrc
and ctx.ExpandSource into android.PathForModuleSrc, and deprecate
them.  When combined with the pathDepsMutator this will let all
properties that take source paths also take filegroups or genrule
outputs, as long as they are tagged with `android:"path"`.

Test: All soong tests
Change-Id: I01625e76b5da19240e9649bf26a014eeeafcab8f
2019-03-20 19:36:13 +00:00