Commit Graph

17171 Commits

Author SHA1 Message Date
Paul Duffin
a253492d2d Merge "Added module_exports/_snapshot as alias for sdk/_snapshot"
am: 28aa544884

Change-Id: If32c3aabcde471ea71acb50633142a8174ff10f8
2019-12-31 07:02:20 -08:00
Paul Duffin
28aa544884 Merge "Added module_exports/_snapshot as alias for sdk/_snapshot" 2019-12-31 14:59:19 +00:00
bralee
3f4ed419b6 Merge "AIDEGen: collect cc_srcs and cc related flags in module_bp_cc_deps.json"
am: 0a6c8813ba

Change-Id: If96c0e5e9e2f72b9b6f3ac5ec50be5328aa68c48
2019-12-30 17:20:09 -08:00
Treehugger Robot
0a6c8813ba Merge "AIDEGen: collect cc_srcs and cc related flags in module_bp_cc_deps.json" 2019-12-31 01:16:35 +00:00
Kiyoung Kim
1290b12a30 Merge "Detach VNDK using core library list from VNDK APEX"
am: 2c12207919

Change-Id: I0e81c889999c903baa780b235e7c6d2ca80de164
2019-12-30 17:04:23 -08:00
Kiyoung Kim
2c12207919 Merge "Detach VNDK using core library list from VNDK APEX" 2019-12-31 00:55:46 +00:00
Paul Duffin
8150da6e9d Added module_exports/_snapshot as alias for sdk/_snapshot
Bug: 146341462
Test: m nothing
Change-Id: I27e1ef494a2b0874074aa43614612189b17e7860
2019-12-30 18:03:30 +00:00
Kiyoung Kim
e1aa8ea34e Detach VNDK using core library list from VNDK APEX
Some devices require VNDK using core library list, but this is dependent
to system image rather than VNDK version. This change removes VNDK using
core variant library list file from VNDK APEX, and also remove VNDK
version from its filename.

Bug: 142599349
Test: m -j passed && aosp_cf_x86_go_phone booted
Change-Id: Ibc53b8dfc9d38e14bbaa878154034d25a6d34089
2019-12-30 14:29:52 +09:00
bralee
5a5cce695f AIDEGen: collect cc_srcs and cc related flags in module_bp_cc_deps.json
Define a field CCSrcs and other cc related flags in a type ccIdeInfo
struct and write them into out/soong/module_bp_cc_deps.json. AIDEGen
can use these data to generate CMakeLists.txt by Python for multiple
native projects in CLion IDE.

Bug: 141512319

Test: 1. export SOONG_COLLECT_JAVA_DEPS=false SOONG_COLLECT_CC_DEPS=true;m nothing
         check
	 1). File out/soong/module_bp_cc_deps.json is generated.
	 2). In "JniInvocation_test" module: "path", "srcs",
	     "global_common_flags", "local_common_flags",
	     "global_c_flags", "local_c_flags", "global_c_conly_flags",
	     "local_c_conly_flags", "global_cpp_flags",
	     "local_cpp_flags" and "system_include_flags"
	     have been created.

Change-Id: I9292cc6373157ba68f013998a7364f84a70d5593
2019-12-30 09:35:40 +08:00
Jiyong Park
b184044c23 Merge "Create APEX variation only when needed"
am: e9391f8bab

Change-Id: I45435d7a387d3d889395ba356678c59f08d238f2
2019-12-27 21:01:43 -08:00
Treehugger Robot
e9391f8bab Merge "Create APEX variation only when needed" 2019-12-28 04:18:59 +00:00
Jooyung Han
0fcd3e1e59 Merge "Dedup generating xml file for java_sdk_library"
am: 380f85edd3

Change-Id: Ic5f7a00c38c9c295d0fa4512020f0ece9689bc57
2019-12-27 15:29:14 -08:00
Jooyung Han
380f85edd3 Merge "Dedup generating xml file for java_sdk_library" 2019-12-27 23:26:41 +00:00
Dan Willemsen
eb54fe9e99 Take into account RAM usage for multiproduct_kati
am: 1bdbdec5a0

Change-Id: Icc354b4945ff41b3daea5061df75c506e2a1307c
2019-12-27 14:00:57 -08:00
Dan Willemsen
99a37805a6 Add TotalRAM detection
am: 2bb82d0011

Change-Id: Ibcbeda2ca3e787458fc7e2c80c9a149e1e94755f
2019-12-27 14:00:54 -08:00
Dan Willemsen
1bdbdec5a0 Take into account RAM usage for multiproduct_kati
Apparently we have some instances of Soong taking 16GB of RAM. While
that's a problem to solve on it's own, make multiproduct_kati's
auto-parallelism detection smarter by taking into account the total RAM
on the machine instead of just the number of CPUs.

