Commit Graph

5623 Commits

Author SHA1 Message Date
Colin Cross
aedcfc98d3 Add R8 support
am: 66dbc0bc32

Change-Id: I75ea64dbeea6395597483998414b719d2cc8d6ad
2018-01-04 00:17:18 +00:00
Colin Cross
66dbc0bc32 Add R8 support
Add support for R8 to optimize apps and java libraries.

Test: m checkbuild
Change-Id: I2afd5d7a84912d3ab613c32c599bd1ebe60562e0
2018-01-03 14:15:57 -08:00
Colin Cross
a5c0b08f75 Merge "Refactor dexing"
am: 10d9930c06

Change-Id: I8266e047520784b8b84fe0eafe5565b3c9749495
2018-01-03 22:06:17 +00:00
Colin Cross
10d9930c06 Merge "Refactor dexing" 2018-01-03 21:59:09 +00:00
Colin Cross
550a5f6de5 Merge "Move jacoco before desugar"
am: a5fcf862ce

Change-Id: Iad33ae53ed433a21c002e1090d04707e336a18dc
2018-01-03 20:57:09 +00:00
Colin Cross
a5fcf862ce Merge "Move jacoco before desugar" 2018-01-03 20:50:50 +00:00
Colin Cross
5ba8a37e54 Merge "Update jacoco command line flags for latest version"
am: 82d1aee779

Change-Id: I96f66145b23210fd27fa9634927250d9806c5047
2018-01-03 19:57:56 +00:00
Colin Cross
82d1aee779 Merge "Update jacoco command line flags for latest version" 2018-01-03 19:45:55 +00:00
Colin Cross
193524e978 Pass OpenJDK 8's bootclasspath for host tools targeting <= 1.8.
am: 7fdd2b788c

Change-Id: Idbf1dd105dcb8bae22f8ff3acbf3fe01c911f5de
2018-01-03 05:12:34 +00:00
Colin Cross
3b986ef4e3 Add VisitDirectDepsWithTag
am: ee6143cde2

Change-Id: If146c812a022ca87d43c5e3843997edba1b550ac
2018-01-03 02:31:05 +00:00
Colin Cross
f0056cb2ed Refactor dexing
Move dexing support into java/dex.go, including the rules and logic
from builder.go and the function from java.go.

Test: no change to build.ninja
Change-Id: I098d2a9774e28079ba44791679a0db6f876fe3e6
2018-01-02 18:23:43 -08:00
Colin Cross
e6ddff68be Move jacoco before desugar
R8 will replace desugar+proguard+dx, which will mean jacoco has to
run before desugar.  In preparation, move jacoco before desugar now.

Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false tests
Change-Id: I5d98d2300ce83496f9b82c9b973f679701448474
2018-01-02 18:23:43 -08:00
Colin Cross
7fdd2b788c Pass OpenJDK 8's bootclasspath for host tools targeting <= 1.8.
Follow the Make change in I9b6081edfdd2c3e9a450ae8a39c4e32c3d2cda92
to explicitly pass the OpenJDK 8 bootclasspath when targeting <= 1.8.

Bug: 70862583
Test: java_test.go
Test: javap -c -p out/soong/.intermediates/external/guava/guava/linux_glibc_common/javac/classes/com/google/common/hash/AbstractStreamingHashFunction\$AbstractStreamingHasher.class  | grep ByteBuffer.flip
      shows java/nio/Buffer return type in signature.

Change-Id: Ief66bbf6e3a4220b3afb2e02009bd0157d4c7fae
2018-01-02 18:23:43 -08:00
Colin Cross
ee6143cde2 Add VisitDirectDepsWithTag
Add a method on ModuleContext and TopDownMutatorContext to visit
direct dependencies that have a given dependency tag.

Test: m checkbuild
Change-Id: Ib875563091dcae6b7282b3e3427d0eb07d8c8af5
2018-01-02 18:23:43 -08:00
Colin Cross
cda9710157 Move string list utility functions to android package
am: b4330e222b

