Commit graph

1032 commits

Author SHA1 Message Date
Colin Cross
4a18f97b9d Merge "Sort files in directories passed to jar" am: 966ed15a1d am: 604a2423b6 am: da54a77928
am: 18c92897a7

Change-Id: I59d5bcd8557bac4ff176c3354dab556254ca3b85
2017-08-17 01:20:13 +00:00
Colin Cross
604a2423b6 Merge "Sort files in directories passed to jar"
am: 966ed15a1d

Change-Id: If01ba7d294e4308a28580b157b9efdb6c860bb35
2017-08-17 01:00:13 +00:00
Colin Cross
128800f2c8 Sort files in directories passed to jar
jar -C <dir> . produces a jar containing files in filesystem order,
which can vary between builds.  Manually find and sort the list of
files, and convert them into a list of -C <dir> <file> pairs.

Fixes: 64634025
Test: m -j checkbuild
Test: m -j out/target/product/sailfish/system/framework/ext.jar, check
      that entries are sorted
Test: m -j out/target/product/generic_arm64/system/framework/ext.jar on mac
Change-Id: I7dced6acbe621a60cd49daf17872941485602732
2017-08-16 13:37:00 -07:00
Tobias Thierer
c4803f6d63 Merge "Fix log spam in unzip-jar-files" am: 05ecd66557 am: 17f23f3837 am: f161741543
am: 345347f527

Change-Id: Icb086e4bd17314e881378bd6b54655ed787367b9
2017-08-16 10:12:46 +00:00
Tobias Thierer
17f23f3837 Merge "Fix log spam in unzip-jar-files"
am: 05ecd66557

Change-Id: I44836b434fabc250ea95dd7f3e5ce3572863be44
2017-08-16 10:00:47 +00:00
Tobias Thierer
05ecd66557 Merge "Fix log spam in unzip-jar-files" 2017-08-16 09:54:46 +00:00
Tobias Thierer
341ccb6161 Fix log spam in unzip-jar-files
Commit 2bdbb6e935 added
command line flags to the unzip command in unzip-jar-files
to skip the path 'module-info.class', if present.

This has led to log spam because unzip warns when an
excluded file is not present in the zip/jar file, and
that warning cannot be suppressed via command line flags.
Therefore, this CL modifies the unzip-jar-files macro
to rm -f the module-info.class file after the fact, if
it was created, which does not lead to log spam.

Note that module-info.class will be filtered out of
.jar dependencies (such as ASM 6.0) regardless of
whether one is building with an OpenJDK 9+ toolchain.

Test: Treehugger.
Bug: 64719206
Change-Id: Ic6be806a50557b4ba13fc18da91a8af12d14586c
2017-08-15 20:51:49 +01:00
Alex Klyubin
d41da2b7cf Merge "Revert "Let signapk access internal APIs under OpenJDK 9 toolchain"" am: 42ce465e83 am: 8191dfb49e am: d98708d71f
am: 66d2b8b185

Change-Id: Ie0348176ee8a1cab2552923dc38fd982de0e58bd
2017-08-14 16:16:23 +00:00
Alex Klyubin
8191dfb49e Merge "Revert "Let signapk access internal APIs under OpenJDK 9 toolchain""
am: 42ce465e83

Change-Id: I9ac004ecfcb36b0cc947e1c6c820142771f6361b
2017-08-14 16:01:33 +00:00
Alex Klyubin
4012e648ea Revert "Let signapk access internal APIs under OpenJDK 9 toolchain"
This reverts commit 9cc3c76abd which
added command-line parameters to the invocation of SignApk to permit
it to access sun.** classes which are not accessible by default in
Java 9. This hack is no longer needed because SignApk no longer needs
this access because of tools/apksig commit
b40d3e4821bc9cb094b0ff13153340e3a0da1b3f which switched APK JAR
signature generation logic away from directly using sun.** classes.

Test: find out -name CtsPkgInstallTinyApp* | xargs rm -Rf
      mmma -j74 cts/hostsidetests/appsecurity/test-apps/tinyapp
