Commit Graph

161 Commits

Author SHA1 Message Date
Yohann Roussel 8bc90fd2d6 Use Jack to check build
Of modules that are to be compiled with Jack.

Change-Id: Ie8bd00f67f09c0e5ed8fe650f5131a3dfc29e277
2015-01-15 11:23:38 +01:00
Yohann Roussel 138768c1bb Remove some useless depencies
... from dexes to jars. This should allow to build less jars when
building dex files with Jack and Jill.

Change-Id: Ib3a717251e3bec3cc73564c205eb908ba1ef380f
2015-01-13 17:05:36 +01:00
Yohann Roussel 22c3fa6d73 Adapt to Jack and Jill Brest release
Includes cherry-picks of:
2e78d2f4263bc7c0f90d58af7014017f16aa3ce6 Jack option --import-res was renamed --import-resource
fdc913ee86fe0c45581178b901a673fdd7937e03 Update references to Jack type collison policy
8d83d1b21ec678fb9fb1c6ee643ace46d5f700ce Rename jill tmp file
8a1c98ce4ba0b4db39f274d6258b6a08bbc3ec2c Ensure that jar-arg-list is never shared
8d83d1b21ec678fb9fb1c6ee643ace46d5f700ce Remove manipulations of jack libraries

Change-Id: I3ee159d408ba5281ac15c9836dc4fd2bdeb845d3
2014-12-10 15:41:56 +01:00
Yohann Roussel b4c49cba57 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_USE_JACK:=true # false
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.

Change-Id: Ib81a0fd5f86a51d1e0edbb81cc791d828a05dd29
2014-12-02 18:11:13 +01:00
Dan Albert 6da20991fd am 5245bc8b: am 201f6b3e: Merge "Make modules depend on their makefile."
* commit '5245bc8b3421b3a9676a9ad650d0804d8d9e2787':
  Make modules depend on their makefile.
2014-11-11 23:00:40 +00:00
Dan Albert 5245bc8b34 am 201f6b3e: Merge "Make modules depend on their makefile."
* commit '201f6b3e92a2ef2f3a117f33cd399d5304dd385a':
  Make modules depend on their makefile.
2014-11-11 22:56:01 +00:00
Dan Albert 954b5bdcf4 Make modules depend on their makefile.
This should obviate much of the need for cleanspecs, and also make it
unnecessary to continue adding LOCAL_ADDITIONAL_DEPENDENCIES for this
sort of thing all over the tree.

Change-Id: I97aa8fd280ae868a5f6364f8b7bf3c2fe235d6ce
2014-11-11 14:30:54 -08:00
Ying Wang f4053c70e4 am 007026f0: am 3fe170c5: Merge "Add support for prebuilt AARs." into lmp-mr1-ub-dev
* commit '007026f0ebf2216d875b9fdab44cc68b659e2307':
  Add support for prebuilt AARs.
2014-11-03 18:11:53 +00:00
Ying Wang 007026f0eb am 3fe170c5: Merge "Add support for prebuilt AARs." into lmp-mr1-ub-dev
* commit '3fe170c51ea1eca253164fa8738ab42b5b9aaa6b':
  Add support for prebuilt AARs.
2014-11-03 18:07:45 +00:00
Nick Kralevich 0a5105bd25 am e4cbc2af: Merge "Revert "Add support for prebuilt AARs."" into lmp-mr1-ub-dev
* commit 'e4cbc2af5f476d9eb875253584260bed807acddf':
  Revert "Add support for prebuilt AARs."
2014-11-02 16:53:29 +00:00
Ying Wang e9dd9f2bfc Add support for prebuilt AARs.
- You can give a .aar as source file to a prebuilt static Java library
  module. The build system will set up dependencies and rules to extract
  classes.jar and other resource files.
- To build against a prebuilt AAR module, use:
  LOCAL_STATIC_JAVA_AAR_LIBRARIES := <module names of aar prebuilt AARs>
  The build system will set up rules to merge the library's
  AndroidManifest.xml with the main AndroidManifest.xml, add the AAR's
  resource dirs and link/merge the AAR's classes.jar.

Bug: 18168693
Change-Id: Ic2c1d20572a93bd98dbc72f8a39e26b459e442c2
2014-11-02 16:51:49 +00:00
Nick Kralevich 36fd476843 Revert "Add support for prebuilt AARs."
master doesn't compile anymore.

This reverts commit f567292504.