Change-Id: Ie94e23c3005da8a9f1597b7582bc9abaa8038016
2017-12-28 19:27:04 +00:00
Colin Cross
b4330e222b Move string list utility functions to android package
Test: m checkbuild
Change-Id: I50a7ccf9fd7ed82b688e3eb90489c0bc0af33287
2017-12-28 17:41:02 +00:00
Colin Cross
1535b003a1 Merge "Reimplement ioutil.ReadDir with a version that avoids calling lstat"
am: ba5b43ee44

Change-Id: I09cf6e5b0925f44b33ce52c83263f00a52d778a5
2017-12-27 23:06:54 +00:00
Colin Cross
ba5b43ee44 Merge "Reimplement ioutil.ReadDir with a version that avoids calling lstat" 2017-12-27 23:04:28 +00:00
Colin Cross
637ad1deaf Merge changes Id2749d70,Ie705f064
am: 737a7f66c3

Change-Id: If13c4ed2ededa15d2f8c12fe65ddfa8b44912c55
2017-12-23 02:50:09 +00:00
Treehugger Robot
737a7f66c3 Merge changes Id2749d70,Ie705f064
* changes:
  Add a DirEntryInfo interface that is a subset of os.FileInfo
  Move android/soong/fs to android/soong/finder/fs
2017-12-23 02:43:17 +00:00
Steven Moreland
c53f4ca97c Merge "neverallows in Soong"
am: 19454d50e3

Change-Id: Iadb0d3e72d85e1a856bf15bf1c4aaea2a282e973
2017-12-23 01:15:14 +00:00
Treehugger Robot
19454d50e3 Merge "neverallows in Soong" 2017-12-23 01:08:44 +00:00
Colin Cross
ae7fd6baf3 Reimplement ioutil.ReadDir with a version that avoids calling lstat
ioutil.ReadDir returns []os.FileInfo, which contains information on
each entry in the directory that is only available by calling
os.Lstat on the entry.  Finder only the name and type (regular,
directory or symlink) of the files, which on Linux kernels >= 2.6.4
is available in the return values of syscall.Getdents.

Replace ioutil.ReadDir with a call that uses syscall.Getdents
directly and collects the type information from the result.

Testing with:
rm -f /tmp/db && strace -fc finder -names Android.mk,Android.bp,Blueprints,CleanSpec.mk,TEST_MAPPING -exclude-dirs .git,.repo -prune-files .out-dir,.find-ignore -db /tmp/db .

Before:
  7.01   52.688304          63    833398         1 lstat
  1.90   14.246644          68    210523           getdents64
  1.25    9.370471          90    104286         1 openat

After:
  3.48   12.201385         117    104286         1 openat
  3.06   10.729138          51    210523           getdents64
  1.70    5.951892          57    104283         1 lstat

Pros:
Avoids 729115 calls to lstat.

Cons:
Requires copying ~200 lines of finicky buffer parsing code.
Puts all getdents calls (and possibly fallback lstat calls) onto
a non-blocking file descriptor, which will cause it to block a
thread and not just a goroutine.
Only works on Linux and Darwin.

Bug: 70897635
Test: m checkbuild
Change-Id: Iab9f82c38c8675d0b73b4e90540bb9e4d2ee52c1
2017-12-22 13:56:17 -08:00
Colin Cross
a88c883e3e Add a DirEntryInfo interface that is a subset of os.FileInfo
ioutil.ReadDir returns []os.FileInfo, which contains information on
each entry in the directory that is only available by calling
os.Lstat on the entry.  Finder only the name and type (regular,
directory or symlink) of the files, which on Linux kernels >= 2.6.4
is available in the return values of syscall.Getdents.

In preparation for using syscall.Getdents, switch filesystem.ReadDir
to return an interface that only contains the information that will
be available from syscall.Getdents.

