Commit graph

224 commits

Author SHA1 Message Date
Ying Wang
702e01e258 Add LOCAL_FINDBUGS_FLAGS to support custom findbugs flags.
Use LOCAL_FINDBUGS_FLAGS to specify findbugs command line flags.
To use findbugs filters:
LOCAL_FINDBUGS_FLAGS := -exclude $(LOCAL_PATH)/exclude.xml -include \
                        $(LOCAL_PATH)/include.xml

where exclude.xml and include.xml are filter files.
The build system automatically adds the filter files as dependency of
findbugs' output xml.

Bug: 24948760
Change-Id: I82502c0ade910c5255001fa5f390316137ce0be6
2015-10-21 10:30:51 -07:00
Yohann Roussel
b68c9a498d Allow control of jack used for compilation
Version of Jack used to compile a module can now be control from
a dedicated mk located in prebuilts/sdk/tools

Bug: 24564814

Change-Id: Ie8120c97e0fa10953d4d015afd27aacfac80e5b6
2015-10-14 11:32:45 +02:00
Colin Cross
6dcda02e4c resolved conflicts for 5acaa9dc to master
Change-Id: Idbadd1127e9524b6ecb571cdc7338d106ca2be3f
2015-09-28 19:25:15 -07:00
Colin Cross
7ee3b85eba resolved conflicts for 953981db to stage-aosp-master
Change-Id: Ic1003a594ac5e5e91b124f249a569fb81123e973
2015-09-28 18:45:23 -07:00
Colin Cross
a4447e8c89 Don't add dependencies on Makefiles when using ninja
Ninja has an implicit dependency on the command being run, and kati will
regenerate the ninja manifest if any read makefile changes, so there is no
need to have dependencies on makefiles.
This won't catch all the cases where LOCAL_ADDITIONAL_DEPENDENCIES contains
a .mk file, because a few users of LOCAL_ADDITIONAL_DEPENDENCIES don't
include base_rules.mk, but it will fix the most common ones.

Bug: 23566977
Change-Id: I66de882421376303ab7233c8ce7274548f6b2199
2015-09-28 16:29:52 -07:00
Ying Wang
7bf30359c5 am 5a4ec4e8: am 3a3c21ca: am 094116f0: Merge "Remove the unnecessary rs_compatibility_jni_libs install rules."
* commit '5a4ec4e8c0d0f5fff856e14447b846eca94fc242':
  Remove the unnecessary rs_compatibility_jni_libs install rules.
2015-09-26 01:17:29 +00:00
Ying Wang
3a3c21cafb am 094116f0: Merge "Remove the unnecessary rs_compatibility_jni_libs install rules."
* commit '094116f0374da3dcba3ff1425f0cb42caf1c6d59':
  Remove the unnecessary rs_compatibility_jni_libs install rules.
2015-09-26 01:06:38 +00:00
Ying Wang
ac30b88dc4 Remove the unnecessary rs_compatibility_jni_libs install rules.
We only build rs_compatibility_jni_libs for unbundled build or when
FORCE_BUILD_RS_COMPAT is set. We don't need to install the
rs_compatibility_jni_libs to system.img in either case.

It's bad idea to install them to system.img, because when two modules
have .rs files with the same name, their installed files conflict.

Change-Id: I7524a301c59396db464f28b17b8f8bf1f15523ca
2015-09-25 16:14:57 -07:00
Ying Wang
90a25b95d5 am 6f2e72ec: am cbac8789: am af72e1b3: Merge "Move part of logtags stuff back to base_rules.mk."
* commit '6f2e72ec999e855c6ac215e6edced17a1d7f2e22':
  Move part of logtags stuff back to base_rules.mk.
2015-09-04 18:12:56 +00:00
Ying Wang
cbac87899b am af72e1b3: Merge "Move part of logtags stuff back to base_rules.mk."
* commit 'af72e1b3e68f449c81054bc25e655016529914e1':
  Move part of logtags stuff back to base_rules.mk.
2015-09-04 17:56:24 +00:00
Yasuhiro Matsuda
ff82e82a1e Move part of logtags stuff back to base_rules.mk.
Otherwise event tags for non-Java modules
(e.g. logcat, libsurfaceflinger) are not generated.

