Commit Graph

262 Commits

Author SHA1 Message Date
Dan Willemsen 7586773bc5 am 3cf749c7: am c98d9a9d: am f1c09d7f: Merge "Add HOST_CROSS_OS"
* commit '3cf749c78a7d97ed41b0a8f3ee3598738d6d543d':
  Add HOST_CROSS_OS
2015-09-09 18:37:20 +00:00
Dan Willemsen f1c09d7fbd Merge "Add HOST_CROSS_OS" 2015-09-09 18:13:21 +00:00
Dan Willemsen 057aaea54a Add HOST_CROSS_OS
Instead of using recursive make to change the HOST_OS when building the
windows SDK under linux, add the concept of cross-building to another
host os.

Bug: 23566667
Change-Id: I6dc525b601b6251d458d197c30bf4660d7485502
2015-09-09 18:12:29 +00: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
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 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 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
Dan Willemsen bebe2a340f am 00cf9d50: am 399c59f3: am d5deac8d: Merge "Add _(darwin|linux|windows)"
* commit '00cf9d5008b2f54a4d82a997016cb827643c1193':
  Add _(darwin|linux|windows)
2015-08-28 19:03:00 +00:00
Dan Willemsen 399c59f3aa am d5deac8d: Merge "Add _(darwin|linux|windows)"
* commit 'd5deac8db951ec0a1c9edd806ea1758b836f8c46':
  Add _(darwin|linux|windows)
2015-08-28 03:49:01 +00:00
Dan Willemsen 7a5498568f Add _(darwin|linux|windows)
So that we can support building both linux and windows binaries at the
same time on a linux host. This replaces the ifeq($(HOST_OS),...) checks
in Android.mk files.

Bug: 23566667

Change-Id: I693e11984e36d55bb6f09fa0d49bc485463e16fb
2015-08-28 03:36:22 +00:00
Ying Wang 2f0207ee64 am 7e3ba1b7: am 8a3241e3: am 11a38e7a: Merge "Support LOCAL_INIT_RC."
* commit '7e3ba1b7a735d413f21d2133d53950a580cab0b9':
  Support LOCAL_INIT_RC.
2015-08-20 21:43:33 +00:00
Ying Wang 7e3ba1b7a7 am 8a3241e3: am 11a38e7a: Merge "Support LOCAL_INIT_RC."
* commit '8a3241e39ad541666aeff291b088e7277b5519ca':
  Support LOCAL_INIT_RC.
2015-08-20 21:00:14 +00:00
Ying Wang 4270d91bbe am 8a3241e3: am 11a38e7a: Merge "Support LOCAL_INIT_RC."
* commit '8a3241e39ad541666aeff291b088e7277b5519ca':
  Support LOCAL_INIT_RC.
2015-08-20 21:00:07 +00:00
Ying Wang 8a3241e39a am 11a38e7a: Merge "Support LOCAL_INIT_RC."
* commit '11a38e7a9164bc3268344ce716c4bd12b08cb05c':
  Support LOCAL_INIT_RC.
2015-08-20 20:53:32 +00:00
Ying Wang 9fe15ac757 Support LOCAL_INIT_RC.
A module can install a companion init.rc file,
by specifying:
LOCAL_INIT_RC := <init.rc-file-path-replative-to-LOCAL_PATH>
You can also use the variant with _32 or _64 suffix.

Bug: 23186545
Change-Id: I00a96509f5707ae39361a0c5555fa59d46c90322
2015-08-20 12:15:15 -07:00
Stuart Scott 8fe4bc780b Copy dynamic config files to compatibility output.
Change-Id: I6a92f125738eebce86f20183516e6900fca9f0cc
2015-08-18 14:31:08 -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
Yohann Roussel b3b6348921 Revert "Clean call-jack and its callers"
This reverts commit 4c1fc77c2e.

Change-Id: I4f5e3ec1e6fea66f315a9411db17de257817dcc9
2015-07-21 16:45:51 +00:00
Yohann Roussel 4c1fc77c2e 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: I5dce864624e97c27441a5ee7f8c3cd582613390e
2015-07-21 00:22:45 +02:00
Yohann Roussel 5863a7cf63 Revert "Clean call-jack and its callers"
This reverts commit 5e50b34221.

Change-Id: Ibf76cc454994c7ad84128ac923d39794d46a04ec
2015-07-04 12:11:09 +00:00
Yohann Roussel 5e50b34221 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.

Change-Id: I28b5f7176747853ef707b8d4055017bf60296641
2015-07-03 11:58:38 +02:00
Ying Wang f642334f36 Fix cts_testcase_config rule.
Bug: 21997856
Change-Id: I63af363f215a48430ca98e4968f9d37f40dea52e
2015-06-23 10:15:00 -07:00
Ying Wang 562d700ab9 Make AndroidTest.xml optional.
Make AndroidTest.xml optional for compatibility suite module.

