Commit graph

40 commits

Author SHA1 Message Date
Anton Hansson
cb8276fa93 Put DEVICE/PRODUCT overlays in different partitions
This change changes auto-generated RROs from DEVICE_PACKAGE_OVERLAYS
to be generated in the vendor partition, as opposed to /product where
they were generated in the past.

Note that PRODUCT_PACKAGE_OVERLAYS continue generating RRO packages
to /product, which means that a single app can be overlayed from
different partitions. These RROs have been given module and package
names based on their location.

Bug: 127758779
Test: verify noop on presubmit targets
Change-Id: I5cee70e28e3969e67b2d83eaf25d9c6e3a11102d
2019-03-22 13:25:20 +00:00
Anton Hansson
dc017122fb Read product/device RRO dirs separately from soong
This change splits the LOCAL_SOONG_RRO_DIRS into two,
representing RRO dirs that originated from device and
product overlay configs, respectively.

Also plumb the device/product configs in separately.

Bug: 127758779
Test: verify noop on presubmit targets
Change-Id: Iddee1b4d7303b7ecaeced91216ea82fe29123770
2019-03-18 19:39:51 +00:00
Luca Stefani
fb3e985a5f Remove extra $ in soong_app_prebuilt
Change-Id: Ia21d8f7fb3fd5f9e3b8e764d42ebbc61be4226f7
2019-02-06 17:54:21 +01:00
Treehugger Robot
61ae763ec4 Merge "Remove dependencies on hiddenapi files with UNSAFE_DISABLE_HIDDENAPI_FLAGS=true" 2019-01-31 19:25:59 +00:00
Anton Hansson
bb83cc2689 Merge "Fix RRO when LOCAL_EXPORT_PACKAGE_RESOURCES is unset" 2019-01-30 22:19:25 +00:00
Treehugger Robot
badde7ced7 Merge changes I0bee792d,I2b7c3c8f
* changes:
  Build aar files for m <module name>
  Add LOCAL_ADDITIONAL_CHECKED_MODULE
2019-01-30 18:26:24 +00:00
Colin Cross
89d3d2ae3b Fix RRO when LOCAL_EXPORT_PACKAGE_RESOURCES is unset
If LOCAL_EXPORT_PACKAGE_RESOURCES is unset then
append_enforce_rro_sources was inserting a blank entry into
the 4th.  When converting the || separator back to space that
resulted in a two sequential spaces, which is treated as a
single word separator, causing the 5th field to be treated
as the 4th field.

Put "false" into the 4th field in soong_app_prebuilt.mk to match
package_internal.mk.

Bug: 123510624
Test: m SystemUIGoogle
Change-Id: I794c413e33df2020d0dc43379cfb017e7e09baa1
2019-01-30 16:09:41 +00:00
Colin Cross
cd6622e832 Build soong odex files for mma
Add the LOCAL_SOONG_BUILD_INSTALLED files as dependencies of
$(my_all_targets) instead of $(my_register_name) so they are built
for mma and mmma as well as m <module name>.

Fixes: 123262430
Test: mmma packages/apps/Gallery2
Change-Id: I0d55beccf9385144c190ea4bf099fb267ac6db1c
2019-01-30 00:35:34 +00:00
Colin Cross
bd2287b846 Build aar files for m <module name>
Test: m SystemUI-core
Change-Id: I0bee792d1af80abb3e74c278db488bd668bd1fb4
2019-01-29 15:12:17 -08:00
Adrian Roos
21028b7ad6 Remove dependencies on hiddenapi files with UNSAFE_DISABLE_HIDDENAPI_FLAGS=true
Fixes: 122957987
Test: UNSAFE_DISABLE_HIDDENAPI_FLAGS=true make droid
Change-Id: Iafef8cc69971fd10718882326fbba99a6223d0f8
2019-01-25 17:35:25 +01:00
Jeongik Cha
83c50324ca Define non-system module as variable
Define non_system_module in base_rules.mk when the module is product, vendor,
product_services or proprietary module.

Bug: 74699609