BUG: 23803975
Change-Id: I6fd53fe2ca39102787fc513aa8c23f906b94f253
2015-09-04 20:02:49 +09:00
Ying Wang
847b7503b6 am 08f82e9b: am 119cec9a: am 4e2f1903: Merge "Clean up Javac a little bit."
* commit '08f82e9b33185b3969e364648b22c9ead07d6c29':
  Clean up Javac a little bit.
2015-09-02 21:41:59 +00:00
Ying Wang
119cec9a4a am 4e2f1903: Merge "Clean up Javac a little bit."
* commit '4e2f190315759b4270ab414b9ff1e24a19521521':
  Clean up Javac a little bit.
2015-09-02 21:18:38 +00:00
Ying Wang
447d69678e Clean up Javac a little bit.
- Added GLOBAL_JAVAC_DEBUG_FLAGS and merge it to
  PRIVATE_JAVACFLAGS/PRIVATE_JACK_FLAGS to get rid of
  PRIVATE_JAVAC_DEBUG_FLAGS/PRIVATE_JACK_DEBUG_FLAGS.
- With Java rules out of base_rules.mk we can get rid
  of java_alternative_checked_module now.

Change-Id: I1a14716c785e3d49330a75044107662ce96a9307
2015-09-02 10:04:18 -07:00
Ying Wang
68ec6f60ec resolved conflicts for merge of 3ead0a7b to master
Change-Id: Id4a0e030a9ac9c5dad041493eafc97f91af8f7c5
2015-09-01 10:00:23 -07:00
Ying Wang
9bf627422c resolved conflicts for merge of a15ae216 to stage-aosp-master
Change-Id: I9c10cf2d10f4295d12edd490ff0f9482c1810bf8
2015-09-01 09:31:56 -07:00
Ying Wang
956dcccf76 Move Java stuff out of base_rules.mk
- Moved the target-only .aidl and .logtag rules to java.mk.
- Moved the .proto rules,  Java library dependency calculation,
  Java resource processing and Java-related
  target-specific and global variables setup to a new java_common.java,
  which is shared by both target and host Java modules.
- Minor cleanup for the moved code.

Bug: 23597357
Change-Id: Ic3eb72e26bb1a663e5739abe0a935f96b88bc352
2015-08-28 17:17:19 -07:00
Miao Wang
f0c021d9e8 am fbfa983a: am 88618b8e: am 73f967b7: am b7a3bc56: am fbf80e9d: Merge "[RenderScript] Only upgrade RS target API for compat build." into mnc-dev
* commit 'fbfa983a5923c306bb690a84f2dda12ce0eb4b64':
  [RenderScript] Only upgrade RS target API for compat build.
2015-07-29 22:04:18 +00:00
Miao Wang
13276144c2 am c2dd225a: am 473a832d: am 489d3ea7: am 1a30e036: am 302e944c: [RenderScript] Set RS_PREBUILT_LIBPATH for 64bit targets.
* commit 'c2dd225a9fdfb85a0de81389c471c074b870907f':
  [RenderScript] Set RS_PREBUILT_LIBPATH for 64bit targets.
2015-07-29 22:03:10 +00:00
Miao Wang
a11f6c2f0e [RenderScript] Only upgrade RS target API for compat build.
- Fix build

Bug: 22796994
Bug: 22693954
Change-Id: Iff91cc4691ea3e4cd8542cdf38245e2aa7724a71
2015-07-29 11:46:23 -07:00
Miao Wang
302e944c60 [RenderScript] Set RS_PREBUILT_LIBPATH for 64bit targets.
Bug: 22796994
Bug: 22693954

This change fixes the RS_PREBUILT_LIBPATH when used with 64-bit target
devices. It also fixes an issue where the target RenderScript API is
below 21 for 64-bit compilation. In those cases, we should always
upconvert it to 21 (since that is the first available 64-bit release).

Change-Id: I27e9d0bd5c01bac0b3b28e9002333264a55d628f
2015-07-28 19:30:20 -07:00
Yohann Roussel
23f78643b9 Clean call-jack and its callers
This is possible now that we have the new Jack server.
Also fix dependency from dex/jack target to jack script
instead of jack.jar.

(cherry picked from commit 5e50b34221)

Change-Id: I8e7aa5087ba8d73cc93140ddfca8f4ab2f505175
2015-07-22 15:22:22 +00:00
Ying Wang
4169f10c97 am b22469a8: am 65259743: Merge "Split [CC|CXX]_WRAPPER from [TARGET|HOST]_[CC|CXX]"
* commit 'b22469a8c50510e141a74932acc3fa17a9dd356c':
  Split [CC|CXX]_WRAPPER from [TARGET|HOST]_[CC|CXX]