Test: find out -name CtsPkgInstallTinyApp* | xargs rm -Rf
      EXPERIMENTAL_USE_OPENJDK9=target1.8 \
        OVERRIDE_ANDROID_JAVA_HOME=<path to Java 9 SDK> \
        PATH=${OVERRIDE_ANDROID_JAVA_HOME}/bin:${PATH} \
        mmma -j74 cts/hostsidetests/appsecurity/test-apps/tinyapp
Bug: 37137869
Change-Id: I389c366f8a5bed56c496293bc871458adbedb0e8
2017-08-11 11:15:54 -07:00
Tobias Thierer
9ab835d4e5 Merge "Omit module-info.class when unzipping jar files." am: 5ae6434575 am: 3e55981366 am: da8798f218
am: ab333afe68

Change-Id: I30700c24c900ef7cef3f24ab0eda911e7b86c91c
2017-08-11 13:22:51 +00:00
Tobias Thierer
3e55981366 Merge "Omit module-info.class when unzipping jar files."
am: 5ae6434575

Change-Id: If31f78c730339473cd5cd5e1bc83a3a3562bad3c
2017-08-11 13:11:05 +00:00
Tobias Thierer
5ae6434575 Merge "Omit module-info.class when unzipping jar files." 2017-08-11 13:05:02 +00:00
Narayan Kamath
877a64c813 Merge "Implement LOCAL_COMPRESSED_MODULE." into oc-mr1-dev
am: 2f6b55266a

Change-Id: Ibe8746049242110b1f1c75bb5a5963039c875b40
2017-08-11 09:38:32 +00:00
Narayan Kamath
7c205107ce Implement LOCAL_COMPRESSED_MODULE.
- Prebuilts with LOCAL_MODULE_CLASS == APPS and BUILD_PACKAGE that
  define LOCAL_COMPRESSED_MODULE := true will be installed compressed
  in the system partition.
- The compression algorithm is simple gzip for now.

In addition :
- Compressed modules are not dex-preopted.
- JNI shared libraries are always embedded inside compressed modules,
  they are never installed as separate files on the FS.

Test: Manual
Bug: 63802184

Change-Id: Id12b1ff0b1d68791ec1178783f7e78910e122a33
2017-08-10 12:38:11 +01:00
Nan Zhang
4988fa2ffe Merge "Fix the typo: "desugar-classpath" to "desugar-bootclasspath""
am: 9758900b56

Change-Id: I72160219c0559e39b83df007f7c607cbed8db5a1
2017-08-08 23:09:24 +00:00
Nan Zhang
f4571792f7 Fix the typo: "desugar-classpath" to "desugar-bootclasspath"
Test: runs "m -j checkbuild tests cts", and then --bootclasspath_entry
shows up in desugar command.

Change-Id: Ibcc8a3f51438723151c57f79e5a1184350efbd30
2017-08-08 13:38:59 -07:00
Tobias Thierer
2bdbb6e935 Omit module-info.class when unzipping jar files.
During the Android build process, multiple .jar files are
unzipped into the same directory. If the .jar is an OpenJDK 9
modular jar (with a module-info.class in the root directory),
the last module-info.class extracted will overwrite any earlier
module-info.class files extracted, and will cause all extracted
class files to be considered part of that module.

Therefore, this would break compilation under OpenJDK 9 (with
-target 1.9 -source 1.9). This CL fixes this by omitting the
module-info.class file (if present) when extracting the .jar.

This essentially turns any modular jar into a regular jar,
replacing the module with corresponding classes on the classpath.
This is sufficient for now because Android does not currently
support module dependencies.

Test: Treehugger
Bug: 38177569
Change-Id: Ia184e64d2f24b8ca79aeab1c00bd5da0386530bf
2017-08-08 20:09:54 +01:00
Colin Cross
a4e638689b Merge "Revert "Revert "Copy resources from classes.jar when using AAPT2"""
am: e2b98ace94

Change-Id: Id0850fff121beab0920e06440c7271d7622387b0
2017-08-04 21:02:35 +00:00
Colin Cross
303567c922 Revert "Revert "Copy resources from classes.jar when using AAPT2""
This reverts commit a7e336d17a.