Test: m -j
Change-Id: Iebdd3ec8c643be3d9877b7a96cbdd83465fa3878
2019-01-18 18:24:30 +09:00
Colin Cross
83b7bdf765 Simplify soong_java_prebuilt.mk and soong_app_prebuilt.mk
Simplify importing Soong modules into Make by always copying
LOCAL_PREBUILT_MODULE_FILE to LOCAL_BUILT_MODULE, which lets
Soong pick the final output file instead of trying to figure
out which of the various intermediate files should be the
output file.

Also fixes an issue where hostdex modules could attempt to
copy to both $(common_javalib.jar) and $(LOCAL_BUILT_MODULE),
which are the same file for host java modules.

Test: set compile_dex:true on core.platform.api.stubs. no warnings
      of target overriding
Test: m checkbuild

Change-Id: I2e089012436fe8649db82a673d446d1c5a73a731
2019-01-17 10:23:06 -08:00
Jeongik Cha
f712ce79f5 Execute appcompat for apps built from soong
Appcompat runs for app defined in Android.mk, but not in Android.bp
So make appcompat run for app from soong(Android.bp)

Bug: 110073830
Bug: 122026042

Test: m out/target/product/$(get_build_var TARGET_DEVICE)/appcompat.zip

Change-Id: I73832410ec5850222b04086c2a377146886ba035
2019-01-16 14:27:21 +09:00
Colin Cross
5d196364e1 Revert "Simplify soong_java_prebuilt.mk and soong_app_prebuilt.mk"
This reverts commit a76cc6d732.

Reason for revert: broke emma turbine build

Change-Id: Ie894565501d0de44f96dc736408a8c4e2ba2ed90
2019-01-16 01:38:41 +00:00
Colin Cross
a76cc6d732 Simplify soong_java_prebuilt.mk and soong_app_prebuilt.mk
Simplify importing Soong modules into Make by always copying
LOCAL_PREBUILT_MODULE_FILE to LOCAL_BUILT_MODULE, which lets
Soong pick the final output file instead of trying to figure
out which of the various intermediate files should be the
output file.

Also fixes an issue where hostdex modules could attempt to
copy to both $(common_javalib.jar) and $(LOCAL_BUILT_MODULE),
which are the same file for host java modules.

Test: set compile_dex:true on core.platform.api.stubs. no warnings
      of target overriding
Test: m checkbuild

Change-Id: Id84d499a0869961be5a906d8472b75b9c843b4b4
2019-01-15 10:16:55 -08:00
Jeongik Cha
b2c4bb7e3d Dump and enforce certificate for apks
Dump the list of APKs that aren't located at system partition and signed
with system certificate.
And when enforcement option is enabled, it makes build error if there is
the apk that satisfies the condition above.

Bug: 74699609

Test: m -j
Test: m out/target/product/$(get_build_var TARGET_DEVICE)/certificate_violation_modules.txt

Change-Id: I23c41f2665dd97abac3e77d1c82d81ff91b894eb
2019-01-10 11:37:22 +09:00
Colin Cross
6db5b0ea9a Move dexpreopting to Soong
Move the dexpreopting logic into Soong.  Make modules will be
dexpreopted by executing the Soong logic in the standalone
dexpreopt_gen binary, which will generate scripts that will
perform dexpreopting for each module.  Export global configuration
as JSON to $OUT/dexpreopt.config, which will be used by
dexpreopt_gen and Soong, and per-module JSON configuration that
will be used by dexpreopt_gen.

This relands I59b20c931ee3e5a8d35eb30da4148691c5095502,
I39d580999947ee54cfefe875b57a028be5333bd7,
Ie7daa94e107d53eff075ca58dbe721bd9d7fc8c2 and
Ica006a007d112c232311435aaac0c0e476232b67, with a minor
update to match the changes made to dexpreopt_gen arguments
and a fix to correctly keep dexpreopt disabled on mac builds.

Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
      only expected changes to dexpreopt outputs on system_other
      (.vdex files for privileged Soong modules no longer incorrectly
      contain .dex contents).
Change-Id: I25163e91886cea6941afa25cdb529ed053278dcb
2018-12-17 13:46:17 -08:00
Colin Cross
b8901d7fb8 Revert "Move dexpreopting to Soong"
This reverts commit e736c58043.

