Commit graph

78 commits

Author SHA1 Message Date
Tobias Thierer
5a64925af7 Merge "Drop build support for LEGACY_USE_JAVA7." am: 5368131063 am: 28be9906d4
am: 7d8194becd

Change-Id: I9c5d261b7c9c0f652c733ebc89c44d1295986cf8
2017-05-24 10:33:33 +00:00
Tobias Thierer
c61bd998b5 Drop build support for LEGACY_USE_JAVA7.
This flag allowed for building with an OpenJDK 7 toolchain. It was
used for build bot builds that now work with an OpenJDK 8 toolchain.
Hence, this feature is no longer required. This CL drops it.

Bug: 27583810
Test: Treehugger build succeeds.
Change-Id: I7efca363d665292bfb88f4a4d6f3a120fc8f93f3
2017-05-23 14:17:48 +01:00
Dan Willemsen
4e9e5d526c Merge "Rewrite link type checking" am: e4d92ef568 am: d76aaed983
am: e834d5f059

Change-Id: I02342b80077a7e1e36e61d1f9384d3b104a982c1
2017-04-20 15:15:19 +00:00
Dan Willemsen
b47d4e9cf1 Rewrite link type checking
All the new features are turned off for now, since multiple branches and
products need to be verified before they can be turned on. So everything
should behave the same as today, except for no partition-based
warnings.

Instead of the current link type checks that happen during the build,
run as many as possible immediately after loading all the Android.mk
files. If we're allowing missing dependencies ('mm',
ALLOW_MISSING_DEPENDENCIES, tapas, etc), we'll defer the link type
checks to during the build. If we're not allowing missing dependencies,
we'll produce a better error message to the user about the missing
dependencies.

See core/main.mk for a description of the storage format.

This also remove the partition-based type checking. It hasn't worked all
that well, particularly with ASAN builds. The new VNDK checks will
handle the most pressing cases.

Test: Verify all link_type files and dependencies are the same:
  grep link_type: out/build-aosp_arm64.ninja | sed -E "s/ rule[0-9]+//" | sort
Change-Id: Id643658b9d9e84f99f5db0d526aad88c1f5d3417
2017-04-19 22:41:32 -07:00
Colin Cross
e8ee68bb9b Support java annotation proccessors
The codebase is growing more uses of annotation processors,
through a mixture of LOCAL_ADDITIONAL_DEPENDENCIES and
LOCAL_JACK_FLAGS.  Add LOCAL_ANNOTATION_PROCESSORS and handle
the rest in the build system.

For now we also need LOCAL_ANNOTATION_PROCESSOR_CLASSES to
work around bad behavior in grok (b/25860419).

Test: m -j java
Change-Id: I465b021e65d25ed3ea517333a82ec4ebd63fc038
(cherry picked from commit cde14987ba)
2017-04-11 12:22:53 -07:00
Colin Cross
cde14987ba Support java annotation proccessors
The codebase is growing more uses of annotation processors,
through a mixture of LOCAL_ADDITIONAL_DEPENDENCIES and
LOCAL_JACK_FLAGS.  Add LOCAL_ANNOTATION_PROCESSORS and handle
the rest in the build system.

For now we also need LOCAL_ANNOTATION_PROCESSOR_CLASSES to
work around bad behavior in grok (b/25860419).

Test: m -j java
Change-Id: I465b021e65d25ed3ea517333a82ec4ebd63fc038
2017-04-11 09:56:09 -07:00
Colin Cross
99c83f2bda Merge "Rearrange java library outputs" am: 7b7363fffb am: a4435a5025
am: 09018269a8

Change-Id: I35b5527c4142f9486c6d57498789ba2249d0a4a3
2017-04-06 15:52:26 +00:00
Colin Cross
1ed4235172 Merge "Move proguard before classes.jar" am: 41d5cd7420 am: c40073c77f
am: 6ade789f59

Change-Id: I9ac539f18a998c3a85960526a77cfdebef9ca641
2017-04-06 02:50:55 +00:00
Colin Cross
941b682099 Rearrange java library outputs
Jack can silently handle using a java library as a static java
library by merging in the java library dex file.  This causes
problems when switching to javac, because dex doesn't support
dex merging with multidex enabled?