Reapplies I6649f7f2fbf63ff5001f4731e22960f857726c70 with fix
for jack builds.

Bug: 64272170
Test: https://android-build.googleplex.com/builds/view-workplan?viewType=Table&workplanId=L93000000088657848&nodeType=Trybot
Change-Id: Id66aebfc2c26a4467e6cf25e4372080882f0b286
Merged-In: Id66aebfc2c26a4467e6cf25e4372080882f0b286
(cherry picked from commit 6fedebf936)
2017-08-04 09:35:13 -07:00
Colin Cross
e99de69665 Merge "Disable desugaring try-with-resources"
am: 28794da1c0

Change-Id: I5a6d131e689922586482d950e933e5ea86e7729e
2017-07-21 20:52:54 +00:00
Colin Cross
28794da1c0 Merge "Disable desugaring try-with-resources" 2017-07-21 20:48:45 +00:00
Colin Cross
bf4ac7a82f Disable desugaring try-with-resources
Desugaring try-with-resources is not necessary for platform builds,
and triggers some problems for apps built as part of the platform
that target SDK versions before 19.  Disable all try-with-resource
desugaring.

Bug: 63180735
Bug: 63900665
Bug: 63901645
Test: m -j ANDROID_COMPILE_WITH_JACK=false checkbuild
Change-Id: I98b827aa1e80b43e6eb7b58254c23c7a4f7dc52d
2017-07-20 15:07:22 -07:00
Tobias Thierer
3a88054509 Merge "Drop obsolete javac -extdirs commandline arg."
am: 43440c22dd

Change-Id: I7d5736b6b5760341aca1a8810f13d999733bc68a
2017-07-20 08:22:03 +00:00
Tobias Thierer
78d2983566 Drop obsolete javac -extdirs commandline arg.
The extension directory defaults to lib/ext and does not
exist by default. Setting it to the empty string de facto
disables this obsolete feature.

AOSP is moving to a hermetic toolchain so this argument
will stop working soon. Further, OpenJDK 9 javac no longer
supports this command line argument when compiling for
-source 1.9 -target 1.9.

This command line argument has been around since the
earliest versions of Android, but is now obsolete.
This CL drops it.

Bug: 63746471
Test: Treehugger
Change-Id: Ia0214c1b192e3ffda10772d777557a81ce346c03
2017-07-18 16:17:15 +01:00
Colin Cross
4cea760106 Merge "Revert "Use dx.jar directly""
am: c7e3e962f8

Change-Id: Icd5402f7cc789224753537c070a91cbf6267ee66
2017-07-18 07:14:26 +00:00
Treehugger Robot
c7e3e962f8 Merge "Revert "Use dx.jar directly"" 2017-07-18 07:08:19 +00:00
Colin Cross
e44e75aa89 Revert "Use dx.jar directly"
This reverts commit e37a3c959a.

Reason for revert: breaks art test runner

Change-Id: Ice0cd3020ddec7f31eb789867a45f047a75a05d0
2017-07-18 05:22:59 +00:00
Colin Cross
4828fcad41 Merge "Use dx.jar directly"
am: c68434c971

Change-Id: Ief2c88d3ba0e93c7eb7bb9db0ac2b0a0b886bcea
2017-07-17 20:45:31 +00:00
Jeff Gaston
6264b662f3 Merge "Update to latest jacoco usage"
am: 483fae7430

Change-Id: Ibc94d5ba6db7690441825dd655b6cb26d989b78d
2017-07-17 20:44:10 +00:00
Colin Cross
c68434c971 Merge "Use dx.jar directly" 2017-07-17 20:40:13 +00:00
Jeff Gaston
aaae43cd24 Update to latest jacoco usage
Bug: 36792868
Test: EMMA_INSTRUMENT_STATIC=true m -j