Test: none
Bug: 119412419
2018-12-14 11:49:55 -08:00
Colin Cross
e736c58043 Move dexpreopting to Soong
Move the dexpreopting logic into Soong.  Make modules will be
dexpreopted by executing the Soong logic in the standalone
dexpreopt_gen binary, which will generate scripts that will
perform dexpreopting for each module.  Export global configuration
as JSON to $OUT/dexpreopt.config, which will be used by
dexpreopt_gen and Soong, and per-module JSON configuration that
will be used by dexpreopt_gen.

Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
      only expected changes to dexpreopt outputs on system_other
      (.vdex files for privileged Soong modules no longer incorrectly
      contain .dex contents).
Change-Id: I59b20c931ee3e5a8d35eb30da4148691c5095502
2018-12-12 17:21:22 -08:00
Nicolas Geoffray
ed167cf814 Factor out common code.
Test: m
Change-Id: If718c281656a890fb5eba54eb290976c153e2bb6
2018-12-07 14:35:52 +00:00
Nicolas Geoffray
d80f9c0d32 Use the final APK for dexpreopt when it's not stripped.
The final APK may contain compressed or uncompressed dex files,
and this affects dex2oat compilation.

Test: build sailfish, test that SystemUI.vdex and Settings.vdex
don't have the dex code.

Change-Id: Ic032f61ed67dcdf342f6eaef71d805b89d6fc99a
2018-12-07 00:19:57 +00:00
Colin Cross
0fb8c97b02 Dist bundle modules from Soong
Dist bundle modules when requested by TARGET_BUILD_APPS.

Bug: 117295826
Test: tapas RecoveryLocalizer && m dist
Change-Id: Iad63ceafc2a60e6735b50eca65cc4859f9d71b52
2018-10-30 15:47:59 -07:00
Colin Cross
fc782ad949 Reduce the propagation of LOCAL_DEX_PREOPT := nostripping
nostripping causes confusing double negatives, allow nostripping
in LOCAL_DEX_PREOPT and DEFAULT_DEX_PREOPT, but convert to
LOCAL_STRIP_DEX outside of dex_preopt_odex_install.mk.

Test: m checkbuild
Change-Id: I996e9258ce20c394900d9fe937d638bc2ab8589d
2018-10-23 22:33:07 -07:00
Colin Cross
0fa751ba68 Add support for JNI libraries to soong_app_prebuilt.mk
Use install_jni_libs_internal.mk to install JNI libraries alongside
preinstalled APKs.  APKs with embedded JNI libraries are handled
within Soong.

Bug: 80095087
Test: m checkbuild
Change-Id: I2ecf10b6771dff14c940cc6e6442eb2ae43a75b0
2018-10-04 11:24:15 -07:00
Colin Cross
53c8f9789a Fix PDK builds
$OUT/obj/APPS/SystemUI_intermediates/package.dex.apk was not being
written after being converted to Soong.  Add a copy rule for it
to soong_app_prebuilt.mk, add it as an implicit output to the Make
rules that create it, and add it as a real dependency to the
platform.zip rules.

Test: m platform
Change-Id: I96f58d3d80b764a51a6acb87e92498589cfe5c18
2018-09-29 22:33:41 -07:00
Colin Cross
1fe104cc13 Fix preopting Soong apps
dex_preopt_odex_install.mk should always be included, it handles
setting a default value for LOCAL_DEX_PREOPT.
Use dexpreopt-copy-jar when preopting to strip the dex file if
necessary.

Bug: 115967961
Test: m SystemUI
Change-Id: I74f77ed0e88a67043836407261f3845a16cbaf37
2018-09-18 10:16:37 -07:00
Colin Cross
7a504334cd Fix java soong_to_convert data
soong_to_convert looks for modules with no unconverted deps, but
the list of converted modules was not being updated for java and
app prebuilts.  That meant soong_to_convert only reported modules
with no deps at all.

Test: examine soong_to_convert.txt
Change-Id: I136e6fa74153a80df5ecd767642bb2feb2ddb9dc
2018-08-16 22:55:43 -07:00
Jason Monk
87eb791c4f Adding overrides support to android_app bps
Test: build
Change-Id: I7910d042c6e7f8ac9c77e294aca11b01713d0fef
2018-08-10 13:38:57 -04:00
Treehugger Robot
0b4b321565 Merge "Remove unnecessary link-type check" 2018-03-09 00:21:21 +00:00
Jiyong Park
98a4f52c28 Remove unnecessary link-type check
Modules from Soong do not have dependency specified (via
LOCAL_JAVA_LIBRARIES). So, link-type check 'from' them doesn't make
sense. Resetting my_warn_types and my_allowed_types