Bug: 146925549
Test: check soong.log for autodetected parallelism values
Change-Id: Ice34c2cf73ea4f8f235521cbefc8654a79a04eef
2019-12-27 09:54:11 -08:00
Dan Willemsen
2bb82d0011 Add TotalRAM detection
Colin originally wrote this for the highmem pool:

https://android-review.googlesource.com/c/platform/build/soong/+/1168271

But while that's a larger change, this is useful to just be in the logs,
and for use in multiproduct_kati to better limit the number of
concurrent jobs.

Test: check soong.log on linux and mac
Change-Id: I0518d303a220d775f8d78dba9f660b2954e68e3e
2019-12-27 09:43:49 -08:00
Jiyong Park
3ff1699683 Create APEX variation only when needed
Create an APEX variation of a module only when it is either directly
included in an APEX or the dependency to the module demands that the
module should be included. For example, a non-static dependency to a
java library no longer creates an APEX variant of the library.

Bug: 146907857
Test: m (apex_test amended)
Test: cat out/soong/build.ninja | grep "Module:" | wc -l
reduced from 47132 to 45881

Change-Id: Icd79fb4b60668d852b9f018343b934b5e42a8eda
2019-12-27 14:11:47 +09:00
Kiyoung Kim
92675f2575 Merge "Move compat symlinks from makefile to soong"
am: fb1e5fbf13

Change-Id: Id072b8826ea97eb2c81bd83a084e4b7ad5b1f8b5
2019-12-26 16:11:03 -08:00
Kiyoung Kim
fb1e5fbf13 Merge "Move compat symlinks from makefile to soong" 2019-12-27 00:08:06 +00:00
Jooyung Han
624058e6a5 Dedup generating xml file for java_sdk_library
Permission XML file for java_sdk_library is generated by
java_sdk_library itself now.

And, build rule is switched to android.WriteFile since "echo -e" is
not supported from build server. (-e is printed to output)

Bug: 145474221
Test: m com.android.cronet and check its permissions xml file
     also, m org.chromium.net.cronet.xml (created dynamically)
Change-Id: Iffb119151c49bc4fe6c4386fa267cca193f37dbc
2019-12-26 12:20:24 +00:00
Jooyung Han
4791cb507b Move compat symlinks from makefile to soong
Two APEXes (i18n, art) requires compat symlinks and these symlinks are
created via ld.config.txt module's POST_INSTALL_CMDS.

  $ m installclean
  $ m ld.config.txt
  $ tree $OUT/system

.../system
├── bin
│   ├── dalvikvm -> /apex/com.android.art/bin/dalvikvm
│   └── dex2oat -> /apex/com.android.art/bin/dex2oat
├── etc
│   └── ld.config.txt
└── usr
    └── icu -> /apex/com.android.i18n/etc/icu

By the way, ld.config.txt is going to removed since linkerconfig
generates it on device.

So, we're moving symlink creation from ld.config.txt(rootdir/Android.mk)
to APEXes' POST_INSTALL_CMDS.

  $ m installclean
  $ m com.android.i18n
  $ tree $OUT/system

.../system
├── apex
│   └── com.android.i18n.apex
└── usr
    └── icu -> /apex/com.android.i18n/etc/icu

  $ m installclean
  $ m com.android.art
  $ tree $OUT/system

.../system
├── apex
│   └── com.android.art.debug.apex
├── bin
│   ├── dalvikvm -> /apex/com.android.art/bin/dalvikvm
│   └── dex2oat -> /apex/com.android.art/bin/dex2oat

Bug: 143192278
Test: m && boot (since these two apexes are bootstrap apexes)
Change-Id: Ib29ea9f9ac40e74f78cd530e7daef8c51292fd24
2019-12-24 14:00:47 +09:00
Sasha Smundak
df8525511d Merge "Run extractor for Go files in build/soong directory"
am: 29d1336d11

Change-Id: Ibaba50e5de96beab3a16661a061e2b1132f538da
2019-12-23 13:01:22 -08:00
Treehugger Robot
29d1336d11 Merge "Run extractor for Go files in build/soong directory" 2019-12-23 20:55:25 +00:00
Sasha Smundak
ca54088aa8 Run extractor for Go files in build/soong directory
Bug: 137798757
Test: run cd build/soong &&  ../../prebuilts/build-tools/linux-x86/bin/go_extractor --goroot=$PWD/../../prebuilts/go/linux-x86 --rules=vnames.go.json --canonicalize_package_corpus --output $OUT_DIR/soong/golang.kzip ./...
Change-Id: Ib1edde4bf36e6b0683f49da0986f243690c81d6b
2019-12-23 11:34:15 -08:00
Paul Duffin
954e23e3e0 Merge "Generate .srcjar for prebuilt_stubs_sources"
am: e2bc36f12c

