Commit graph

224 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Ying Wang
8260562434 java_alternative_checked_module takes precedence.
java_alternative_checked_module takes precedence over
LOCAL_BUILT_MODULE.

Change-Id: I84f0d65dbc05f4686817aa835d003eb0101af146
2014-09-29 17:17:00 -07:00
Ying Wang
e4cd584e1b am 1d6f150e: am 8d856002: Merge "Don\'t modify LOCAL_CHECKED_MODULE."
* commit '1d6f150e3e3cce1788d0aea47d0aa8bef0f6df66':
  Don't modify LOCAL_CHECKED_MODULE.
2014-09-29 22:49:31 +00:00
Ying Wang
6c1d1cc712 Don't modify LOCAL_CHECKED_MODULE.
Use a temporary variable my_checked_module instead,
so that we don't override the 2nd_arch's checked module with the
1st_arch's in multilib build.
Note that by default we checkbuild 2nd_arch only for host modules,
but not for target modules.
We enable multlib for target modules by default, it would take too
much time to checkbuild for both archs. For 32-bit modules actually we
can checkbuild a 32-bit product.

Change-Id: I0a5ba75699225b7641442673483731a8fd360d61
2014-09-29 21:59:55 +00:00
Ying Wang
1425e2d8c0 Support LOCAL_PACKAGE_SPLITS.
Support LOCAL_PACKAGE_SPLITS, which accepts a list of resource lables
and generates multiple apks. The build system sets up rules to sign and
zipalign the split apks.

Bug: 16319961
Change-Id: I344b3d1c7eb158c6d0df879093d666a89870aadd
2014-07-22 17:37:11 -07: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
Ying Wang
af9757e849 New installation path for apks and their JNIs.
Apk's path is changed to <parent_dir>/MyApp/MyApp.apk;
JNI path is changed to <parent_dir>/MyApp/lib/<arch_name>/libfoo.so.
Symlinks of JNIs are changed accordingly.

Bug: 16319961
Change-Id: Ib3b2309c95fa9aea27837fcc29e28d990b04747b
2014-07-18 16:26:24 -07:00
Ying Wang
f951b7743f am 1c00c702: am 45322890: am d2aa51b8: Merge "Clean the last bit of LOCAL_BUILD_HOST_DEX."
* commit '1c00c7026c23967ca33524356dc11d9885f960f9':
  Clean the last bit of LOCAL_BUILD_HOST_DEX.
2014-07-08 00:31:00 +00:00
Ying Wang
1a5ada11d5 Auto-clean obsolete aidl-generated Java files.
The build system compares aidl files of every module to the previous
build and deletes the intermediate generated source dir if an aidl file
has gone.

Change-Id: I55fcfe1baaae3496613e12c20bca564d408bba58
2014-07-07 16:58:39 -07:00
Ying Wang
f25318a5f9 Clean the last bit of LOCAL_BUILD_HOST_DEX.
Long live LOCAL_BUILD_HOST_DEX!

Change-Id: I8de23cfc78edc554606a2e1a8a955e8bc3ad02b0
2014-07-07 17:15:38 -07:00
Ying Wang
a26a2123b8 am 7a6a9a55: am 4bdbd6d4: am e1b43254: Merge "Add --pseudo-localize aapt parameter for builds."
* commit '7a6a9a558271ac959a2e441fe27aae3df77d4421':
  Add --pseudo-localize aapt parameter for builds.
2014-06-27 16:24:46 +00:00
Igor Viarheichyk
c4dfe6ef30 Add --pseudo-localize aapt parameter for builds.
Some packages can override list of locales with
LOCAL_AAPT_INCLUDE_ALL_RESOURCES parameter, disabling
pseudolocalization. Adding new --pseudo-localize flag to
aapt if pseudo-locales are specified in product locales
list solves this issue.