Change-Id: I6622e17191fa67b33c577056681b989516f3a3a8
2015-06-04 11:22:23 -07:00
Ying Wang 1624361d84 Add support for LOCAL_COMPATIBILITY_SUITE
A module can specify itself to be a Compatibility Suite module with:
LOCAL_COMPATIBILITY_SUITE := <cts-name>
<cts-name> can be "cts" or any other cts name supported by the
build system.

The cts name's config.mk must define global variable
COMPATIBILITY_TESTCASES_OUT_<cts-name> to point to the testcase
output directory.
This change copies the module's built file, as well as the module's
AndroidTest.xml, to the testcase output directory.
The build system collects all the testcase files in a global variable
COMPATIBILITY.<cts-name>.FILES, which you can reference in a build
task that builds the suite's zip package.
Also copy over the test case files if user runs mm/mmm/etc.

Change-Id: Ica0dbc4f193db7de7d395b9c686733bdac41f566
2015-06-03 16:21:12 -07:00
Ying Wang abffa466cc am b7e6e8bb: Merge "Support to configure and build multiple custom images."
* commit 'b7e6e8bb6d00dc2677b297e548aff92f97066ab5':
  Support to configure and build multiple custom images.
2015-06-03 17:11:10 +00:00
Ying Wang 4540a85dd4 Support to configure and build multiple custom images.
Build additional images requested by the product makefile.
This script gives the ability to build multiple additional images and
you can configure what modules/files to include in each image.
1. Define PRODUCT_CUSTOM_IMAGE_MAKEFILES in your product makefile.
   PRODUCT_CUSTOM_IMAGE_MAKEFILES is a list of makefiles.
   Each makefile configures an image.
   For image configuration makefile foo/bar/xyz.mk, the built image
   file name
   will be xyz.img. So make sure they won't conflict.
2. In each image's configuration makefile, you can define variables:
  - CUSTOM_IMAGE_MOUNT_POINT, the mount point, such as "oem", "odm"
    etc.
  - CUSTOM_IMAGE_PARTITION_SIZE
  - CUSTOM_IMAGE_FILE_SYSTEM_TYPE
  - CUSTOM_IMAGE_DICT_FILE, a text file defining a dictionary
    accepted by BuildImage() in tools/releasetools/build_image.py.
  - CUSTOM_IMAGE_MODULES, a list of module names you want to include
    in the image; Not only the module itself will be installed to proper
    path in the image, you can also piggyback additional files/directories
    with the module's LOCAL_PICKUP_FILES.
  - CUSTOM_IMAGE_COPY_FILES, a list of "<src>:<dest>" to be copied to
    the image. <dest> is relativ to the root of the image.

To build all those images, run "make custom_images".

Bug: 19609718
Change-Id: Ic73587e08503a251be27797c7b00329716051927
(cherry picked from commit 5fcf1094f9)
2015-06-03 09:56:29 -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 131dd54c19 Merge "Data-binding integration." 2015-05-15 20:14:05 +00:00
Ying Wang c25390f274 am 42d4401a: am 9db69c1b: Merge "Add task to print transitive dependencies and their license files."
* commit '42d4401a87859219bc53e5b4cf8e80a37b4d3e0e':
  Add task to print transitive dependencies and their license files.
2015-05-07 23:17:29 +00:00
Ying Wang 39b9b690a8 Add task to print transitive dependencies and their license files.
Print modules and their transitive dependencies with license files.
To invoke, run
"make deps-license PROJ_PATH=<proj-path-patterns> DEP_PATH=<dep-path-patterns>".
PROJ_PATH restricts the paths of the source modules;
DEP_PATH restricts the paths of the dependency modules.
Both can be makefile patterns supported by makefile function $(filter).
Example:
  $ make deps-license packages/app/% external/%
  prints all modules in packages/app/ with their dpendencies in external/.
The printout lines look like "<module_name> :: <module_paths> :: <license_files>".

Bug: 20823995
Change-Id: I06b66e85ff56c8628bffa3d948085ed45870100f
2015-05-07 15:43:01 -07:00
Ying Wang ed0361f1d3 Data-binding integration.
- Set up LOCAL_JAVACFLAGS to run annotation processing.
- Set up a new intermediate directory $(data_binding_intermediates) to
  contain data-binding intermediate files.
- The annotation generated code is generated to
  $(data_binding_intermediates)/anno-src. The code will be automatically
  included by javac, so no need to store it in
  $(LOCAL_INTERMEDIATE_SOURCE_DIR).
- Set up rules to run DATA_BINDING_COMPILER. The generated code will be
  put in $(LOCAL_INTERMEDIATE_SOURCE_DIR)/data-binding, so that it can
  be automatically included by $(compile-java); Other generated files
  are put in in subdirs of $(data_binding_intermediates). The generated
  resource dir replaces the app's original LOCAL_RESOURCE_DIR.