Change-Id: I419b543283b52be9a72f5c6b10e4cbea68782174
2017-07-14 13:04:05 -07:00
Colin Cross
e37a3c959a Use dx.jar directly
Use $(JAVA) to invoke dx.jar instead of the dx wrapper script.
Also allow the dx command line or the dx jar to be specified on
the command line.  Allows better dependencies on dx.jar, and
doesn't rely on having java on the path.

Bug: 62956999
Test: m -j checkbuild
Change-Id: I5f265132690ad28b3139954fea44eb0c4a43393a
2017-07-07 13:34:33 -07:00
Colin Cross
e885ccf0df Merge "Provide make variables for java binaries"
am: 5e19557eb9

Change-Id: Ib1be7da98214e3b6c27867b80005e18cc68a0d33
2017-07-01 01:36:14 +00:00
Colin Cross
0851df8c82 Provide make variables for java binaries
Replace java -> $(JAVA), etc. to prepare for moving java binaries
out of the path and using full paths to them.

Test: builds
Bug: 62956999
Change-Id: I5dfcd0d4e855ecde69cd127169e9545e59723d12
2017-07-01 01:03:14 +00:00
Steven Moreland
8fb19697da Merge "Move math function definitions." am: b5e90583ef am: d1eab0ea46
am: a2f3561259

Change-Id: I86436840a6c5877901a13384faea6e699f0edfa9
2017-06-02 00:25:16 +00:00
Treehugger Robot
b5e90583ef Merge "Move math function definitions." 2017-06-02 00:11:04 +00:00
Dan Willemsen
9afb656369 Merge "Fix make warning/error colors on Mac" am: a46695c337 am: 6ee5e52f77
am: c9b89ad0fe

Change-Id: I2349136dcf43dd0336bbb8638bd03eab84082f2f
2017-06-01 08:34:58 +00:00
Dan Willemsen
25f2d0ded7 Fix make warning/error colors on Mac
Apparently the default bash echo doesn't support \e even though the man
page says it does. So use \033 instead.

Test: m -j nothing on mac, get colors
Test: m -j nothing on linux, still get colors
Change-Id: I608fa87e3c28bf8f99264d39f9b250008a81235a
2017-05-31 19:20:09 -07:00
Steven Moreland
a64f33668e Move math function definitions.
Created math.mk and moved all math function definitions there.
Then, included this file in config.mk. This allows the functions to be
used by whatever includes config.mk (envsetup and build).

Test: manually setting combinations of PRODUCT_SHIPPING_API_LEVEL
  and PRODUCT_FULL_TREBLE_OVERRIDE and looking at values of
  PRODUCT_FULL_TREBLE.
Bug: 62229856
Change-Id: Icdab4214a1e65ae202411613dbcb9c9ea5f43b09
2017-05-31 20:41:49 +00:00
Miao Wang
b19c923c77 Merge "Update RenderScript build config and definitions." am: dddd7738d0 am: 4751b9e700
am: 527eee8b8f

Change-Id: Ife66e15b0c458a9fb622e56b7ab348e345d780b0
2017-05-26 22:51:36 +00:00
Treehugger Robot
dddd7738d0 Merge "Update RenderScript build config and definitions." 2017-05-26 22:29:36 +00:00
Miao Wang
a9fed83fae Update RenderScript build config and definitions.
Bug: 38342163

  - obj/lib is deprecated and TARGET_OUT_INTERMEDIATE_LIBRARIES will be
  removed. We need to use per-module intermediates directory instead.
  - prebuilts/ndk/current folder is gone. For libm and libc, we just
  need ndk/r10 as stub libs for linking.

Test: mm and made sure this does not affect on device target.
Test: make -j50 FORCE_BUILD_RS_COMPAT=true RSTest_Compat works as
expected.

Change-Id: I8fbf5c10322707849a23c6b0dacc28b028db451e
2017-05-26 13:48:08 -07:00
Tobias Thierer
206b85e3b2 Merge changes from topic 'bug_38177295_checkbuild' am: bc8f82ff25 am: 0556ad1a71
am: 3dd019b9c4