Change-Id: Iae705d4fe99453650339fd1ca65d1005671b3e4f
2014-06-26 17:27:36 -07:00
Ying Wang
111ccebf30 am 995783d4: am 57befc90: am eb12847b: Merge "Switch another reference from core to core-libart"
* commit '995783d4fde29634e9c61379db5fedad0a232089':
  Switch another reference from core to core-libart
2014-06-24 10:38:49 +00:00
Brian Carlstrom
074151bdf3 Switch another reference from core to core-libart
Bug: 14298175
Change-Id: I37dc7d5bc63d967db4b3cb8aee695a40b12a8c8d
2014-06-23 15:34:17 -07:00
Brian Carlstrom
b1dafb1804 Switch from core to core-libart
Bug: 14298175
Change-Id: I1db40e7c67322d80a108b2b88e6d2e6d275d7898
2014-06-18 17:42:32 -07:00
Brian Carlstrom
55fa2ea206 resolved conflicts for merge of 8fd9944e to master
Change-Id: I1ceda92267675d4ca460b6f990c0acea4b4812a8
2014-06-18 19:25:30 -07:00
Ying Wang
74c9850c79 Explicit record the modules' built-file:installed-file
- This simplifies the logic to get the mapping of built-file to
  installed-file. Previously we used file suffix matching which is error
  prone and not scalable.
- With this change the .odex files will be included automatically.

Bug: 13585955
Change-Id: I4599abf93b9d501bac7aca7758d7f3aee21b3e36
2014-06-16 16:41:48 -07:00
Ying Wang
1dc4f0bace am 2bf10a72: am cdcb6926: am 6cb69bd4: Merge "Add HOST_PREFER_32_BIT to support 32-bit-by-default multilib build"
* commit '2bf10a72f87a8e97923286aa331f7db81e2361ca':
  Add HOST_PREFER_32_BIT to support 32-bit-by-default multilib build
2014-05-23 19:43:57 +00:00
Ying Wang
966c1e0cae Add HOST_PREFER_32_BIT to support 32-bit-by-default multilib build
We already support pure 32-bit and 64-bit-by-default multilib build.
With HOST_PREFER_32_BIT we can build 32-bit-by-default multilib build.
This will be lest disruptive during the period we transition to
64-bit-by-default.

Bug: 13751317
Change-Id: I0d56ce4abbe4afeaacfd70d709f6a349791c0722
2014-05-20 18:03:21 -07:00
Ying Wang
80b91d9ac6 Fix typo.
Change-Id: I027b91d3a89de12a9c9f95406274726574bc7f7a
2014-05-20 16:20:44 -07:00
Ying Wang
3380d3a1ae Explicit record the modules' built-file:installed-file
- This simplifies the logic to get the mapping of built-file to
  installed-file. Previously we used file suffix matching which is error
  prone and not scalable.
- With this change the .odex files will be included automatically.

Bug: 13585955
Change-Id: I4599abf93b9d501bac7aca7758d7f3aee21b3e36
2014-05-19 13:03:36 -07:00
Ying Wang
8200231ae1 am e50f2d9f: am 40b49d30: am a74ade94: Merge "Support host multilib build"
* commit 'e50f2d9f32a27d8290692dbf99ab8b247ef9d553':
  Support host multilib build
2014-05-15 01:09:49 +00:00
Ying Wang
6feb6d5607 Support host multilib build
This change basically ported our target multilib to the host side.
It supports 2 host build modes: x86 and x86_64 multilib build.
For now you need to set "BUILD_HOST_64bit=true" to switch to x86_64
multilib build. Later we'll default to x86_64 build and have a flag
to force 32-bit only build, which may be needed by SDK build.

In host module definition, like in target ones, you can use the
following
LOCAL variables to set up multilib configuration:
LOCAL_MULTILIB: can be "both", "first", "32" or "64".
It also supports the same set of arch or 32-vs-64 specific LOCAL
variables.
By default, it builds only for the first arch.