Also fixed transform-jar-to-jack on prebuilt aar.

Bug: 19945740
Change-Id: I42d9b0e5cd48cf2dce4488298a960b3c95602beb
2015-04-29 18:24:42 -07:00
Ying Wang 5fcf1094f9 Support to configure and build multiple custom images.
Build additional images requested by the product makefile.
This script gives the ability to build multiple additional images and
you can configure what modules/files to include in each image.
1. Define PRODUCT_CUSTOM_IMAGE_MAKEFILES in your product makefile.
   PRODUCT_CUSTOM_IMAGE_MAKEFILES is a list of makefiles.
   Each makefile configures an image.
   For image configuration makefile foo/bar/xyz.mk, the built image
   file name
   will be xyz.img. So make sure they won't conflict.
2. In each image's configuration makefile, you can define variables:
  - CUSTOM_IMAGE_MOUNT_POINT, the mount point, such as "oem", "odm"
    etc.
  - CUSTOM_IMAGE_PARTITION_SIZE
  - CUSTOM_IMAGE_FILE_SYSTEM_TYPE
  - CUSTOM_IMAGE_DICT_FILE, a text file defining a dictionary
    accepted by BuildImage() in tools/releasetools/build_image.py.
  - CUSTOM_IMAGE_MODULES, a list of module names you want to include
    in the image; Not only the module itself will be installed to proper
    path in the image, you can also piggyback additional files/directories
    with the module's LOCAL_PICKUP_FILES.
  - CUSTOM_IMAGE_COPY_FILES, a list of "<src>:<dest>" to be copied to
    the image. <dest> is relativ to the root of the image.

To build all those images, run "make custom_images".

Bug: 19609718
Change-Id: Ic73587e08503a251be27797c7b00329716051927
2015-03-13 16:48:02 -07: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
Yohann Roussel 9d528c778b Merge "Engage Jack incremental on demand" 2015-02-05 11:01:22 +00:00
Yohann Roussel 4283c36732 Merge "Simplify handling of ANDROID_JACK_* variables" 2015-02-05 08:37:42 +00: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
Yohann Roussel 2809666941 Simplify handling of ANDROID_JACK_* variables
This concerns ANDROID_JACK_VM, ANDROID_JACK_VM_ARGS and
ANDROID_JACK_EXTRA_ARGS.

Change-Id: Iba75ecaaceb09ac9607a3aee41324d9f5ae4beef
2015-02-03 12:37:09 +01:00
Ying Wang 6bcc01a812 Allow to build resource only Java module.
Change-Id: I0ccce1f3e336fe25d3b36471664042d1f144c74a
2015-02-02 15:33:31 -08:00
Ying Wang 833b427d72 Explicit dependency on hostdex classes.jar.
Previously for hostdex Java libraries, we set up dependency on only
javalib.jar, which in turn is dependent on classes.jar.
But when jack is enabled there is no dependency of javalib.jar on
classes.jar. In commit b4c49cba57 classes.jar was universally added to
all host java library dependencies. That's unnecessary.

This change adds explicit dependency on classes.jar only for hostdex
modules.

On the other hand, if we switch checked module to $(full_classes_jack),
like what we did in commit 8bc90fd2d6, we won't need this to fix jack
build either, because classes.jar isn't needed when you run checkbuild.

Change-Id: I92c0e4d621d266f6e6914ab2b4f20e5531af070f
2015-01-21 17:30:21 -08: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
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
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
Ying Wang 634f7992f0 Use ALL_MODULES.$(m).INSTALLED in modules-for-tag-list
Previously we store tag's installed modules in a separate variable
ALL_MODULE_TAGS.$(tag). However we only record the main installed file
for a module, but omit affiliated files like .odex.
With this change, we handle the tagged module the same way as modules in
PRODUCT_PACKAGES.

Change-Id: I7972528a4df5a4ba8bc98930864da9672d32d7fe
2014-11-18 12:48:07 -08: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 1c869bc536 am fc6d5b6a: Allow to add jar resource or manifest even without Java code.
* commit 'fc6d5b6a947fa80061778639290c0241b93635b4':
  Allow to add jar resource or manifest even without Java code.
2014-10-01 01:48:43 +00:00
Ying Wang fc6d5b6a94 Allow to add jar resource or manifest even without Java code.
Change-Id: I2d8fd93f004d9e0c29c71b887810b2624769789e
2014-09-30 17:32:58 -07:00
Ying Wang dc050b7b98 am a953de3f: am 326363b8: Merge "java_alternative_checked_module takes precedence."
* commit 'a953de3f01b3c3428e133b14bad0662b4adc901d':
  java_alternative_checked_module takes precedence.
2014-09-30 04:17:12 +00:00