Change-Id: Icc16fe5360d1222740b803e9dd006081e3c66e46
(cherry picked from commit bcf8683b29)
2014-11-02 05:26:14 +00:00
Nick Kralevich bcf8683b29 Revert "Add support for prebuilt AARs."
master doesn't compile anymore.

This reverts commit f567292504.

Change-Id: Icc16fe5360d1222740b803e9dd006081e3c66e46
2014-11-02 05:11:11 +00:00
Ying Wang df95d8c1f7 am 4ef8133a: am f5672925: Add support for prebuilt AARs.
* commit '4ef8133a421dd92c6feb0508bc2274f12576cfd2':
  Add support for prebuilt AARs.
2014-10-31 00:20:31 +00:00
Ying Wang 4ef8133a42 am f5672925: Add support for prebuilt AARs.
* commit 'f56729250448200834c5c95c86c937e887d73623':
  Add support for prebuilt AARs.
2014-10-31 00:13:50 +00:00
Ying Wang f567292504 Add support for prebuilt AARs.
- You can give a .aar as source file to a prebuilt static Java library
  module. The build system will set up dependencies and rules to extract
  classes.jar and other resource files.
- To build against a prebuilt AAR module, use:
  LOCAL_STATIC_JAVA_AAR_LIBRARIES := <module names of aar prebuilt AARs>
  The build system will set up rules to merge the library's
  AndroidManifest.xml with the main AndroidManifest.xml, add the AAR's
  resource dirs and link/merge the AAR's classes.jar.

Bug: 18168693
Change-Id: I478913d5d498f800b322529d7c2c2c0ea78425e5
2014-10-29 23:40:52 +00:00
Jeff Davidson 79ddea19f6 am 4e466096: am ed9981d9: am 427d1e98: Merge "Pull in latest protolib when using LOCAL_PROTOC_OPTIMIZE_TYPE."
* commit '4e4660961b6c704d13c6c521f36958f436ec40f3':
  Pull in latest protolib when using LOCAL_PROTOC_OPTIMIZE_TYPE.
2014-10-29 20:52:18 +00:00
Jeff Davidson ed9981d927 am 427d1e98: Merge "Pull in latest protolib when using LOCAL_PROTOC_OPTIMIZE_TYPE."
* commit '427d1e98eceb78f5cb8f1e50d00d342fc7f359c6':
  Pull in latest protolib when using LOCAL_PROTOC_OPTIMIZE_TYPE.
2014-10-29 17:40:05 +00:00
Jeff Davidson b8ddd55b55 Pull in latest protolib when using LOCAL_PROTOC_OPTIMIZE_TYPE.
If a module is explicitly depending on a versioned protolib, we strip
the dependency and log a warning so the unneeded dependency can be
removed.

Change-Id: I949d32fb5126f1c05e2a6ed48f6636a4a9b15a48
2014-10-23 07:20:16 -07:00
Ying Wang 2fee3a8659 Allow to build libcore in PDK build.
Change-Id: Ice40f19dd3302378daa9bd4c4ecd2c1d2c7ff284
2014-10-17 18:26:39 -07:00
Mark Renouf ba19802001 am 0ab5cc6b: am 99332f11: Allow for opt-in of proguard shrinking of tests with new flag
* commit '0ab5cc6b8e04e0a07778f3c620a9edac3a40bc4e':
  Allow for opt-in of proguard shrinking of tests with new flag
2014-09-10 07:01:07 +00:00
Mark Renouf 99332f11c5 Allow for opt-in of proguard shrinking of tests with new flag
By adding 'shrinktests' to LOCAL_PROGUARD_ENABLED, the -dontshrink
flag will be omitted from the resulting proguard config allowing
tests to have unnecessary classes removed before dexxing.

Clockwork is running into 64k method limits on some tests which
depend on GmsCore. On 4.4W (klp-modular-dev) we don't have the
option for multi-dex so proguard is the only solution here.

This change leaves the default behavior unchanged. Shrinking is
still disabled for tests by default unless the 'shrinktests'
flag is set in the Makefile.

Change-Id: Ib586ae9e7f617072b41e95742559bf7c8a6a6ce1
2014-09-09 20:42:48 -04:00
Ying Wang efb935800b Support "LOCAL_SDK_VERSION := system_current"
A module can declare "LOCAL_SDK_VERSION := system_current" to build
against the android system stubs generated from source.
For now this is only supported in platform build.

Change-Id: I1e9bbd159886bc0ea3a02b1dc4cbcb1a56e9cb15
2014-07-19 17:00:50 -07:00
Yohann Roussel e019dfd721 Support dx generating multiple dex files.
Dx is now capable of generating multiple dex file in one run.
This capability is not compatible with --output=*.dex so this CL
changes the --output argument to be a directory. This CL also
includes the packaging of the multiple dex files when dx generates
more than one dex file.