Change-Id: I68f148323e7d6ad9e7b6cfac89aed4064eab4d82
2019-12-23 05:34:43 -08:00
Paul Duffin
e2bc36f12c Merge "Generate .srcjar for prebuilt_stubs_sources" 2019-12-23 13:32:08 +00:00
Jooyung Han
6b8d4061e5 Merge "apex: drop java_import support"
am: 97e7279cc6

Change-Id: Ifadea8cfb6ff46d1a918da0aa53efe27f83463fa
2019-12-23 01:17:05 -08:00
Jooyung Han
97e7279cc6 Merge "apex: drop java_import support" 2019-12-23 09:14:32 +00:00
Jooyung Han
5a80d9f352 apex: drop java_import support
java_import doesn't support dex jar which is necessary to be packaged in
an APEX. Supporting this would require non-trivial work. By the way
java_import is not used and there is a workaround.(defining java_library
and static-linking with it)

We drop the support for `java_import` in APEX.

Bug: 139175488
Test: m (soong tests amended)
Change-Id: I924386571079090c701276d87f665ce7fbb6f074
2019-12-23 06:46:39 +00:00
Jiyong Park
cfc3ae2c4f android_*_stubs_current modules are moved to frameworks/base
am: d061df9ef3

Change-Id: I0d84d557e4d6c6dc0423045182f0e3e0c2bb142a
2019-12-22 22:02:04 -08:00
Jiyong Park
d061df9ef3 android_*_stubs_current modules are moved to frameworks/base
The modules were moved from developement/build to frameworks/base.
In addition, they no longer uses 'sdk_version:"none"'. Reflect that
change here.

Bug: N/A
Test: m

Exempt-From-Owner-Approval: cherry-pick from internal

Merged-In: I6f69f7cb64a6ed3c2032a116500436eabe562dca
(cherry picked from commit 12cc126760)
Change-Id: I6f69f7cb64a6ed3c2032a116500436eabe562dca
2019-12-22 17:20:27 +09:00
Dario Freni
c34c944dde Merge "Add support for java_test_helper_app."
am: 7e143af6ee

Change-Id: I87bad904852b857c5a9815b901e3b7af2f427e1e
2019-12-21 22:01:49 -08:00
Treehugger Robot
7e143af6ee Merge "Add support for java_test_helper_app." 2019-12-22 05:21:37 +00:00
Dario Freni
6f3937cb29 Add support for java_test_helper_app.
Bug: 142712057
Bug: 138429615
Test: apex_test passes, tried building an apex with a test app.
Change-Id: Ib75bd48042d8b1fe102038bef08cd1be708e996d
2019-12-21 08:50:12 +00:00
Justin Yun
31bfaff20f Merge "Create product variant for product partition"
am: 727173ecca

Change-Id: I57409c3e10d2b8e71044c3bcd253b7f82e0b6f8d
2019-12-20 17:03:32 -08:00
Treehugger Robot
727173ecca Merge "Create product variant for product partition" 2019-12-21 00:56:45 +00:00
Jaewoong Jung
e324318356 Merge "Make apex.overrides overridable by override_apex."
am: dcee89cad6

Change-Id: I8ac45a54210f96ba284fabb8fd9e2b9b3f80e2a1
2019-12-20 10:23:41 -08:00
Jaewoong Jung
dcee89cad6 Merge "Make apex.overrides overridable by override_apex." 2019-12-20 18:20:50 +00:00
Paul Duffin
62e6e00395 Differentiate between cc library and binary
am: a0843f6a6f

Change-Id: Ice0841306ddc758f815804d0d243b112b6d8a941
2019-12-20 10:01:53 -08:00
Paul Duffin
8b5ff4cabc Dedup cc library module type registration
am: 6c26dc7392

Change-Id: I511947ce7bd4648f5e51143f97b92c3ad8f69371
2019-12-20 10:01:51 -08:00
Paul Duffin
a0843f6a6f Differentiate between cc library and binary
The cc library and cc binary (and other cc module types) are all
instances of cc.Module. So, to differentiate between them and make
sure that only appropriate library instances can be added to
native_shared/static_libs this adds a special sdkMemberTypes field to
Module which if set specifies the SdkMemberTypes the module supports.
If it is not set then the module type cannot be used in the sdk at all.

Corrects an issue with one of the tests where a prebuilt cc
library was added to the sdk instead of a source cc library.

Adds a new test to ensure that cc_library_(shared|static)_host module
types work with the sdk as well and another test to ensure that
cc_library can be used as either.