2015-07-21 21:36:46 +00:00
Ying Wang
b22469a8c5 am 65259743: Merge "Split [CC|CXX]_WRAPPER from [TARGET|HOST]_[CC|CXX]"
* commit '65259743e45886a2941771716b92db91de35ea8c':
  Split [CC|CXX]_WRAPPER from [TARGET|HOST]_[CC|CXX]
2015-07-21 21:22:53 +00:00
Ying Wang
57d9060ffd Split [CC|CXX]_WRAPPER from [TARGET|HOST]_[CC|CXX]
- Don't overwrite [TARGET|HOST]_[CC|CXX] with the [CC|CXX]_WRAPPER prefix,
  so that we can disable the wrapper per module.
- Disable ccache on a module when FDO is enabled.

Bug: 22612634
Change-Id: Ibc04a4742d589955066c7eceb43a0da9a2b893bc
(cherry-pick from commit c671a7cf5c)
2015-07-21 14:07:50 -07:00
Ying Wang
c671a7cf5c Split [CC|CXX]_WRAPPER from [TARGET|HOST]_[CC|CXX]
- Don't overwrite [TARGET|HOST]_[CC|CXX] with the [CC|CXX]_WRAPPER prefix,
  so that we can disable the wrapper per module.
- Disable ccache on a module when FDO is enabled.

Bug: 22612634
Change-Id: Ibc04a4742d589955066c7eceb43a0da9a2b893bc
2015-07-20 21:26:53 -07:00
Ying Wang
742f5832b1 Raise progaurd library to platform libraries even for "current" SDK.
Without this change, if an app with "LOCAL_SDK_VERSION := current" links
against a static library that uses removed APIs, the app will fail
ProGuard processing because the removed APIs can't be found in the
current SDK. This works around the issue.

Bug: 18510449
Bug: 20667396
Change-Id: Ia6e2a81cf5ecba972d155e56238ea946f8539411
2015-06-26 19:37:28 +00:00
Yohann Roussel
b518c3ec0b [DO NOT MERGE] Add support for RMTYPEDEF with Jack
Bug: 21099584

(cherry-picked from commit 5b2c6e26db)

Change-Id: I39aa1f24780c216e978ef743098ca7ac65b2962e
2015-06-02 12:25:51 +02:00
Yohann Roussel
a9dd74c395 Merge "Add support for RMTYPEDEF with Jack" into mnc-dev 2015-06-02 09:36:27 +00:00
Yohann Roussel
5b2c6e26db Add support for RMTYPEDEF with Jack
Bug: 21099584
Change-Id: I39aa1f24780c216e978ef743098ca7ac65b2962e
2015-05-28 18:10:03 +02:00
Ying Wang
589e8c52fb Use TARGET_DEFAULT_JAVA_LIBRARIES instead of just framework.
- When raising the ProGuard sdk version for platform build, use
  TARGET_DEFAULT_JAVA_LIBRARIES instead of just framework.
- Also added SUPPORT_LIBRARY_ROOT to reference support library resource
  dir.

Bug: 20658265
Change-Id: Ib008d8e70508723db91431a062cac691367f2f6c
2015-05-19 16:03:57 -07:00
Yohann Roussel
f09e59eb52 [DO NOT MERGE] Compile using Jack.
This allows to compile dex targeted java sources using Jack and Jill.
Default is still to compile with the legacy toolchain. Default can be
switched to the new toolchain by setting environement variable:
export ANDROID_COMPILE_WITH_JACK=true
Toolchain can also be forced for one module by defining
LOCAL_JACK_ENABLED:=full # disabled, full, incremental
in the mk portion defining the module.

Jack execution environement can be controlled with:

Global variable ANDROID_JACK_VM allow to change the jvm executing Jack.
Global variable ANDROID_JACK_VM_ARGS allows to change default args given
to the jvm.
Global variable ANDROID_JACK_EXTRA_ARGS allows to define some default args
to give to Jack

LOCAL_JACK_VM_ARGS allows to override default args given to the jvm for
the module.
LOCAL_JACK_EXTRA_ARGS allows to override default args passed to Jack.