Make the output files consistent between java libraries and static
java libraries.  Java libraries will now produce:
classes-pre-proguard.jar: the classes before proguard processing
classes.jar: the final jar file containing classes before dexing
javalib.jar: a jar containing classes.dex

Static java libraries will eventually only produce
classes-pre-proguard.jar and classes.jar.  All inter-library
linking is done with classes.jar, so a java library can be
used as a static java library.

There are too many dependencies outside the build system that
expect javalib.jar to exist for static and host java libraries,
so for now continue to build a javalib.jar that is a copy of
classes.jar.

Test: m -j ANDROID_COMPILE_WITH_JACK=false java
Test: m -j java
Bug: 36901093
Change-Id: I6730e2d3ec38004874265b2a690442dec57b33f4
2017-04-05 18:04:37 -07:00
Colin Cross
950f1efbbc Move proguard before classes.jar
Downstream users of a library always link against javalib.jar, which
is either the dex jar for java libraries or a copy of
proguard.classes.jar for static java libraries.  In preparation for
making java libraries a superset of static java libraries, make
classes.jar always be the final class-containing jar for use
downstream, and always create a classes-pre-proguard.jar for
users that need a jar without shrinking or obfuscation.

Also rename the intermediates to be consitent: classes-<tool>.jar

Test: m -j ANDROID_COMPILE_WITH_JACK=false java
Change-Id: I3df8b9a4edcd5db996f1fedc54c8a782d4f36a92
Merged-In: I3df8b9a4edcd5db996f1fedc54c8a782d4f36a92
(cherry picked from commit 6fabefa88e)
2017-04-06 00:46:23 +00:00
Colin Cross
9256be1822 Merge changes I7e8fcd2e,Ie12d743c am: 547f7393d7 am: 8283b186be
am: 7d8a028cd3

Change-Id: Ife691c9e00e766293e3648348e3c86b92f96fd56
2017-02-17 22:45:38 +00:00
Colin Cross
79e2f73b6c Re-enable dx support
This is a partial revert of commits:
858657366f Remove support of disabling Jack.
3ae7861252 Remove javac support in host dex rules.
22313f2b2a Remove rules for building dex with dx

Test: builds
Change-Id: Ie12d743cbe978bdeb030910848b67f5945a4fec8
2017-02-16 14:08:45 -08:00
Dan Willemsen
a006925a03 Merge "Remove generated java source post clean logic" am: f57aa792c3 am: 5208e4f473 am: 5ae5671a3b
am: b585264834

Change-Id: Ic9d89893213616a13df5530f382fa2ec4d4e964e
2016-12-22 20:36:07 +00:00
Dan Willemsen
cf324af6b8 Remove generated java source post clean logic
Just move the proto and renderscript sources into their own directories
-- the entire directory is wiped if the file list changes since the
command line will change. So we can just enable/disable pulling sources
from those directories based on whether there were files in the list or
not.

Bug: 30947985
Test: m -j java
Test: Remove a proto file from a java lib, ensure the generated source
      is not included.
Change-Id: If7529979de6fa62a651933a3a974f47b033851d6
2016-12-22 10:37:31 -08:00
Joe Onorato
c05a8eec4b Add streaming proto option to the build system.
Test: make w/ other prereq changes
Change-Id: Ie8711878e244074a9a3c128467eeb4908c2ef008
2016-10-13 16:34:07 -07:00
Dan Willemsen
121e284b46 Fix link_type checking
This was printing "error:", but not actually triggering an error.
Instead of trying to write a single line bash script to handle this,
move the actual check into python. This allows us to print all of the
errors for a single module before triggering the failure.

Also updates the warning format and the warn.py script to properly parse
these warning. Many of the java:sdk -> java:platform warnings are false
positives due to the lack of LOCAL_SDK_VERSION markings on prebuilts.

Individual tags can be marked as warnings now, which lets us check for
system libraries linking against vendor libraries (which won't work on
AOSP). I'm not sure this is a completely valid check, which one reason
that it's just a warning.

Test: m all_link_types (with some missing libs commented out)
Change-Id: I333e418c9a4511b7c7e826891ae481da08fbf6f9
2016-09-15 14:40:39 -07:00
Dan Willemsen
720a966ce5 Merge \"Extend SDK link check to java libraries\"
am: e706372ba1