Bug: 142918168
Test: m checkbuild
Change-Id: I359cdbdd15328ca571f276d2b6ce9a229ebb2c86
2019-12-20 15:45:17 +00:00
Paul Duffin
6c26dc7392 Dedup cc library module type registration
Test: m checkbuild
Bug: 146540677
Change-Id: I6685338550f587212e70f3eba8d4342b66f566e2
2019-12-20 15:22:52 +00:00
Martin Stjernholm
822d8655e5 Merge "Add script for building all target arch's needed in AML (Android Mainline) prebuilts."
am: d732beed90

Change-Id: I8db902bebf471f6268319b4bb4706580f555c8a0
2019-12-20 04:01:52 -08:00
Martin Stjernholm
d732beed90 Merge "Add script for building all target arch's needed in AML (Android Mainline) prebuilts." 2019-12-20 11:53:33 +00:00
Martin Stjernholm
c1ecc43aec Add script for building all target arch's needed in AML (Android Mainline)
prebuilts.

This runs Soong in skip-make mode, using normal in-make mode only to query
platform versions.

The same ${OUT_DIR} cannot be used for both skip-make and in-make builds,
because Soong generates a smaller build.ninja file in in-make builds where
many build targets are expected to be provided by the mk files. Thus this
script avoids using ${OUT_DIR} if it's an in-make build, defaulting instead
to out-aml/.

The script is based on build-ndk-prebuilts.sh, but uses a separate Soong
variable Aml_abis to enable the appropriate target architectures for
Mainline modules. Aml_abis is very similar to Ndk_abis, except "armeabi-v7a"
is used instead of "armeabi", which is necessary to match prebuilt
dependencies, e.g. for LLVM.

Test: build/soong/scripts/build-aml-prebuilts.sh libart libdexfile_external
  (verify that libraries for arm, arm64, x86, x86_64 are built)
Test: build/soong/scripts/build-aml-prebuilts.sh \
  out-aml/soong/.intermediates/external/conscrypt/conscrypt-module-sdk/android_common/conscrypt-module-sdk-current.zip
  (verify that the zip file contains libconscrypt_jni.so's for all four arches)
Test: build/soong/scripts/build-aml-prebuilts.sh com.android.art.{release,debug,testing,host}
  (verify that the build completes)
Test: Two identical build/soong/scripts/build-aml-prebuilts.sh runs after each other
  (verify that the 2nd run completes both Soong and ninja steps quickly without any building)
Change-Id: I35712f9f8f0b1cbb77107314c5927c6720e6c3bf
2019-12-20 11:53:21 +00:00
Mathew Inwood
8f7dd2e8f3 Merge "Update build rule for updated script."
am: 431b8a2fdd

Change-Id: Ib77141e5c548133b80382250ef01abbec710172a
2019-12-20 01:36:09 -08:00
Mathew Inwood
431b8a2fdd Merge "Update build rule for updated script." 2019-12-20 09:33:42 +00:00
Justin Yun
5f7f7e8a39 Create product variant for product partition
When PRODUCT_PRODUCT_VNDK_VERSION is set to 'current', product
modules are enforced to use only VNDK libs from the system partition
as BOARD_VNDK_VERSION does to vendor partition.

Modules with 'vendor_available: true' create product variant as well
as core and vendor variants. The product variant as an image variant
is used for the modules in /product or /system/product.

It must not affect the current build behavior without
PRODUCT_PRODUCT_VNDK_VERSION set.

Bug: 134099726
Bug: 138966004
Bug: 144534640
Test: build without PRODUCT_PRODUCT_VNDK_VERSION set
Change-Id: I4d3585c110d84493e45bf76d550dc240bb26137f
2019-12-20 17:56:08 +09:00
Paul Duffin
9b478b0831 Generate .srcjar for prebuilt_stubs_sources
Changes prebuilt_stubs_sources to generate a .srcjar from its input
instead of just exposing the srcs it is given. This ensures that it can
be used as a drop in replacement for a droidstubs module.

Updates the test for prebuilt_stubs_sources to be more representative
of the actual use made of it by sdk snapshot which outputs a directory
not a glob pattern. Added some documentation of the
prebuilts_stubs_sources srcs property to make it clear that it is
supposed to be a set of directories.

Extracts common code from sdk/testing.go for normalizing path/paths
for testing.

Bug: 143678475
Test: m conscrypt-module-sdk conscrypt-module-host-sdk conscrypt-module-test-sdk
      unzip those in place of external/conscrypt
	  build core-current-stubs-source which expects it to provide a .srcjar.
Change-Id: I8204a022557a9b0b45e19eac79ecba98ff95213d
2019-12-20 08:13:45 +00:00