This includes cherry-picks of the following changes:
b4c49cba57
22c3fa6d73
138768c1bb
5dd3e1d312
83d5d04047
8bc90fd2d6
140274707e
0fbc9ff2a2
833b427d72
f9a27f45b4
2809666941
37822c443d
c6b44d43c3
d2a76c14bf
06744f60fc
95573d5036
b821391614
2794e7b582
801f2c44d0
c76d99dca1
f528e132d6
76a5e0bd1a
e25b3984ff Partially, only Jack related parts werekept
ec46a3b71f
abee3a9f41
77cbe10fd9
daf07db4cd
b6bfb5893a

Ie all Jack related changes untill
b6bfb5893a
except
a96cc59ab5 "Use Jack by default"

Change-Id: If9d47ef1c4fd1e6765ad2a47d816c1ad3cfab0e3
2015-05-19 18:31:05 +02:00
Ying Wang
4f5d0e60b4 Raise SDK version for ProGuard processing when app links support library.
When an app's LOCAL_SDK_VERSION is lower than the support library's
LOCAL_SDK_VERSION,  we artifically raises the "SDK version" "linked"
by ProGuard, to
- suppress ProGuard warnings of referencing symbols unknown to the
  lower SDK version.
- prevent ProGuard stripping subclass in the support library that
  extends class added in the higher SDK version.

This allows us to remove the dangerous ProGuard flag
"-dontwarn android.support.**".

Notes:
- We don't raise the app's LOCAL_SDK_VERSION, so that the app's own
  code is still unable to use the higher SDK version.
- For platform build, we can't just raise to the "current" SDK,
  because would break apps that use APIs removed from the current SDK.
  We raise it to framework.jar instead, which contains the most complete
  symbol set.

Bug: 20658265
Change-Id: I90099073457a65cb8031fbaec6b396d68ce614a7
(cherry picked from commit 8e8d1e7aba)
2015-05-05 17:35:12 +00:00
Yohann Roussel
77cbe10fd9 Use Jack launcher
Bug: 20132430
Change-Id: I6e30ad3dffbb32824a4c62e562359b084e6a8784
2015-04-15 12:29:01 +02:00
Ying Wang
11e923a0e5 am ea517854: am aacc8bb4: am 18ecae31: Merge "Convert bc depfiles to .P files."
* commit 'ea5178545bf939fb65f77cd54eba9f274512638b':
  Convert bc depfiles to .P files.
2015-04-04 01:49:47 +00:00
Ying Wang
b931956076 Convert bc depfiles to .P files.
So you don't need clean step when a header file gets moved or deleted.

Change-Id: Iec0d63b89ba17c4ef0ad75f4a52b6759f2bff58a
2015-04-03 16:55:09 -07:00
Ying Wang
301bd9341f am a840faef: am c35e7902: am 555b7770: Merge "Move the inclusion of depfile to where it\'s generated."
* commit 'a840faef517a196e235a197992e8feb9f13c27b7':
  Move the inclusion of depfile to where it's generated.
2015-04-03 17:39:56 +00:00
Ying Wang
cddece6f8f Move the inclusion of depfile to where it's generated.
Change-Id: Ib7ed6d7d9105e49961ac467fd1d390060d4f5c38
2015-04-03 09:53:41 -07:00
Miao Wang
bb5196e857 [Renderscript] making librsjni.so be packed with apks when
v8.renderscript is needed, even for bundled apps.

Bug: 19343399
Change-Id: I461e244be15e08d4525439bc042529314c84031e
(cherry picked from commit c919b0ba88)
2015-03-13 10:23:30 -07:00
Ying Wang
e25b3984ff Improved nothing-to-do-build
- Removed unnecessary dependency of
  "$(my_symlink) :  $(LOCAL_INSTALLED_MODULE)"
  We can generate symlink to nonexistent file.
  Actually in multilib build $(LOCAL_INSTALLED_MODULE) points to file
  that may not be the target file of the symlink and leads to always
  obsolete $(my_symlink) in the above dependnecy.
- Touch by-product in the dummy rule, to make sure the by-product is
  newer than the main-product.

Change-Id: I2f0e0cc197c49f920fa1f6794083b21cdc333c20
2015-02-26 18:47:21 -08:00
Yohann Roussel
d2a76c14bf Change built module of static java libraries
Set LOCAL_BUILT_MODULE of static java libraries when Jack is enabled
to classes.jack instead of javalib.jar.
This allows that running mm in those libraries will build classes.jack
instead of the jar.

