Commit graph

6120 commits

Author SHA1 Message Date
Colin Cross
f5a9cca054 Merge "Reverse RRO dir paths when passing to Make"
am: 5ddf292268

Change-Id: I3ff9ae83c75a3b8a10270fbf1bcc98c2e3e64663
2018-04-18 15:32:06 -07:00
Colin Cross
5ddf292268 Merge "Reverse RRO dir paths when passing to Make" 2018-04-18 22:22:06 +00:00
Pirama Arumuga Nainar
daf0ac55ea Fix few issues with filegroups
am: 955dc4999e

Change-Id: Iaf017c917db2b5fe6c1844461ceeba3d8372270d
2018-04-18 14:12:23 -07:00
Pirama Arumuga Nainar
955dc4999e Fix few issues with filegroups
Bug: http://b/64121881
Bug: http://b/78188880

- Allow filegroup's properties to be extended by a LoadHook
- Support a filegroup (':module') in a prebuilt's 'Srcs' property to
export files from a different path as the prebuilt's sources.

This change also includes a refactoring that moves genrule/filegroup.go
to android/filegroup.go so that FileGroupFactory is visible in
prebuilt_test.go.

Test: Test
https://android-review.googlesource.com/c/platform/development/+/469159
in clang-tools branch on Linux, Darwin.  Test regular build in
aosp/master.

Change-Id: I3ff6215ab2e62955f039fd1086c31f1bd50ebcf6
2018-04-18 18:56:33 +00:00
Anton Hansson
f6677ff743 Merge "Migrate soong to use new sdk prebuilts."
am: 6284323772

Change-Id: I8a957d1c32847d96509373ee71ef5648d9dcd480
2018-04-18 08:42:24 -07:00
Anton Hansson
6284323772 Merge "Migrate soong to use new sdk prebuilts." 2018-04-18 15:33:46 +00:00
Anton Hansson
f66efeb4ef Migrate soong to use new sdk prebuilts.
Make is moved over in aosp/661963.

Bug: 77525052
Test: make
Change-Id: I04ea58964df3d4149ef09ab7ca9238336d338a06
2018-04-18 14:53:59 +01:00
Dan Willemsen
860d3a907f Merge "Fix ABI diff reporting with dist"
am: 556752d3d4

Change-Id: Iaef70296d2206d6b4fd890fd9e06783637802799
2018-04-17 12:46:09 -07:00
Treehugger Robot
556752d3d4 Merge "Fix ABI diff reporting with dist" 2018-04-17 19:35:35 +00:00
Jayant Chowdhary
b90c85da9e Merge "Setting SKIP_ABI_CHECKS=true will make soong skip native abi checks."
am: 7e88af3258

Change-Id: I57f738b492f7c0037924408c8616dfb2713c42e4
2018-04-17 12:30:19 -07:00
Treehugger Robot
7e88af3258 Merge "Setting SKIP_ABI_CHECKS=true will make soong skip native abi checks." 2018-04-17 19:16:28 +00:00
Jayant Chowdhary
b391feaea5 Setting SKIP_ABI_CHECKS=true will make soong skip native abi checks.
Bug: 78118272

Bug: 72225642

Test: SKIP_ABI_CHECKS=true mm -j64 in external/libjpeg-turbo; no abi
      dumping / diffing happens

Test: SKIP_ABI_CHECKS=false mm -j64 in external/libjpeg-turbo; abi
      dumping / diffing happens

Test: SKIP_ABI_CHECKS=foo mm -j64 in external/libjpeg-turbo; abi
      dumping / diffing happens

Change-Id: I6330bc6de81abd589e78572af8efdf70d4c69b80
2018-04-17 18:13:45 +00:00
Colin Cross
a140bb05f1 Reverse RRO dir paths when passing to Make
LOCAL_RESOURCE_DIRS puts the highest priority overlay first, but
aapt2 expects the highest priority overlay last.  Soong stores the
list in aapt2 order (low to high priority), but that means when it
exports to Make as LOCAL_SOONG_RRO_DIRS, which goes to
build_rro_package.mk and then package_internal.mk, it gets reversed
again and comes out backwards.