Bug: 70897635
Test: m checkbuild
Change-Id: Id2749d709a0f7b5a61abedde68549d4bf208a568
2017-12-22 13:56:17 -08:00
Colin Cross
8d6395c09d Move android/soong/fs to android/soong/finder/fs
The fs package is specific to finder, move it inside finder.

Bug: 70897635
Test: m checkbuild
Change-Id: Ie705f064a832141702a8e87fd59ed75c01018504
2017-12-22 13:56:17 -08:00
Colin Cross
8010cbf6bb Strip module-info.class files when combining jars
am: 7b60cdd6e5

Change-Id: I3385a72716142df0047f7f99bf3270808e7ae7e2
2017-12-22 06:16:52 +00:00
Colin Cross
4d9b7af491 Remove --no-locals -> --release translation
am: c5de1b6cb2

Change-Id: I05bdbbee3fa9e18fbc376583f4bb9f68f46acf15
2017-12-22 03:29:27 +00:00
Colin Cross
6abc973a9c Update jacoco command line flags for latest version
jacoco_cli wants --quiet and --dest instead of -quiet and -dest.

Bug: 69669951
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false tests
Change-Id: I72b3d0a21c5fa02a58914953d3d794065f59bd18
2017-12-21 14:29:56 -08:00
Colin Cross
7b60cdd6e5 Strip module-info.class files when combining jars
Combining static jars from dependencies may bring in module-info.class
files, which don't make sense once multiple modules have been combined,
and sometimes confuse downstream tools like desugar.  Strip them out
like make does when combining jars.

Test: m checkbuild
Change-Id: I560c5acfcc6e1be9adf604c22cf200581f92f702
2017-12-21 14:29:56 -08:00
Colin Cross
c5de1b6cb2 Remove --no-locals -> --release translation
--no-locals is never used any more, remove the translation.

Bug: 70886092
Test: m checkbuild
Change-Id: Ie89aaad618c12c288d7e7bca863834cf7ee824fb
2017-12-21 13:01:49 -08:00
dimitry
7edc7a525b Merge "Ignore 'extern "C++"' section in a version script"
am: cd406fa70b

Change-Id: Idacb70a08fd8cfb6e12ca296d4950a74d5045a70
2017-12-21 18:30:17 +00:00
Treehugger Robot
cd406fa70b Merge "Ignore 'extern "C++"' section in a version script" 2017-12-21 15:13:34 +00:00
Tobias Thierer
21421c5faa Merge "Make ANDROID_JAVA{8,9}_HOME available to config.mk."
am: 38501a959f

Change-Id: I1d711bec7da9943b8a7d070587669f9353d69a8b
2017-12-21 13:40:51 +00:00
Jiyong Park
0fffd6bca4 Merge "Add [soc|device|product]_specific"
am: 95fba1a8f8

Change-Id: I0b7ec832b7bdcf53e9fabad6bbd7a97d0cb77c5a
2017-12-21 13:39:42 +00:00
Colin Cross
4e914d70cd Fix jacoco filters
am: d7deceb8fa

Change-Id: Ia6e7171a7812796d323422c17c60fa26c95a53a0
2017-12-21 13:39:18 +00:00
Colin Cross
c99dbcbfd8 Add jacoco filter tests
am: 7a3139e05d

Change-Id: I76550d9f1f5fd9a038d91190c30b81e10a8d11b6
2017-12-21 13:39:14 +00:00
Tobias Thierer
38501a959f Merge "Make ANDROID_JAVA{8,9}_HOME available to config.mk." 2017-12-21 11:46:20 +00:00
Treehugger Robot
95fba1a8f8 Merge "Add [soc|device|product]_specific" 2017-12-21 09:02:20 +00:00
Colin Cross
d7deceb8fa Fix jacoco filters
Add space after -x argument for jacoco excludes.
Add .class to end of file name for jacoco includes.