Change-Id: I96b4b227848e971df96331b3f0cc731e856be349
2015-02-18 22:54:18 +01:00
Miao Wang
8b24d3bced Merge "[Renderscript] making librsjni.so be packed with apks when v8.renderscript is needed, even for bundled apps." 2015-02-13 17:56:52 +00:00
Miao Wang
c919b0ba88 [Renderscript] making librsjni.so be packed with apks when
v8.renderscript is needed, even for bundled apps.

Bug: 19343399
Change-Id: I461e244be15e08d4525439bc042529314c84031e
2015-02-12 17:07:31 -08:00
Yohann Roussel
c6b44d43c3 Force make to check date of classes.jack after Jack run
Bug: 19230260
Change-Id: Ibcbacd9e0630cd295ad262bd152fc070866071d2
2015-02-05 15:27:38 +01:00
Yohann Roussel
37822c443d Engage Jack incremental on demand
Each module may engage Jack incremental with

LOCAL_JACK_ENABLED := incremental

Include renaming of LOCAL_USE_JACK to LOCAL_JACK_ENABLED that is
now accepting 3 values "disabled", "full" and "incremental".

Change-Id: Icbff275b397bee36b29312e821f3e8d45f83fbcc
2015-02-04 11:22:26 +01:00
Ying Wang
33360dd569 Running jarjar on Java resources.
Before this change, Java resources are added as a separate step
(add-java-resources-to-package) after dex is run, so jarjar isn't run on
the resource files.
With this change, we add Java resources immediately after we call javac,
so jarjar is run on the resource files (the module's own resource, as
well as resources carried by static Java libraries).
When we generate the final apk/jar, we use the jarjar'ed jar as the
inital pacakge file, with class files and empty folders removed.

When jack is enabled, in jack-java-to-dex we add the Java resources to
a temp jar using the PRIVATE_EXTRA_JAR_ARGS, and extrac the files in a
temp dir. Jack will process the resource files and output the result to
PRIVATE_JACK_INTERMEDIATES_DIR. When we package the final apk/jar, we
need to call add-carried-jack-resources to readd the resources.
(TODO: if jack can output all resources to a jar/zip file, we can use
that file as the initial package file as well.)

Bug: 18837479
Change-Id: I8d7296e30ec8d005054cf04c4f2aed6d7a0d823b
2015-01-21 11:54:13 -08:00
Jean-Philippe Lesot
edacaa3a26 Merge "Revert "Use Jack to check build"" 2015-01-21 13:52:52 +00:00
Narayan Kamath
c1ed9796bb Revert "Running jarjar on Java resources."
This reverts commit 140274707e.

Breaks the build on uiautomator_compat.

Change-Id: I6d14f39e3432bf5e691027bbb8e7260e4bec8e8d
2015-01-21 11:04:22 +00:00
Ying Wang
140274707e Running jarjar on Java resources.
Before this change, Java resources are added as a separate step
(add-java-resources-to-package) after dex is run, so jarjar isn't run on
the resource files.
With this change, we add Java resources immediately after we call javac,
so jarjar is run on the resource files (the module's own resource, as
well as resources carried by static Java libraries).
When we generate the final apk/jar, we use the jarjar'ed jar as the
inital pacakge file, with class files and empty folders removed.

When jack is enabled, in jack-java-to-dex we add the Java resources to
a temp jar using the PRIVATE_EXTRA_JAR_ARGS, and extrac the files in a
temp dir. Jack will process the resource files and output the result to
PRIVATE_JACK_INTERMEDIATES_DIR. When we package the final apk/jar, we
need to call add-carried-jack-resources to readd the resources.
(TODO: if jack can output all resources to a jar/zip file, we can use
that file as the initial package file as well.)

Bug: 18837479
Change-Id: I15ecf282bfb65fd53dd03fbd03dd4c71927c186a
2015-01-20 11:46:59 -08:00
Jean-Philippe Lesot
0fbc9ff2a2 Revert "Use Jack to check build"
This reverts commit 8bc90fd2d6.

This CL also impacts standard targets. With Jack enabled, a global
'make' without that CL produce ~287 dex files, with this CL, it
produces ~697 dex files.

Bug: 19069325
Change-Id: I39853da0cba8226f31037733edc420507d76c8c0
2015-01-20 14:19:36 +00:00