Bug: 78032566
Test: m checkbuild
Change-Id: If72bf929fbf1d126f9051a2f21ec1eb4e3030e6e
2018-04-17 10:53:54 -07:00
Dan Willemsen
edd1ae0817 Fix ABI diff reporting with dist
When we're doing ABI diffing, we run something like:

  (run-abi-diff) || (echo && exit 1)

When `dist` is added, we attempt to copy out the result:

  (run-abi-diff) || (echo) && (copy && exit 1)

But this always fails, since it will always run exit 1. We really want
the parenthesis around the entire second section. This change switches
it to:

  (run-abi-diff) || (echo && (copy) && exit 1)

This matches the behavior before Iae25374fe937a0cbe8a8ddf9e23c3bc1f62bbb2a

Test: treehugger on P
Change-Id: Ic39da4d4630ee950b811ec7854d55d65c52f8661
2018-04-17 10:42:18 -07:00
Nan Zhang
3f8cbe202b Merge "Add bool to control if we need generate stubs src files."
am: 423245dcc3

Change-Id: If69932d8d3bf2a721226c19d42404f6eaa65db37
2018-04-16 17:19:50 -07:00
Colin Cross
288fd5d41e Merge changes I9fb94f22,I1dfac5ff
am: 038f71d7d7

Change-Id: I8ed3ab221939497f8fffb95a1a591626128ff0f8
2018-04-16 17:19:17 -07:00
Treehugger Robot
423245dcc3 Merge "Add bool to control if we need generate stubs src files." 2018-04-17 00:08:22 +00:00
Treehugger Robot
038f71d7d7 Merge changes I9fb94f22,I1dfac5ff
* changes:
  Fix androidmk_test.go import ordering
  Add support for android_library modules
2018-04-17 00:05:25 +00:00
Colin Cross
9684d4184d Merge "Fix module rename inside namespace"
am: a42770b18a

Change-Id: I0bc5131c4356af86cb5c0928efc1908f72dd54e4
2018-04-16 16:13:40 -07:00
Treehugger Robot
a42770b18a Merge "Fix module rename inside namespace" 2018-04-16 23:04:37 +00:00
Colin Cross
fdb084029f Fix androidmk_test.go import ordering
Test: m checkbuild
Change-Id: I9fb94f22a157ffb9369eea071a867289c37cf026
2018-04-16 15:27:19 -07:00
Colin Cross
a97c5d3f08 Add support for android_library modules
Add support for compiling android_library modules into AARs,
and refactor app support on top of it.

Bug: 73724997
Test: app_test.go
Change-Id: I1dfac5fffe577c6680bc4709147b2061eb7d819c
2018-04-16 15:24:47 -07:00
Colin Cross
4452800c84 Merge changes I3ad2a356,I30955b6e,I1dc6fd99
am: ad6cbf18da

Change-Id: I16b4c22e0fba384faba36086633d396ab2d110a7
2018-04-16 15:01:06 -07:00
Colin Cross
ad6cbf18da Merge changes I3ad2a356,I30955b6e,I1dc6fd99
* changes:
  Add more androidmk translations for android libraries
  Merge matching properties in bpfix
  Make bpfix not modify the input tree
2018-04-16 21:47:20 +00:00
Colin Cross
eafb10c23a Fix module rename inside namespace
Rename was expecting fully qualified names, but context.go always
passes it short names.

Bug: 77922456
Test: TestRename in namespace_test.go
Change-Id: I552ff39fd8ed6ba6da4262925060b45104840ff7
2018-04-16 21:38:15 +00:00
Makoto Onuki
1bb9940f3e Soong: add "java_genrule_host"
am: 8f9ab6a26b

Change-Id: Id36b1b843b68e1dda9fd06d9b38eb80aa1da1918
2018-04-16 13:52:58 -07:00
Colin Cross
2dee86d69c Add more androidmk translations for android libraries
Add support for translating LOCAL_MANIFEST_FILE, LOCAL_RESOURCE_DIR
LOCAL_SHARED_ANDROID_LIBRARIES, and LOCAL_STATIC_ANDROID_LIBRARIES.

