Commit graph

14283 commits

Author SHA1 Message Date
Dan Willemsen
bb6393c5a4 Add LOCAL_AAPT2_ONLY
This allows modules to specify that they may only be used from modules
using aapt2. Using aapt2 removes absolute path references to modules, so
this can be useful if a module is preparing to move its sources, or
replace itself with a prebuilt aar.

Test: m
Test: Label frameworks/support/design; m
Test: Label frameworks/support/v4; m
Test: build/soong/build_test.bash
Change-Id: Icfb3d4b19a6a0e3a3bb00091d2a97a4d88c0c761
2017-11-17 15:54:15 -08:00
Colin Cross
f1f66974c6 Merge changes from topics "soong_logtags", "droiddoc_srcjars"
* changes:
  Allow converting logtags to java without merged logtags file
  Add support for srcjars to droiddoc
2017-11-17 21:32:27 +00:00
Tobias Thierer
7ef760b832 Tweak comments for OpenJDK 9 build toolchain logic.
This addresses review comments on the preceding CL
http://r.android.com/539055

Test: Treehugger
Change-Id: Icb0674190db3d638546a0ed49dbcb97d0698e549
2017-11-17 15:35:59 +00:00
Tobias Thierer
f6bd495728 Break EXPERIMENTAL_USE_OPENJDK9 into {USE,TARGET}_OPENJDK9.
This CL topic breaks the single flag value EXPERIMENTAL_USE_OPENJDK9
into two flags USE_OPENJDK9 and TARGET_OPENJDK9 which are computed
independently in config.mk and config.go; this means that later
build logic no longer depends on / duplicates the semantics of an
unset EXPERIMENTAL_USE_OPENJDK9, because that later build logic
can use USE_OPENJDK9 and TARGET_OPENJDK9 instead. Thus, it becomes
slightly easier to change this default in future CLs (touching
only config.mk and config.go).

It also makes it more straightforward to convert .mk files
to .bp.

This CL also introduces a new allowed value "false" for
EXPERIMENTAL_USE_OPENJDK9. This fourth possible value currently
has the same semantics as a default/unset
EXPERIMENTAL_USE_OPENJDK9, but allows people to explicitly
switch back to the old semantics when the default changes.

Test: make showcommands core-oj (in environments with
      EXPERIMENTAL_USE_OPENJDK9 set to "", "1.8", and "true").
Bug: 38177295

Change-Id: Iaade9610b237722e5d175143808b8653b1e98996
2017-11-17 13:14:11 +00:00
Alan Leung
7d6144d34b Rename r8 to r8-compat-proguard
Test: USE_R8=false USE_D8=true m -j32 && USE_R8=true USE_D8=true m -j32

Change-Id: I2610340cf75f8db5920e33fac542f0dcf294ce29
2017-11-16 17:24:01 -08:00
Colin Cross
e89df93231 Add support for srcjars to droiddoc
Soong generates the R.java for framework-res.apk to a srcjar.
Droiddoc will need to consume them, so add support to the droiddoc
rules for extracting sources from a srcjar.

Test: m checkbuild
Change-Id: I064889c9063b642835d9f668e2568b61d0fabe35
2017-11-16 14:58:05 -08:00
Dan Willemsen
d927abe8a8 Clear some aapt2.mk inputs after use
my_generated_res_dirs wasn't being reset in some cases in between
different modules. To be safe, clear every input variable that I was sure
was not being used by the caller after aapt2.mk.