Change-Id: Ia4cb9cfe94da5bdccce8726ed8777de13638bada
2016-07-11 20:27:08 +00:00
Dan Willemsen
62dfb591b1 Extend SDK link check to java libraries
Java code using the SDK should not link to java code built with the
platform APIs or the system SDK. Java code using the system SDK should
not link to the platform APIs either, but it can link to java code using
another SDK.

Change-Id: Iaae0a7e01993cfa1e023649fbd8a7974b5eca709
2016-07-09 04:42:15 +00:00
Ying Wang
b05161e1ec Merge "Warn if there is file with unknown suffix in Java module\'s sources." am: 85b9117
am: 0c1d51d

* commit '0c1d51db71da93a39e548a8b3c38e13f6918d9dd':
  Warn if there is file with unknown suffix in Java module's sources.

Change-Id: Ice1362527118749cd1b4da459b04efadf56a560d
2016-04-27 17:03:36 +00:00
Ying Wang
f8d15d6f3f Warn if there is file with unknown suffix in Java module's sources.
This helps catch extra ) at the end of LOCAL_SRC_FILES.

Bug: 28389144
Change-Id: I0ab536b5bb47338ebf5bdf531835d58f527ccf67
2016-04-26 15:59:06 -07:00
Yohann Roussel
b6232d90da resolve merge conflicts of 995b62b to nyc-dev-plus-aosp
Change-Id: I4293e9f2777fb9b7e2023764703855ff3d778b40
2016-04-22 18:45:45 +02:00
Yohann Roussel
ae2fc81706 Remove bootclasspath handling for Jack
Bootclasspath libraries are already added in LOCAL_JAVA_LIBRARIES by
java.mk and host_dalvik_java_library.mk meaning that bootclasspath
handling was just doing a duplicate work and adding duplicated entries
to the classpath.

Also fix order of bootclasspath libraries for host.

Bug: 28307907
Change-Id: I6e98fc651a127435c029de65285dbf2cb04844af
2016-04-22 09:29:32 +02:00
Yohann Roussel
2dc79b11cd Remove static libraries from Jack classpath
Those libraries are already imported (or added to the classpath in the
case of the check command) meaning that they were all duplicated.
In addition to complicating the build this was also slowing down the
compilation.

Bug: 28307907
Change-Id: Ia8665e7c5ad8b567bd02de7839fa62e67a5668f7
2016-04-21 17:40:55 +02:00
Neil Fuller
eed17d84cc Add core-lambda-stubs to default classpath for target libs compiling using javac
In order to compile lambda code javac requires various invokedynamic-
related classes to be present. This change adds stubs needed for
javac to compile lambdas.

Bug: 27475234
Bug: 26753820
Bug: 26604040
(cherry picked from commit b08544ed7d)

Change-Id: Ie82600da21a9dbe2348e96aef1c5e966a7a1ef5a
2016-04-18 16:38:54 +01:00
Neil Fuller
b085b28a53 Merge "Add core-lambda-stubs to default classpath for target libs compiling using javac" into nyc-dev
am: 9109282

* commit '910928284650873748da35fac6f53d6fd25537b1':
  Add core-lambda-stubs to default classpath for target libs compiling using javac

Change-Id: I399cb0698857f0461351506fdc6330d909c8411f
2016-03-31 18:25:04 +00:00
Ying Wang
81ef4714f4 Merge commit '1f07720f8518236e8438ae0f25ea7211da8c8c45' into manual_merge_1f07720
Change-Id: I5ad50aacbe99b4ebf8ae7e630f169100128b5b3c
2016-03-31 10:10:42 -07:00
Ying Wang
858657366f Remove support of disabling Jack.
We removed code and variables related to running dx on classes.jar in
this change. Also removed target emma rules (but kept the emma rules for
host java libraries), for it's now done by Jack.
We still support to build classes.jar (and javalib.jar for static Java
libraries) using javac, because tools like javadoc need class files as
input.
Removed the obsolete install-dex-debug.

Bug: 27400061
Change-Id: If0bcdfe62cb181a98754fb0dbe1c12c92e38d3e8
2016-03-30 14:03:12 -07:00
Neil Fuller
b08544ed7d Add core-lambda-stubs to default classpath for target libs compiling using javac
In order to compile lambda code javac requires various invokedynamic-
related classes to be present. This change adds stubs needed for
javac to compile lambdas.