To keep path compatibility, in x86_64 build files are still output to
out/host/linux-x86; Both 32-bit and 64-bit executables are in
out/host/linux-86/bin;
In x86_64 build 32-bit shared libraries are installed to
out/host/linux-x86/lib32
and 64-bit shared libraries are installed to out/host/linux-x86/lib;
32-bit object files are output to out/host/linux-x86/obj32 and 64-bit
object files
are output to out/host/linux-x86/obj.

Bug: 13751317
Change-Id: I6044f83b7db369a33e05209e8c588eb6dc83409f
2014-05-14 16:55:04 -07:00
Ying Wang
989ac38d93 Add tool to package up built modules.
With this change, you can package up modules while avoiding installing
them to the system.img or userdata.img.
- build/core/tasks/tools/package-modules.mk
  You can use this template to package up modules into a zip file and
  preserve the installed file paths.
- LOCAL_PICKUP_FILES, you can use this variable to package up extra
  files/directories.

Bug: 13585955
Change-Id: I103042b24ccf17cf5dc90c016d97ed1dd293e50b
2014-05-08 17:01:06 -07:00
Ying Wang
3b81aabbd0 Add tool to package up built modules.
With this change, you can package up modules while avoiding installing
them to the system.img or userdata.img.
- build/core/tasks/tools/package-modules.mk
  You can use this template to package up modules into a zip file and
  preserve the installed file paths.
- LOCAL_PICKUP_FILES, you can use this variable to package up extra
  files/directories.

Bug: 13585955
Change-Id: I103042b24ccf17cf5dc90c016d97ed1dd293e50b
2014-05-05 16:46:52 -07:00
Ying Wang
b8888432f0 Set up rules to build oem.img
To build oem.img:
- You must define BOARD_OEMIMAGE_PARTITION_SIZE in your BoardConfig.mk
- The file system type will be the same as system.img and userdata.img.
- To install a module to oem.img, use "LOCAL_OEM_MODULE := true"
- run "make -j48 showcommands oem_image dist". By default it's not
  built.

Bug: 13367676
Change-Id: I1a26d4d0c61b72ecffe60279667b1b3de050780d
2014-04-28 09:43:51 -07:00
Ying Wang
66750e6395 am d4cc9dad: am 1427f872: am 676e11fe: Merge "include LGPL projects in GPL archives"
* commit 'd4cc9dad6cf21e12b45b8b756a731d6e21c86c97':
  include LGPL projects in GPL archives
2014-04-25 22:52:04 +00:00
Andrew Boie
08a943b16a include LGPL projects in GPL archives
LGPL projects need their source code distributed under very
similar conditions to GPL and MPL, the only difference is the
conditions under which they may be linked. It makes sense to
include them in the GPL archive tarballs.

Change-Id: I2c2df03906bfeee55566102aa688e4cdc283700b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2014-04-11 21:38:00 +00:00
Adam Lesinski
9d9dbaba77 Merge "Temporarily use a separate var for including shared resources" 2014-03-26 00:41:00 +00:00
Adam Lesinski
5eebe0f1b4 Temporarily use a separate var for including shared resources
Change-Id: I56636a1d7dfdaa070706f1991f80e03fe2f71069
2014-03-25 17:00:35 -07:00
Colin Cross
5a9db90e40 add support for LOCAL_MODULE_STEM_32 and LOCAL_MODULE_STEM_64
Some executables will need to be built for both 32-bit and 64-bit.
For linker/linker64, debuggerd/debuggerd64, and a few more, they
will be installed in the same path (/system/bin), but with different
filenames.  Allow the module to specify LOCAL_MODULE_STEM_32 and
LOCAL_MODULE_STEM_64 to name the two versions.