Use the presence of non-empty LOCAL_RESOURCE_DIR,
LOCAL_SHARED_ANDROID_LIBRARIES or LOCAL_STATIC_ANDROID_LIBRARIES
to convert a java_library_static into an android_library module,
and then squash LOCAL_SHARED_ANDROID_LIBRARIES into
LOCAL_SHARED_LIBRARIES and LOCAL_STATIC_ANDROID_LIBRARIES into
LOCAL_STATIC_LIBRARIES.

Test: androidmk_test.go
Change-Id: I3ad2a3561f69ebd097eca97cb170754d64e06123
2018-04-16 17:32:23 +00:00
Colin Cross
9c55d237f6 Merge matching properties in bpfix
androidmk will start to generate multiple static_libs: properties
in a single module, add a pass in bpfix to fix them up into a
single property.

Test: bpfix_test.go
Change-Id: I30955b6efbb767c02ba77f2f18d44951ef094bad
2018-04-16 17:32:16 +00:00
Colin Cross
adee968a4b Make bpfix not modify the input tree
Make a new object called Fixer to hold the state of the tree, and
make a copy of the input tree so the original doesn't get modified.

Test: bpfix_test.go
Change-Id: I1dc6fd99158c8b0e1db029df99e6cf72699a5e63
2018-04-16 17:32:08 +00:00
Makoto Onuki
8f9ab6a26b Soong: add "java_genrule_host"
Bug: 78030154
Test: Tested with an internal test module.
Change-Id: Ifaefb7cba2eb491b62fa3b398fee931ab667575f
2018-04-13 16:37:22 -07:00
Chih-Hung Hsieh
98fda157fb Add USE_CLANG_LLD and use_clang_lld.
am: 02b4da53a7

Change-Id: I98a3bde9bb2c7b6ff6784b6e842ebdf3525f7bea
2018-04-13 12:36:39 -07:00
Nan Zhang
853f420ed7 Add bool to control if we need generate stubs src files.
Some modules only need the documentation instead of the stubs.

And fix a small issue for arg name passed to standard javadoc.

Test: m -j dx-docs and check the build.ninja
Bug: b/70351683
Change-Id: Ic47c53db12db6f2632349e48c4a626a4f432f447
2018-04-12 18:05:40 -07:00
Chih-Hung Hsieh
02b4da53a7 Add USE_CLANG_LLD and use_clang_lld.
* USE_CLANG_LLD is unedefined in current builds.
* When USE_CLANG_LLD is defined to 'true' or '1',
  use clang's lld instead of ld or ld.gold.
* When lld is enabled:
  * ld-only flags are not passed to 'lld'.
  * location_packer is disabled.
  * Use new lld's --pack-dyn-relocs=android.
* When lld does not work:
  * In Android.mk files use LOCAL_USE_CLANG_LLD := false.
  * In Android.bp files use use_clang_lld: false.
* Only arm, arm64, x86, and x86_64_devices have LLD flags;
  all other hosts and targets do not call lld yet.

Bug: 73768157
Test: make checkbuild and boot
Change-Id: I06b8a1e868a600997a7e70fe05c299d751d23d5f
2018-04-12 14:37:35 -07:00
Inseob Kim
0221151a8d Merge "Remove early-return statements of link-type check"
am: 18f568f651

Change-Id: I25d2c216ca28e3c543af59ecf99588b5ea4dadc4
2018-04-11 16:25:02 -07:00
Treehugger Robot
18f568f651 Merge "Remove early-return statements of link-type check" 2018-04-11 23:18:32 +00:00
Colin Cross
e56f26526c Merge "Consistently use Bool instead of proptools.Bool"
am: b3f16dea37

Change-Id: Ibfd7205b616690b45092307b2a4f21c15363055e
2018-04-11 07:54:53 -07:00
Colin Cross
b3f16dea37 Merge "Consistently use Bool instead of proptools.Bool" 2018-04-11 14:46:31 +00:00
Inseob Kim
500156a876 Fix misleading error messages
am: 34b22839f2