Bug: 64836607
Test: jacoco_test.go
Change-Id: I4c1024755882c976f7326f7382c4f2e99a20233d
2017-12-21 04:34:46 +00:00
Colin Cross
7a3139e05d Add jacoco filter tests
Add tests for converting jacoco filters to command line arguments
to soong_zip.

Bug: 64836607
Test: jacoco_test.go
Change-Id: I969fa877e4be19bb92dcab5a796a4e4ec3fc166a
2017-12-21 04:34:26 +00:00
Nan Zhang
eec578939b Merge "Add -p, -e options in merge_zips for supporting par format."
am: 828001d59d

Change-Id: Iafbf89032534bd759592a5b2b191150f9400d7b7
2017-12-21 03:44:29 +00:00
Pirama Arumuga Nainar
29d92cef6d Merge "Add 'openmp' compiler property"
am: 91aa9f9d54

Change-Id: I6edc27d9d49d5cd347702fd70fd93f6e9afdabea
2017-12-21 03:43:55 +00:00
Dan Albert
526800c76c Merge "Update the NDK ARM ABI to armv7."
am: 3b528a802d

Change-Id: I19f0d02cc6b81dd26889e41fed412723cc026918
2017-12-21 03:43:21 +00:00
Jiyong Park
2db7692a74 Add [soc|device|product]_specific
Added three properties (soc_specific, device_specific, and
product_specific) that shows what a module is specific to.

`soc_specific: true` means that the module is specific to an SoC
(System-On-a-Chip) and thus need to be installed to vendor partition.
This has the same meaning as the old `vendor: true` setting.

`device_specific: true` means that the module is specific to the entire
hardware configuration of a device includeing the SoC and off-chip
peripherals. These modules are installed to odm partition (or /vendor/odm
when odm partition does not exist).

`product_specific: true` means that the module is specific to the
software configuration of a product such as country, network operator,
etc. These modules are installed to oem partition (or /system/oem when
oem partition does not exist). These modules are assumed to be agnostic
to hardware, so this property can't be true when either soc_specific or
device_specific is set to true.

Bug: 68187740
Test: Build. path_tests amended.
Change-Id: I44ff055d87d53b0d2676758c506060de54cbffa0
2017-12-21 12:16:29 +09:00
Treehugger Robot
828001d59d Merge "Add -p, -e options in merge_zips for supporting par format." 2017-12-21 01:27:32 +00:00
Treehugger Robot
91aa9f9d54 Merge "Add 'openmp' compiler property" 2017-12-21 00:38:45 +00:00
Treehugger Robot
3b528a802d Merge "Update the NDK ARM ABI to armv7." 2017-12-21 00:37:29 +00:00
Tobias Thierer
e59aeff5c4 Make ANDROID_JAVA{8,9}_HOME available to config.mk.
Previously, these variables were exported only by makevars.go,
but those values are not available to config.mk. This CL adds
the variable to ui/build/config.go, which also makes it
available to config.mk.

Test: Treehugger
Bug: 70862583
Bug: 70521453
Change-Id: Ib54660e4b08ab751265b30004630cf1bb8c0041b
2017-12-20 23:14:37 +00:00
Dan Albert
d3c8ca4469 Update the NDK ARM ABI to armv7.
We don't support armv5 any more, and we can't build bionic as armv5.

Test: build/soong/scripts/build-ndk-prebuilts.sh
Bug: https://github.com/android-ndk/ndk/issues/272
Change-Id: I4026d48e7d5db78f6aa4e9796da1ec9cf10021ca
2017-12-20 14:48:39 -08:00
Nan Zhang
5925b0fda4 Add -p, -e options in merge_zips for supporting par format.
Move __init__.py files population to merge_zips, and add options: -p, and
-e. Since par needs entry_point.txt to search the program entry point, so
add -e option to support it.

Test: ./merge_zips -p -e entry_point.txt out in1.zip in2.zip
Bug: 70568913
Change-Id: Ida10faf125e1b94dffc98b30240db3b90fd75b25
2017-12-20 12:57:10 -08:00