Change-Id: I573e8678c7332245a064f31246be0a05f0a9e25f
2014-03-25 13:49:58 -07:00
Colin Cross
87974056d9 add support for LOCAL_MODULE_PATH_32 and LOCAL_MODULE_PATH_64
Some executables will need to be built for both 32-bit and 64-bit.
For tests, it will be convienient to keep the name of the executable
the same, but install them in a different location.  Add
LOCAL_MODULE_PATH_32 and LOCAL_MODULE_PATH_64 to allow a module
to specify different paths for 32-bit and 64-bit executables.

Change-Id: I3be830e899c6d485fe55c25c66b20b3fe64c795e
2014-03-25 13:48:40 -07:00
Ying Wang
14a6cbd902 Refine module name resolving in multilib build
-- Added TARGET_PREFER_32_BIT, which sets LOCAL_32_BIT_ONLY for an
   executable, if LOCAL_NO_2ND_ARCH is not true.

Name resolving in 64-bit multilib build:
-- Name resolving in PRODUCT_PACKAGES:
   foo:32 resolves to foo_32;
   foo:64 resolves to foo;
   foo resolves to both foo and foo_32 (if foo_32 is defined).

-- Name resolving for LOCAL_REQUIRED_MODULES:
   If a module is built for 2nd arch, its required module resolves to
   32-bit variant, if it exits;
   Otherwise for executable and shared library, a required module
   resolves to the default 64-bit variant; for other module classes,
   required module foo resolves to both foo and foo_32 (if foo_32 is
   defined)

Bug: 12898862
Change-Id: I5fda1a77f58814097b10b5ad2743ee25adfaecc4
2014-02-10 22:39:14 -08:00
Colin Cross
90353fe86f add support for more LOCAL_*_arch variables
Add support for:
LOCAL_SHARED_LIBRARIES_arch
LOCAL_STATIC_LIBRARIES_arch
LOCAL_WHOLE_STATIC_LIBRARIES_arch
LOCAL_GENERATED_SOURCES_arch
LOCAL_REQUIRED_MODULES_arch

Change-Id: Iad91702e140d8dba7dcaee13f236c77b1e626a34
2014-02-04 19:44:57 -08:00
Colin Cross
aee1e779f4 don't rename 32-bit executables to *_32
Renaming 32-bit executables to *_32 breaks PRODUCT_PACKAGES
dependencies.

Change-Id: I53d89991633ef4af03c4e618c463769937a70e38
2014-02-04 19:44:09 -08:00
Colin Cross
1acb1b64b9 Merge changes I62504bad,I16208cca,I4e4ceec6
* changes:
  add new gen/ directory for generated sources
  warn on LOCAL_MODULE_PATH in multiarch shared libraries
  Support LOCAL_MODULE_RELATIVE_PATH
2014-01-27 23:35:01 +00:00
Ying Wang
37bd1f2d83 Don't modify LOCAL_MODULE_TAGS.
Change-Id: Id70d48c1d7abf02139925bcb3208515ea1a082b9
2014-01-27 15:19:09 -08:00
Colin Cross
d826264621 add new gen/ directory for generated sources
Allow modules to generate source into $OUT/gen, which will then
be copied into $OUT/obj and $OUT/obj_$(TARGET_2ND_ARCH) as
necessary.  This allows a single build rule invocation that includes
generated source to build for the first and second architectures.

Modules will need to change calls to local-intermediates-dir into
local-generated-sources-dir.

Change-Id: I62504bad9454b3d9fde7b84ab9f0a487a2ecf0bf
2014-01-27 14:45:44 -08:00
Colin Cross
639c336dc1 Support LOCAL_MODULE_RELATIVE_PATH
Most users of LOCAL_MODULE_PATH are setting a subdirectory of the
normal install path, for example to install HALs into system/lib/hw.
This is problematic for multiarch builds, where the install location
depends on the arch.  Allow modules to specify LOCAL_MODULE_RELATIVE_PATH.
HALs will generally use:
LOCAL_MODULE_RELATIVE_PATH := hw

Change-Id: I4e4ceec61d026bbe74ba604554c06104bde42e5e
2014-01-27 14:43:14 -08:00