(cherry picked from commit 8ffe9c3e79)

Conflicts:
        core/java.mk

Change-Id: I1ddc91b416de5929d4d4b41824c6012b32f94deb
2014-07-16 12:38:22 +02:00
Jeff Brown 4c4aa99ced Support more precise package exclusion from JAR files.
Allow LOCAL_JAR_PACKAGES to work on subpackages.  Previously it
only worked on top-level packages due to a bug in how the directories
were recursively deleted.

Add LOCAL_JAR_EXCLUDE_PACKAGES to allow specific subpackages to
be excluded.  This rule applies after LOCAL_JAR_PACKAGES has
selected which packages to include.  It may also be used independently.

Change-Id: Ibd0e495be1a20c84b59c9da132e92100ef3f8705
2014-05-23 18:41:19 -07:00
Yuncheol Heo 623d706253 Fix the path for findbugs.
Change-Id: I45485f1aeaf7fc3db2839f42829278d8c0ec97e3
2014-05-20 17:13:34 +09:00
Ying Wang a87489b5c2 am 74b71317: am 2d72094f: am 960d919e: resolved conflicts for merge of 4df82b3e to klp-dev-plus-aosp
* commit '74b71317711fe4bacc6422e45de599fea840f061':
  Allow proguarding the main app and the test app in a single run.
2014-02-10 12:51:36 +00:00
Ying Wang 960d919e81 resolved conflicts for merge of 4df82b3e to klp-dev-plus-aosp
Change-Id: I7a1d9e1954ede06a818814bd05a77c69f1ed3bc6
2014-02-08 10:31:46 -08:00
Mihail Dumitrescu 4df82b3e30 Allow proguarding the main app and the test app in a single run.
Bug: 12895101
Change-Id: I6804d73306a164d3e3ec0cab4743f9582b5ef2cf
2014-02-07 19:11:24 +00:00
Ying Wang 057375d783 am 03a06f41: am 9507a0fd: am 82c59aef: am 71e8a22e: Merge "Add DEXPREOPT support for ART"
* commit '03a06f4158e9eea9152f25286fcf2c30044d4e06':
  Add DEXPREOPT support for ART
2013-12-18 01:06:10 +00:00
Brian Carlstrom ced4bff58e Add DEXPREOPT support for ART
Change-Id: I24d0d7b2a23a769f5d69bd4dc14be22e1475b759
2013-12-17 14:44:00 -08:00
Stephen Hines 4e12f542be Add FORCE_BUILD_RS_COMPAT option.
This enables the .so libraries to be built for apps using the
RenderScript support library. Traditionally, we trim these .so
files from full platform builds.

Change-Id: I6f8e9b8d2b671338d3d5a5ac0bfcc60fd448688b
2013-11-27 14:54:15 -08:00
Stephen Hines c54e81c0df Add FORCE_BUILD_RS_COMPAT option.
This enables the .so libraries to be built for apps using the
RenderScript support library. Traditionally, we trim these .so
files from full platform builds.

Change-Id: I6f8e9b8d2b671338d3d5a5ac0bfcc60fd448688b
2013-09-30 15:57:36 -07:00
Ying Wang 3057adbace Drop the [no]proguard. prefix for the intermediate targets
Since we have enabled Progaurd for all build variants, we don't need the
different naming scheme along the path to make incremental build work
properly when you switch build variant.
As a result, this fixes the nothing-to-do-do-build-gets-something-build bug
introduced by the multi-dex change.

Change-Id: I907ff13091013d28910b0aa190b9218144385132
2013-09-12 17:50:11 -07:00
Ying Wang 7b7929ad38 Drop the [no]proguard. prefix for the intermediate targets
Since we have enabled Progaurd for all build variants, we don't need the
different naming scheme along the path to make incremental build work
properly when you switch build variant.
As a result, this fixes the nothing-to-do-do-build-gets-something-build bug
introduced by the multi-dex change.

Change-Id: I907ff13091013d28910b0aa190b9218144385132
2013-09-12 17:35:21 -07:00
Ying Wang 18c5126262 am 54e81f54: am 37b82aac: Skip compiling Java if an apk has no Java code.
* commit '54e81f546ccbb82b1b3a6d27026f8c58bd24731d':
  Skip compiling Java if an apk has no Java code.