Test: m
Test: m ANDROID_BUILDSPEC=vendor/google/build/app_build_spec.mk
Change-Id: I37c861d99637cad77a2a378a119bf66cee373b3a
2017-11-15 17:00:46 -08:00
Tomasz Wasilczyk
4dbdb60698 Merge "Silence superfluous build messages." 2017-11-15 22:27:30 +00:00
Treehugger Robot
288521a615 Merge "Silence PRODUCT_COPY_FILES ignored messages" 2017-11-15 21:51:46 +00:00
Dan Willemsen
403b98aa25 Silence PRODUCT_COPY_FILES ignored messages
We don't have great alternatives for some of these use cases, so for now
just silence them, writing them to $OUT/product_copy_files_ignored.txt
(and if `dist' is specified, $DIST_DIR/logs/product_copy_files_ignored.txt)

Test: lunch aosp_arm-userdebug; m nothing
Test: lunch aosp_arm-userdebug; m dist
Change-Id: If0228bc8d907346e3505ae136cb477ef37a5c867
2017-11-15 11:13:23 -08:00
Tomasz Wasilczyk
29ec06b7ba Silence superfluous build messages.
Bug: 69315492
Test: it builds
Change-Id: Ic02484b80fa27c53786204402930ed5f33ec7fda
2017-11-15 10:34:01 -08:00
Jiyong Park
55e17a753e Keep PRODUCT_FULL_TREBLE to true even when some requirements are not met
When some of the full treble requirements are turned off,
PROUCT_FULL_TREBLE became false, which in turn cleared macro variables
guarded in treble: {cflags: "..."}.

Until when Soong recognizes each of the requirements (e.g.
treble_sepolicy: { }), don't reset PRODUCT_FULL_TREBLE to false
even when some of the requirements are not met.

Bug: 62019611
Bug: 68710251
Test: get_build_var PRODUCT_FULL_TREBLE returns true for aosp_walleye
Test: aosp_walleye boots to the UI
Change-Id: Iad3ee4f4462c82e9f9e1897f3ec019cdd16da358
2017-11-14 19:14:44 +09:00
Alex Deymo
cbb4ec6cf0 Merge "Update binary name to "brotli"." 2017-11-13 22:43:22 +00:00
Steven Moreland
33fdd8c4ef Break up PRODUCT_FULL_TREBLE into variables.
PRODUCT_SEPOLICY_SPLIT
PRODUCT_TREBLE_LINKER_NAMESPACES
PRODUCT_ENFORCE_VINTF_MANIFEST

Being able to selectively toggle these does several things:
- it's better software engineering (no longer conflating vars)
- easier bringup for devices.
- devices which don't require full Treble can opt out of only
  parts of it and still get the benefits of others.

Bug: 62019611
Test: manual

Merged-In: I728e32869baf043ae9a54e83e513fb99e560c827
Change-Id: I728e32869baf043ae9a54e83e513fb99e560c827
2017-11-13 10:32:52 -08:00
Alex Deymo
b10e07aea7 Update binary name to "brotli".
With the update of brotli to version 1.0.1 the new binary tool is now
called "brotli". This patch updates the scripts to use the new name.

Bug: 34220646
Test: `make dist`; ota_from_target_files on non-A/B device.
Change-Id: Ie8da4333388d029d5960a723a55efd875d8ee820
2017-11-13 18:11:45 +01:00
Dan Willemsen
207b009c86 Merge "Enable missing dependency checks" 2017-11-11 00:35:00 +00:00
Michael Schwartz
20401e3d84 Merge "Archive checkvintf in otatools" 2017-11-10 22:12:28 +00:00
Treehugger Robot
57d78295ef Merge "Turn unusual tags into errors" 2017-11-10 21:47:09 +00:00
Treehugger Robot
279f91510a Merge "Support gcno packaging for executables." 2017-11-10 21:05:42 +00:00
Michael Schwartz
6473e75479 Archive checkvintf in otatools
checkvintf will be used to verify compatibility of OTA packages.

Bug: 68327258
Test: `m -j dist` and inspect archive for checkvintf
Change-Id: I1d4cfcff537a03adee28d1e6ba9403a2e1635fe0
2017-11-10 09:38:28 -08:00
Dan Willemsen
bd8f84fca1 Turn unusual tags into errors
Test: build/soong/build_test.bash
Change-Id: If68bea3929763747137f8acc4a045933f40f5e17
Merged-In: If68bea3929763747137f8acc4a045933f40f5e17
(cherry picked from commit c35641913d)
2017-11-09 17:13:39 -08:00
Dan Willemsen
e43d8ee8ff Enable missing dependency checks
With this enabled, we'll check the entire build graph for missing
dependencies -- even if you don't need to build the module. So it'll
present more errors, but surface them earlier.

These can be turned off manually with an environment variable if the
branch is expected to have missing dependencies:

  ALLOW_MISSING_DEPENDENCIES=true
  SOONG_ALLOW_MISSING_DEPENDENCIES=true   (previous method)

That will be set automatically when using 'mm', which doesn't load the
entire build graph. It will also be set when using 'tapas' to build
unbundled apps, since those are usually on reduced branches.

This provides better error messages when a library is missing:

system/core/init/Android.mk: error: init_tests (NATIVE_TESTS android-arm64) missing libinit (SHARED_LIBRARIES android-arm64)
Available variants:
  libinit (STATIC_LIBRARIES android-arm64)
  libinit (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/init/Android.mk: error: init_tests (NATIVE_TESTS android-arm) missing libinit (SHARED_LIBRARIES android-arm)
Available variants:
  libinit (STATIC_LIBRARIES android-arm64)
  libinit (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
build/core/main.mk:852: error: exiting from previous errors.

instead of:

ninja: error: 'out/target/product/generic_arm64/obj/SHARED_LIBRARIES/libinit_intermediates/export_includes', needed by 'out/target/product/generic_arm64/obj/NATIVE_TESTS/init_tests_intermediates/import_includes', missing and no known rule to make it

Test: Manually introduce errors, check for expected output
Test: multiproduct_kati on AOSP and internal master, no new breakages
Change-Id: I5847f813045929813214137403c499b44ef67907
Merged-In: I5847f813045929813214137403c499b44ef67907
2017-11-10 01:13:07 +00:00
ShuJie Wang
76e93ba6cf build: clean up proguard_flag_files
we should clean up proguard_flag_files if LOCAL_PROGUARD_ENABLED
not defined in current module in case legacy proguard_flag_files
slips into current jack_all_deps dependencies.

Test: make -j8

Change-Id: I45618fc8e821ab7a8b964fa621824209e1e9894c
Signed-off-by: ShuJie Wang <wangshujie@xiaomi.com>
2017-11-09 15:26:28 +08:00
Vishwath Mohan
61bc4f790e Merge "CFI include/exclude path support (Make)" 2017-11-09 02:57:16 +00:00
Dan Willemsen
a3d94873cf Merge changes from topic "soong_ui_java"
* changes:
  Remove Java PATH check, deprecate using PATH in Kati
  Remove JAVA_NOT_REQUIRED
2017-11-08 20:31:31 +00:00
Vishwath Mohan
23b2d2e531 CFI include/exclude path support (Make)
This CL adds the ability to centrally enable or disable CFI for
components using either an environment or product config
variable. This is a better, nore manageable option that enabling CFI
across each component individually.

Bug: 67507323
Test: CFI_INCLUDE_PATHS= system/nfc m -j40
Test: CFI_EXCLUDE_PATHS = frameworks/av m -j40

Change-Id: I02fe1960a822c124fd101ab5419aa81e2dd51adf
2017-11-08 03:46:31 -08:00
Dan Willemsen
2ec3e4a257 Remove Java PATH check, deprecate using PATH in Kati
The Java PATH fixup is now handled within soong_ui, along with the
values of ANDROID_JAVA_HOME based on OVERRIDE_ANDROID_JAVA_HOME /
EXPERIMENTAL_USE_OPENJDK9.

Mark PATH as deprecated, so that any reads/writes will cause warnings.
This will be switched to obsolete once it's verified that there are no
more users.

Using PATH within Kati means that we've got to rebuild the ninja files
whenever your PATH changes, which is not ideal, especially since some of
the envsetup functions can change your PATH. In most cases you only need
to use PATH within the bash portions of the build rules ($${PATH}), which
isn't treated as a make variable, so won't produce an error.

I'm also planning on replacing PATH in a future change with our own
directory that has placeholders for everything in your PATH. This will
let us remove tools that shouldn't be used from the build.

Test: m nothing
Test: build/soong/build_test.bash on AOSP and internal master
Change-Id: I18d8d19cfba313ff9176345bf73ac34e8dbebfbb
2017-11-08 00:24:35 -08:00
Søren Gjesse
8639879e60 Merge "Use prebuild R8 for USE_R8=true" 2017-11-08 07:50:00 +00:00
Treehugger Robot
f599f4010e Merge "Add PRODUCT_ADB_KEYS" 2017-11-08 03:12:17 +00:00
Dan Willemsen
90879f50ea Remove JAVA_NOT_REQUIRED
This is no longer required.

Test: cs/JAVA_NOT_REQUIRED
Change-Id: I9f64e153c9f4af7df1c8dee4eaea3c7458be61c0
2017-11-07 17:43:36 -08:00
Treehugger Robot
4cb631f624 Merge changes from topic "system_default_prop"
* changes:
  Move ART default properties into system partition
  Add PRODUCT_SYSTEM_DEFAULT_PROPERTIES
2017-11-08 01:42:40 +00:00
Jaekyun Seok
5fb6a3eb9f Move ART default properties into system partition
Bug: 64661857
Bug: 68755013
Test: confirmed that ART default properties were stored in
/system/etc/prop.default on sailfish device

Change-Id: Ie07d3049de5ac395cfb9105e208fe7825080fa15
2017-11-08 00:56:43 +00:00
Ryan Campbell
14827f2a98 Support gcno packaging for executables.
Adapt the gcno packaging logic from shared_library_internal.mk for the
case of executable binaries so that gcov artifacts are properly
packaged.

Test: lunch walleye_coverage-userdebug && make -j60
Bug: 67998360
Change-Id: I4994fc21521c91d4c18bdf326be079beda1914a4
2017-11-07 09:52:27 -08:00
Søren Gjesse
c66d297e0a Use prebuild R8 for USE_R8=true
Instead of building R8 from external/r8 use the prebuild jar in
prebuilds/r8.

Test: m -j USE_R8=true

Change-Id: I9680ae430cdbc2b3beb910873c8eed27354f6af1
2017-11-07 16:21:50 +01:00
Dan Willemsen
dcd46870f2 Merge changes Ib37508d4,Ia46ac30e
* changes:
  Turn off Windows builds during BUILD_HOST_static
  zipalign: Fix build failure in static_sdk_tools.
2017-11-06 22:53:46 +00:00
Treehugger Robot
85e391b2a2 Merge changes I30a83721,I1094f213
* changes:
  Validate args passed by jacoco.mk to rm -rf
  Implement validate-paths-are-subdirs
2017-11-06 22:10:41 +00:00
Dan Willemsen
2a6e3b00b0 Turn off Windows builds during BUILD_HOST_static
We can only create static host binaries for Linux, so if static host
binaries are requested, turn off Windows cross-builds.

Test: m zipalign BUILD_HOST_static=1
Change-Id: Ib37508d4b502cd56dad535cb6eab648f625486c6
2017-11-06 11:12:09 -08:00
Treehugger Robot
76ceec724f Merge "Remove CFI-related WAR that is no longer necessary" 2017-11-06 18:54:45 +00:00
Pirama Arumuga Nainar
a8f75983a4 Remove CFI-related WAR that is no longer necessary
Bug: http://b/33678192

Clang has been updated past the revision mentioned in the work around.
So this is no longer necessary.

Test: Build
Change-Id: I08f8e75936bbc3527abc86ba4ce0f2c10382d332
2017-11-04 16:18:29 -07:00
Treehugger Robot
ab5ce7e1fe Merge "Move BUILD_*_FROM_FILE to config.mk" 2017-11-04 01:22:26 +00:00
Treehugger Robot
884af82b27 Merge "Switch deprecation message to $(warning)" 2017-11-04 00:50:14 +00:00
Colin Cross
e96bfdb337 Move BUILD_*_FROM_FILE to config.mk
BUILD_NUMBER_FROM_FILE and BUILD_DATETIME_FROM_FILE may need to
be referenced before main.mk has been parsed, move them to config.mk.

Bug: 68865363
Test: m -j TARGET_PRODUCT=full TARGET_BUILD_APPS=Gallery
      aapt dump xmltree out/target/product/generic/obj/APPS/Gallery_intermediates/package.apk AndroidManifest.xml | grep Version
Change-Id: I9361a394469e61fcdf5a2b9509ef2bb2b373d6e7
2017-11-03 16:35:02 -07:00
Dan Willemsen
0bd793815e Add PRODUCT_ADB_KEYS
This easily allow products to add custom adb keys for debuggable builds.
To use, provide a public key created by `adb keygen` to
PRODUCT_ADB_KEYS.

This way automated test farms don't need manual intervention to
authenticate to the device over adb, but we don't disable security for
everyone else.

Add an inherit-product-if-exists hook to aosp_* targets so that our
build servers can add a key for our test farms.

Bug: 32891559
Test: lunch aosp_marlin-userdebug; m bootimage
Test: lunch aosp_marlin-user; m bootimage
Change-Id: I1720644d89ec5289fbe99f95ebcdfbb3f3b20e67
2017-11-03 15:57:38 -07:00
Dan Willemsen
52f74821d3 Switch deprecation message to $(warning)
This way it shows up when using the old copy of lunch, which hides
stdout.

Test: source old_envsetup; lunch aosp_marlin-eng
Change-Id: I4bccf37fe69c0d7affb5805d05a2750e5d9a3da4
2017-11-03 15:52:50 -07:00
Jin Qian
09f3d18d56 Remove mkuserimg.sh from otatools
It has been replaced with mkuserimg_mke2fs.sh

Bug: 64395169
Change-Id: Iff4edba35062b6ecd3fec8b65422cab2a0707d3f
2017-11-03 12:16:15 -07:00
Jin Qian
bd532fbf2e Merge "Replace make_ext4fs with mke2fs" 2017-11-03 17:28:57 +00:00
Jaekyun Seok
b31b9bad66 Add PRODUCT_SYSTEM_DEFAULT_PROPERTIES
PRODUCT_SYSTEM_DEFAULT_PROPERTIES will be used to define system default
properties which should be installed in system partition.

Bug: 64661857
Test: confirmed that ART default properties are stored in
/system/etc/prop.default when they were defined in
PRODUCT_SYSTEM_DEFAULT_PROPERTIES.

Change-Id: Ia08c25d0c5805381c6e3fe63dd1d171e8d195b90
2017-11-03 15:32:47 +09:00
Jin Qian
95b2b695cd Replace make_ext4fs with mke2fs
make_ext4fs is deprecated and should be replaced with mke2fs

Bug: 64395169
Change-Id: Idfc8c0ee0ff598fdaa6f20bb0d4f6dca687a1b10
2017-11-02 16:27:41 -07:00
Alan Leung
65168a4143 Workaround for USE_D8 not in --dumpvars-mode
Bug: 68406220
Test: m checkbuild && USE_D8=false m checkbuild
Change-Id: Ia9916fb69b22449ff9eadd334f135807d999276f
2017-11-02 15:31:03 -07:00
Treehugger Robot
dee5abd85a Merge "Always use MKE2FS to build ext4 image" 2017-11-02 21:34:49 +00:00