Bug: 69899800
Test: m -j checkbuild on aosp_walleye, aosp_sailfish
Test: build/soong/build_test.bash --dist
Change-Id: I2a409e64f388bd8cb9336be589bf6af33e48a6f4
2018-03-08 15:23:08 +09:00
Colin Cross
7874138a8a Allow soong java libraries to include exported resources and proguard flags
Test: m checkbuild
Change-Id: Ia02f816084d0eb1c0e0f20e1ecd57aaf3778874c
2018-03-07 09:48:33 -08:00
Nan Zhang
78c19aa9ef Fix the incorrect turbine flag.
Test: m -j java TURBINE_ENABLED=false
Change-Id: Id6ca380c97bbcd3731c815e37513b7e949cccdfb
2018-03-05 13:35:45 -08:00
Jiyong Park
5ebca30d21 Support LOCAL_SDK_VERSION := core_current
core_current is a pseudo SDK version which is a core Java API subset of
the Android API. It is expected to be mainly used for external Java
projects which are agnostic to Android; such as junit, guava, etc.

A module built with this SDK version can only link to java modules of
the same kind. It can't depend on modules built with LOCAL_SDK_VERSION
:= current or without LOCAL_SDK_VERSION.

Bug: 72206056
Test: m -j
Change-Id: I34a9696393aa6704fd6684a40ea5b05d3fb46b23
2018-02-01 17:14:55 +09:00
Colin Cross
5e0986cb51 Add R8 support to Soong.
Move R8_COMPAT_PROGUARD definition to Soong.
Copy the proguard_dictionary file so that the find
command that builds proguard_dict.zip can find it.

Test: m checkbuild
Change-Id: I28b2fce26ccb6225be0bd71802a43fe63df85daa
2018-01-03 14:21:35 -08:00
Colin Cross
20e06d25ac Fix dependency on Soong jacoco report classes
The dependency on the Soong jacoco report classes was mistakenly
using $(common_javalib.jar) which was never set, so was using
the value from the last module.  Use $(LOCAL_BUILT_MODULE)
instead.

Test: m checkbuild
Change-Id: If502d67f9e5e0c107de44e96cbf232406c027e44
2018-01-03 14:21:35 -08:00
Colin Cross
4e34ce054c Fix swapped certificate and private key in soong apps
The .x509.pem file should be in CERTIFICATE, and the .pk8 file
in PRIVATE_KEY.

Bug: 70669383
Test: examine apkcerts.txt
Change-Id: I480f19be2efbbd72ea23ebd681f312b94accfd7a
2017-12-15 13:41:24 -08:00
Colin Cross
75a698b394 Export app implementation and header jars
Also fix a missing dependency on the jacoco-report-classes.jar

Test: m checkbuild
Change-Id: I67e924051e1029a409b82f2220811a27d5401db9
2017-12-15 13:41:24 -08:00
Colin Cross
aec3640560 Add Soong modules to apkcerts
Bug: 70669383
Test: m apkcerts-list contains framework-res
Change-Id: I00c5c5d9e7311bbe4f16bf48407dd0efa242c7aa
2017-12-14 12:29:30 -08:00
Colin Cross
8c5ef24107 Add support for RRO in soong app prebuilts
Let soong pass overlay directories that were not used because
of enforced RROs and use the make rules to convert them to
the auto generated RRO package.

Bug: 69917341
Test: m checkbuild
Change-Id: I9db37e0bf65c19cef91428477713e3d7f1941b83
2017-11-30 20:22:12 -08:00
Colin Cross
e05e6df136 Add support for app prebuilts from soong
Allow soong to pass a built app to Make as a prebuilt .apk.

Bug: 69917341
Test: m checkbuild tests docs
Change-Id: I49dbe4c51c5b9f48fb82cb05b8eed7e3fe9fd4f6
2017-11-29 20:46:18 -08:00