2013-08-28 17:36:31 -07:00
Ying Wang 37b82aacd9 Skip compiling Java if an apk has no Java code.
Change-Id: Iee204e03ad5bc8ce5c3b4b3863c19c89184826e2
2013-08-28 17:28:36 -07:00
Ying Wang 664a236795 resolved conflicts for merge of 9915650b to master
Change-Id: Ice0f39a84363b76ea37801eb09a1d5cfd79d38fe
2013-08-28 14:45:37 -07:00
Ying Wang 53efca6c5b am 161aa74d: am 576e0146: Make it a fatal error if no source files for Java module.
* commit '161aa74de6aaa03d67f9dac10b71f15ebe728b3c':
  Make it a fatal error if no source files for Java module.
2013-08-28 14:06:41 -07:00
Ying Wang 990cf5e57d Better handle of need_compile_java.
Change-Id: I609a27e2b35b08962243b6516c6c525c0c938d3c
2013-08-28 14:05:20 -07:00
Ying Wang 576e0146a9 Make it a fatal error if no source files for Java module.
Change-Id: Ia04158c11381b6b1687b9d5c699a9ea8ae3cb317
2013-08-28 11:19:36 -07:00
Ying Wang e260b24cde am 670a7a63: am c5b72527: am ec3c15e5: am 04c4d34d: am 7311a344: Make it easier to enable obfuscation and optimization.
* commit '670a7a6389948c325399ae9bb3dc6a678f9982f8':
  Make it easier to enable obfuscation and optimization.
2013-08-23 10:20:28 -07:00
Ying Wang c5b72527d3 am ec3c15e5: am 04c4d34d: am 7311a344: Make it easier to enable obfuscation and optimization.
* commit 'ec3c15e5c7c11cf3a831898f286c7eb7c216e50f':
  Make it easier to enable obfuscation and optimization.
2013-08-23 10:12:26 -07:00
Ying Wang 7311a344be Make it easier to enable obfuscation and optimization.
With this change, use:
* LOCAL_PROGUARD_ENABLED := obfuscation  # to enable obfuscation
* LOCAL_PROGUARD_ENABLED := optimization # to enable optimization
* LOCAL_PROGUARD_ENABLED := obfuscation optimization # to enable both

Now the meaning of the LOCAL_PROGUARD_ENABLED options:
* full:
    Use the build system's default configurations:
    with shrink but no obfuscation or optimization,
    global proguard flags in build/core/proguard.flags
    are applied.
* custom:
    The same as "full" except no aapt-generated resource-related
    proguard flags.
* nosystem:
    Don't use any build system's default configurations; but
    aapt-generated proguard flags are still applied. You are
    responsible for any other flags.
* disabled:
    Disable proguard.
* obfuscation:
    The same as "full" but with obfuscation enabled.
* optimization:
    The same as "full" but with optimization enabled.
* no value (the default):
    The build system chooses the proper value: "full" if it's an
    app; "disabled" if it's a library.

You can use more than 1 of them in a meaningful combination,
for example:
LOCAL_PROGUARD_ENABLED := obfuscation optimization

Bug: 10307372
Change-Id: Id248caca3048e99547f16559fae74f4afe85c354
2013-08-22 17:12:38 -07:00
Yohann Roussel 400c48cc3b Merge "Support dx generating multiple dex files." 2013-08-22 08:31:14 +00:00
Yohann Roussel 8ffe9c3e79 Support dx generating multiple dex files.
Dx is now capable of generating multiple dex file in one run.
This capability is not compatible with --output=*.dex so this CL
changes the --output argument to be a directory. This CL also
includes the packaging of the multiple dex files when dx generates
more than one dex file.

Change-Id: I1ddc91b416de5929d4d4b41824c6012b32f94deb
2013-08-20 20:53:40 +02:00
Ying Wang a3b7593546 Support to optionally run rmtypedefs.
Bug: 10330586
Change-Id: I6ddfca2ec986cf2c82b0942b7a5360508f095e9a
2013-08-14 18:20:54 -07:00
Mike Lockwood c73018c2e9 Fix typo from previous change to fix the build
Change-Id: I6cf7217eb81abd794339143b7c23456b68808caf
2013-08-06 16:15:48 -07:00
Mike Lockwood 6e5d867e30 Add support for overriding default Java libraries on a per-target basis
Change-Id: I425041554867a7ed7d74e1d603f160b2110bc86b
2013-08-06 15:07:18 -07:00
Jeff Brown ae859f9b64 Split framework jar.
Change-Id: I38c68ac169a4ea10e4640b5d8e24298a6caaf441
2013-07-17 21:08:18 -07:00