Bug: 27475234
Bug: 26753820
Bug: 26604040
Change-Id: Ifc79eebabfc6b64c0daf6b9ca236d1967a45a735
2016-03-30 11:01:33 -07:00
Ying Wang
6704f7e162 Merge "Set PRIVATE_TARGET_AAPT_CHARACTERISTICS even when running with the old aapt" into nyc-dev
am: 19b8145

* commit '19b81454479b2f6c438593304cd8c8f4c9ca77bc':
  Set PRIVATE_TARGET_AAPT_CHARACTERISTICS even when running with the old aapt

Change-Id: I4ebd15e849f5dd2c57c4e8679d140f184f999fa1
2016-03-29 21:39:28 +00:00
Ying Wang
6f9bd2a972 Set PRIVATE_TARGET_AAPT_CHARACTERISTICS even when running with the old aapt
In commit e758f9319d we switched from
TARGET_AAPT_CHARACTERISTICS to PRIVATE_TARGET_AAPT_CHARACTERISTICS in
add-assets-to-package but forgot to set the variable when we are running
the old aapt.

Bug: 27874886
Change-Id: I03ced3030dcb9f024eef5b23dbfd5d99157952ea
2016-03-29 12:41:42 -07:00
Neil Fuller
0e8ec505f6 Make the language version selection smarter
Any artifacts that are targeting SDK versions < 24
and not explicitly setting the LOCAL_JAVA_LANGUAGE_VERSION
are now defaulted to 1.7.

Bug: 27495650
Bug: 26753820
Bug: 27377071
(cherry-picked from commit decb797276)

Change-Id: I0734b6e690bea32def3dc435c9ce0bd90b845e79
2016-03-14 11:40:01 +00:00
Neil Fuller
d7737f19c5 resolve merge conflicts of e82f56c4f7 to nyc-dev-plus-aosp
Change-Id: I7b673e680240d0a597af971b6d903327875c4734
2016-03-10 10:00:14 +00:00
Neil Fuller
e82f56c4f7 Merge "Make the language version selection smarter" into nyc-dev 2016-03-10 09:45:55 +00:00
Neil Fuller
decb797276 Make the language version selection smarter
Any artifacts that are targeting SDK versions < 24
and not explicitly setting the LOCAL_JAVA_LANGUAGE_VERSION
are now defaulted to 1.7.

Bug: 27495650
Bug: 26753820
Bug: 27377071
Change-Id: Ia903cd5bf14c1947c485384d095a93c0aa23d272
2016-03-08 13:56:49 +00:00
Ying Wang
ea04f821fc Align up java-lib-files and java-lib-deps.
- For host Java libraries, java-lib-files should return javalib.jar.
- Host dalvik Java libraries are special: factor out
  host-dex-java-lib-files.
- Be explict that jack-lib-deps equals jack-lib-files.

Bug: 27451686
Change-Id: I9235384354e119ef7ebbf29b7e525d1ceea242e0
(cherry-pick from commit 063d0455e0)
2016-03-04 10:39:24 -08:00
Ying Wang
fef4f411d9 Align up java-lib-files and java-lib-deps.
am: 063d0455e0

* commit '063d0455e0f3a14f2577a26715f82e0bf3e79ee9':
  Align up java-lib-files and java-lib-deps.
2016-03-04 17:30:59 +00:00
Ying Wang
063d0455e0 Align up java-lib-files and java-lib-deps.
- For host Java libraries, java-lib-files should return javalib.jar.
- Host dalvik Java libraries are special: factor out
  host-dex-java-lib-files.
- Be explict that jack-lib-deps equals jack-lib-files.

Bug: 27451686
Change-Id: I9235384354e119ef7ebbf29b7e525d1ceea242e0
2016-03-03 13:48:43 -08:00
Ying Wang
ce7ea68394 Clean generated source dir if .proto/.rs is gonee.
Similar to how we clean the generated source dir if .aidl becomes
obsolete.