Change-Id: Ib7b8f6908659bdf9a879501d7b1ab99086fe4ab4
2018-04-11 02:15:19 -07:00
Inseob Kim
5604c01bb6 Check compatibility between STLs correctly
am: 01a2872c05

Change-Id: I87bc0248810969dd08f82cde02cec27d01e143f8
2018-04-11 02:15:13 -07:00
Inseob Kim
da2171ae9d Remove early-return statements of link-type check
Bug: 77834464
Test: m -j
Change-Id: I75e431ee48e23130167d1fafbe80e88c8222d79b
2018-04-11 06:45:38 +00:00
Inseob Kim
34b22839f2 Fix misleading error messages
Bug: 77834464
Test: None
Change-Id: I5c21625d1e6406399f5c397ac466f3d36a2c0cbc
2018-04-11 06:08:56 +00:00
Inseob Kim
01a2872c05 Check compatibility between STLs correctly
During link-type check, if a module with sdk_version "current" refers
another, compatibility check between STLs has not been performed.

Bug: 77834464
Test: m -j succeeded
Change-Id: Id82a39372670daca779d4fb4af2deb202170a2fd
2018-04-11 06:08:47 +00:00
Colin Cross
ff3ae9da74 Consistently use Bool instead of proptools.Bool
Use Bool instead of proptools.Bool and String instead of proptools.String.

Test: m checkbuild
Change-Id: I32d84add9f27128c7a65413e9612fd920613584f
2018-04-10 22:50:34 -07:00
Colin Cross
72510f2a27 Merge "Use proptools.BoolDefault"
am: ed1268268d

Change-Id: I608029e2b081f111332bb164ac7841c8d34b6741
2018-04-10 21:49:41 -07:00
Colin Cross
ed1268268d Merge "Use proptools.BoolDefault" 2018-04-11 04:38:31 +00:00
Dan Willemsen
954230537d Add VendorConfig for board-level Soong plugin configuration
am: 0fe7866897

Change-Id: I6058211a8ad94de272ef501439dbf462a1ebd65b
2018-04-10 18:52:45 -07:00
Dan Willemsen
1a837ac9fa Make Config.ProductVariables private
am: 45133ac184

Change-Id: Id1829fbffc2ba82005aaaef6afd3b4e959e873c1
2018-04-10 18:52:41 -07:00
Dan Willemsen
e4436b5ab2 Expose ProductVariables from TestConfig
am: 674dc7f7f0

Change-Id: I130d3425854c56f9e53793140e1aaa76accab619
2018-04-10 18:52:38 -07:00
Dan Willemsen
906a608451 Use Config/DeviceConfig functions to access ProductVariables
am: 3fb1faeeb9

Change-Id: I729b297ed40dc8fe3476ee2d9cff097374433cc1
2018-04-10 18:52:34 -07:00
Dan Willemsen
0fe7866897 Add VendorConfig for board-level Soong plugin configuration
This allows Soong (Go) plugins to get custom configurations set in the
current product's BoardConfig.mk.

I'll have some more comprehensive documentation later, but the general
concept is that you'd have one namespace per plugin, defined in the
BoardConfig.mk (though they would work in the product.mk files too):

  SOONG_CONFIG_NAMESPACES += myPlugin

Within that namespace you can set key-value pairs:

  SOONG_CONFIG_myPlugin := key1 key2 ...
  ...
  SOONG_CONFIG_myPlugin_key1 := value
  ...
  SOONG_CONFIG_myPlugin_key2 := true

Then in your plugin, you can ask for your namespace:

  vars := ctx.Config().VendorConfig("myPlugin")

And then use them:

  str := vars.String("key1")
  if vars.Bool("key2") { ... }
  if vars.IsSet("key3") { ... }

Warning: It's not a good idea to fail on missing inputs, since an
android tree may contain plugins from multiple owners, and we may
configure your modules (but not build/install them) even if they're not
meant for the currently configured product.

Bug: 76168832
Test: define some variables, use them
Test: m blueprint_tools
Change-Id: I4c38f5a4344022c6f332de279d9bbef24502e741
2018-04-11 01:45:37 +00:00