Change-Id: I7dd63314b4aace5f308aca6b28bf4af671f183fa
2017-05-26 15:49:36 +00:00
Tobias Thierer
9cc3c76abd Let signapk access internal APIs under OpenJDK 9 toolchain
signapk relies on internal APIs sun.security.{pkcs,x509},
for example in com.android.apksig.internal.apk.v1.V1SchemeSigner.

This breaks at signapk runtime under OpenJDK 9 because those
packages are not exported by the java.base module.

This CL unbreaks signapk by allowing it to access these internal
packages. In the long term, signapk should migrate away from these
internal APIs (bug 37137869).

Test: make ANDROID_COMPILE_WITH_JACK=false checkbuild tests \
      && make checkbuild tests
      (with OpenJDK 8u45 toolchain on the PATH)
Test: make EXPERIMENTAL_USE_OPENJDK9=true \
      ANDROID_COMPILE_WITH_JACK=false checkbuild
      (with jdk 9-ea+170 toolchain on the PATH)

Bug: 37137869
Bug: 38177295
Change-Id: I64cab83e6eb7b135cf2ad7b523736cb409aaae02
2017-05-25 20:34:22 +01:00
Tobias Thierer
97479ccb7f Desugar: allow reflection over internal APIs.
Desugar reflects over internal APIs at runtime, using the
java.lang.invoke.MethodHandles.Lookup API.

On OpenJDK 9 toolchains, such reflection is only allowed
to packages to which the java.lang.invoke module is opened.

This CL adds an override to open the module to all unnamed
modules (i.e., to Desugar) when running Desugar.

Test: make checkbuild
      (with OpenJDK 8u45 toolchain on the PATH)
Test: make EXPERIMENTAL_USE_OPENJDK9=true checkbuild
      (with OpenJDK 9-ea toolchain on the PATH)

Bug: 38177295

Change-Id: I2cf74a96ea17366dd50b8d92af8e41e812247ef7
2017-05-25 18:14:27 +01:00
Dan Willemsen
4a05738a8e Merge "Fix override warnings when two test suites share an output" am: 5f4274609f am: a0d3365510
am: 9f64ca8413

Change-Id: I5e06436c54f8c6a1e2d90f6e5728604d8b2a3ff5
2017-05-24 03:41:33 +00:00
Dan Willemsen
988a08d009 Fix override warnings when two test suites share an output
Test: (internal master); m -j nothing, check warnings
Test: Spot check differences in build-*.ninja
Change-Id: I160583faa69d090f9b97a8a600598a39a8b1ed9c
2017-05-24 00:42:23 +00:00
Tobias Thierer
57fa914a79 Merge "Fix fragile assumptions about build toolchain. (attempt #2)" am: 48ee187e98 am: b9511c87b6
am: d7f60e4fbc

Change-Id: I7cff67ba4208293eacf7a9346c99b9f964ba270b
2017-05-23 12:26:25 +00:00
Tobias Thierer
0ed47f7fd1 Fix fragile assumptions about build toolchain. (attempt #2)
This CL resubmits a fixed version of commit
e2a8da2683.

This CL applies the following changes:

- explicitly set the path where desugar will dump temporary class files.
  This ensures that the system property is set before it is read during
  InnerClassLambdaMetafactory.<clinit>. Before this CL, the system
  property was set by Desugar.createAndRegisterLambdaDumpDirectory(),
  which may run too late.

- explicitly specify -source 1.8 for droiddoc's javadoc run.
  Previously, the command used the language version of the build
  toolchain, which might fail due the backward-incompatible restrictions
  imposed by the proposed module system.

  Some Android build targets use LOCAL_JAVA_LANGUAGE_VERSION 1.7,
  but droiddoc combines sources from multiple build targets and there
  where no backwards incompatible changes in 1.8, so it should be fine
  to use 1.8 for code from either language level.

Bug: 38318052
Bug: 38225656
Bug: 38177295
Test: make clean && make ANDROID_COMPILE_WITH_JACK=false checkbuild tests \
      && make checkbuild tests
      (using OpenJDK 8 toolchain)

Change-Id: I2fffe6668747f48be44e34c67332af9b8a996d2a
2017-05-22 23:03:24 +01:00