Bug: 26688474
Change-Id: I66c5b6d6513259b5f4f4bac84f384f4bf953d82a
(cherry-pick from commit d5ffec9383)
2016-03-02 10:59:59 -08:00
Ying Wang
489af869c7 Merge "Clean generated source dir if .proto/.rs is gonee." into nyc-dev
am: bfffd93a02

* commit 'bfffd93a02fed91e98373524677c98482adba893':
  Clean generated source dir if .proto/.rs is gonee.
2016-03-02 18:24:05 +00:00
Ying Wang
d5ffec9383 Clean generated source dir if .proto/.rs is gonee.
Similar to how we clean the generated source dir if .aidl becomes
obsolete.

Bug: 26688474
Change-Id: I66c5b6d6513259b5f4f4bac84f384f4bf953d82a
2016-03-01 22:22:43 -08:00
Nicolas Geoffray
d7e28fa261 Merge "Check LEGACY_USE_JAVA7 before using 1.8." am: 239783a7ff
am: efe15f7429

* commit 'efe15f7429bf235437587994c6c45fc8c4682fab':
  Check LEGACY_USE_JAVA7 before using 1.8.
2016-02-29 12:30:53 +00:00
Nicolas Geoffray
8d772e26b4 Check LEGACY_USE_JAVA7 before using 1.8.
Fixes current bots not updated to Java8 yet.

Change-Id: I61f5a3f0de6ca0ee9eca64f0ee08454f93e59704
2016-02-29 12:08:42 +00:00
Neil Fuller
db47d66b5e Change the default for LOCAL_JAVA_LANGUAGE_VERSION from 1.7 to 1.8
Modify the compiler flags for Jack and javac.

This has the following effects:
1) Generally, some of the type inference rules changed.
2) javac: bytecode is generated with the v52 major version (not v51)
3) jack: Java 8 language features are supported.

The javac / dx toolchain does not support Java 8 language features.

Bug: 26753820
(cherry picked from commit fda1ace26116a6677cc77c92c24e5259817fb86e)

Change-Id: I07769de473775d95b13feb38c0eb37086eb120f7
2016-02-26 14:56:38 +00:00
Neil Fuller
3f7300147d Revert "Revert "Change the default for LOCAL_JAVA_LANGUAGE_VERSION from 1.7 to 1.8""
This reverts commit 799d603029.
2016-02-23 12:55:23 +00:00
Neil Fuller
5ae8b0bad2 Merge "Revert "Change the default for LOCAL_JAVA_LANGUAGE_VERSION from 1.7 to 1.8"" into nyc-dev 2016-02-23 10:24:40 +00:00
Neil Fuller
799d603029 Revert "Change the default for LOCAL_JAVA_LANGUAGE_VERSION from 1.7 to 1.8"
Reverting: broke the messaging app due to a recent change
there (commit 280a2fbe41f24eed11fcf5e13b803de17525b261).

This reverts commit dfcd912488.

Change-Id: I055f35c0a7400ab2887c91d017eebaed1adaf972
2016-02-23 10:18:42 +00:00
Neil Fuller
d919cd6509 Merge "Change the default for LOCAL_JAVA_LANGUAGE_VERSION from 1.7 to 1.8" into nyc-dev 2016-02-23 09:47:35 +00:00
Yohann Roussel
b7de0fb1ed Add support for testing obfuscated app with Jack
Bug: 17481317
Bug: 27215871
Bug: 27215868

(cherry picked from commit 505dafb03b)

Change-Id: Ia12fb92585cfcc595eef6cd096d27e779e596f7d
2016-02-22 11:51:54 +01:00
Yohann Roussel
505dafb03b Add support for testing obfuscated app with Jack
Bug: 17481317

Change-Id: I80cb4e3991e858a39e7415fb7f1896d6992c950f
2016-02-17 16:01:58 +00:00
Neil Fuller
dfcd912488 Change the default for LOCAL_JAVA_LANGUAGE_VERSION from 1.7 to 1.8
Modify the compiler flags for Jack and javac.

This has the following effects:
1) Generally, some of the type inference rules changed.
2) javac: bytecode is generated with the v52 major version (not v51)
3) jack: Java 8 language features are supported.

The javac / dx toolchain does not support Java 8 language features.

Bug: 26753820
Change-Id: Icf619f601def30600a42a70815fc8cc754eafa8a
2016-02-16 13:04:51 +00:00