Commit graph

1515 commits

Author SHA1 Message Date
Colin Cross
ad4a597c79 Merge "Add method to determine variations from a Target" 2019-10-17 18:52:20 +00:00
Pete Gillin
b9e63fe015 Merge "Enable Java language level 9 by default."
am: 4fe25b05b9

Change-Id: I3e136a958f8ef54b9c92aa5cecc7bb46dbcec118
2019-10-17 04:05:22 -07:00
Pete Gillin
4fe25b05b9 Merge "Enable Java language level 9 by default." 2019-10-17 10:38:35 +00:00
Jiyong Park
53fb8dd285 Merge "Create scripts to update and freeze a module SDK"
am: d7d5e5a1ac

Change-Id: I56ad28f0e8ee441dec2b89fd49cde41823a4bb0a
2019-10-16 21:18:59 -07:00
Mitch Phillips
403f0998cd Merge "Add SingletonContext::VisitDirectDepths[If] to Android proxy."
am: 344eed4eb1

Change-Id: I78306020fbc7413e336e7bb7c21c5fe5aa4f2d09
2019-10-16 21:15:52 -07:00
Jiyong Park
a7bc8ad0b9 Prohibit dependencies outside of uses_sdks
When an APEX is built with uses_sdks, any depedndency from the APEX to
the outside of the APEX should be from the SDKs that the APEX is built
against.

Bug: 138182343
Test: m

Change-Id: I1c2ffe8d28ccf648d928ea59652c2d0070bf10eb
2019-10-17 11:19:53 +09:00
Treehugger Robot
d7d5e5a1ac Merge "Create scripts to update and freeze a module SDK" 2019-10-17 01:02:16 +00:00
Treehugger Robot
344eed4eb1 Merge "Add SingletonContext::VisitDirectDepths[If] to Android proxy." 2019-10-17 00:45:25 +00:00
Colin Cross
a195f91471 Split out osMutator from archMutator
Split the archMutator into two mutators, osMutator to create
android/linux/darwin variants, and archMutator to then further
split them into arm/arm64, etc.  When combined with alias
variants in Blueprint this will allow us to depend on the
"android" variant without having to know what architectures
were used to build it.

Test: m checkbuild
Change-Id: I0f51d60fc440cf5ae503904ce7849ec797af5fe2
2019-10-16 15:27:23 -07:00
Colin Cross
158eeb7701 Add arch mutator test
Add a test for the arch mutator in preparation for splitting it
into two mutators.

Test: m checkbuild
Change-Id: Ifd0a146a085901d33db50e783bdfad31edd7b7a6
2019-10-16 15:27:23 -07:00
Mitch Phillips
3a7a31b0c1 Add SingletonContext::VisitDirectDepths[If] to Android proxy.
Adds the VisitDirectDepths[If] function from blueprint to the Android
SingletonContext proxy.

Bug: N/A
Test: N/A
Change-Id: I4037364ef11b545abc9a383db7e1e818854db68f
2019-10-16 15:06:32 -07:00
Colin Cross
0f7d2ef3ac Add method to determine variations from a Target
The arch variants are hardcoded in every module type.  Refactor
them out into a Target.Variations() method in preparation for
splitting the arch mutator into two, which will require using
different variations.

Test: m checkbuild
Change-Id: I28ef7cd5168095ac888fe77f04e27f9ad81978c0
2019-10-16 14:52:30 -07:00
Pete Gillin
1b3370f5d7 Enable Java language level 9 by default.
This changes the default Java language level from 8 to 9, i.e. javac
invocations now use -source 1.9 -target 1.9.

The environment variable EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=false is
added to switch back to the language level 8 behaviour. (Previously,
setting that variable to true was required to opt in to language level
9.)

Test: make droid java tests cts docs
Test: javap -v <some class file in output> | grep 'major version' (reports 53, for classes from 'benchmarks' which is in Android.bp and 'ahat' which is in Android.mk)
Test: make RunBluetoothRoboTests RunCarSettingsLibRoboTests (two main flavours of robolectric)
Test: make cts && cts-tradefed help
Test: atest CtsLibcoreTestCases (reasonably low-level device tests)
Test: atest CtsHostTzDataTests (arbitrary host test)
Bug: 115604102
Change-Id: I9de888e1df021244d5e61c40934178676f09ecc7
Merged-In: I52be1817fa7121fca3bce3d8857cb9ed0825570c
2019-10-16 11:20:13 +01:00
Jiyong Park
090366ef0c Merge "add [static|shared].apex_available to cc_library"
am: a4cdb8dd40

Change-Id: I4486cd7d051a3b774bf0c457659c2950121a6ca7
2019-10-15 21:20:59 -07:00
Jiyong Park
9b409bcd10 Create scripts to update and freeze a module SDK
`m <sdk_name>` generates two scripts each of which is use to update the
current snapshot of the SDK and to freeze ToT as a new version,
respectively. Executing the scripts will copy necessary files (stub
libraries, AIDL files, etc.) along with Android.bp into the ./<apiver>
directory under the directory where the sdk is defined.

This change also introduces a new module type 'sdk_snapshot' that
represents a snapshot of an SDK. It will be auto-generated by the above
scripts, so developers are not expected to write this manually.

The module type 'sdk' is now used to simply specify the list of modules
that an SDK has.

Finally, this change changes the version separator from '#' to '@'
because '#' confuses Make.

Bug: 138182343
Test: m

Change-Id: Ifcbc3a39a2f6ad5b4f4b200ba55a1ce3281498cf
2019-10-15 18:49:58 +09:00
Jiyong Park
a90ca00786 add [static|shared].apex_available to cc_library
apex_available property can be appended differently per the linkage
type. This will be used to restrict certain libs (e.g.
libc_malloc_debug) to an APEX while allowing them to be statically
linkable from platform for testing purpose.

Test: m (apex_test amended)
Change-Id: I6dec23129c5ac93a3ef06fea28f26f240c0ba410
2019-10-15 15:28:07 +09:00
Orion Hodson
2b0d6a86a4 Make apex_available respect AllowMissingDependencies
am: 4b5438a9ea

Change-Id: I07adcfbe783f58189c352724dd2f93ca574c4859
2019-10-08 03:27:01 -07:00
Orion Hodson
4b5438a9ea Make apex_available respect AllowMissingDependencies
When SOONG_ALLOW_MISSING_DEPENDENCIES is defined in the build, don't
fail if an apex_available entry is not available. This is for smaller
Android manifests that may not include all APEX projects (e.g. master-art).

Bug: 142300164
Test: able to build from master-art manifest.
Change-Id: Ice1274f7dd143c4b1bf756e2cde93e217266affa
2019-10-08 10:40:51 +01:00
Jiyong Park
6064472edb Merge "Remove no_apex in favor or apex_available"
am: e89b8fb919

Change-Id: Icf8cfdd3945291fd15a15a751ca761842abbbfe6
2019-10-07 22:41:59 -07:00
Treehugger Robot
e89b8fb919 Merge "Remove no_apex in favor or apex_available" 2019-10-08 05:33:29 +00:00
Colin Cross
362051eef3 Merge "Filter product variable property structs"
am: 2334757d24

Change-Id: Iee8f1d0cb3ac2e01032b569727f9ed48e6783273
2019-10-07 14:07:35 -07:00
Colin Cross
2e7e4df578 Merge "Remove old-style support for translated second architectures"
am: c6136c9d65

Change-Id: I14c7ceb6e1f34f902a7fe71727773498b13b0078
2019-10-07 14:06:45 -07:00
Colin Cross
2334757d24 Merge "Filter product variable property structs" 2019-10-07 20:53:44 +00:00
Treehugger Robot
c6136c9d65 Merge "Remove old-style support for translated second architectures" 2019-10-07 20:48:07 +00:00
Colin Cross
e33b763897 Merge "Add symlinks to sh_binary in soong"
am: 8b0dc4be07

Change-Id: Ifac96bb40de8a4f183acecd305618cb677dd95c1
2019-10-07 10:53:37 -07:00
Colin Cross
8b0dc4be07 Merge "Add symlinks to sh_binary in soong" 2019-10-07 17:47:45 +00:00
Rashed Abdel-Tawab
6a34131da4
Add symlinks to sh_binary in soong
This allows us to change `logpersist.start` to `sh_binary` and unblocks
breakpad symbol uploading

Test: convert logpersist.start to sh_binary and verify symlinks are correct
Change-Id: I1b86c512df73a336205ca35216445a08e43bb879
2019-10-04 20:51:44 -07:00
Colin Cross
eb767a021e Merge "Use localPool consistently for UseGoma() == true"
am: 96ce6ab143

Change-Id: I0dee88625929e1d523a1df3a8547fc40353bea43
2019-10-04 12:04:05 -07:00
Treehugger Robot
96ce6ab143 Merge "Use localPool consistently for UseGoma() == true" 2019-10-04 18:36:07 +00:00
Colin Cross
789fc863bb Merge changes from topic "install"
am: 4acb77e76a

Change-Id: Id5785b4df6fa91a457e5a3234819cd2de9644cb5
2019-10-03 15:06:55 -07:00
Colin Cross
21daf4e438 Separate InstallPath from OutputPath
am: 70dda7e3da

Change-Id: Ic581d093d61e2b1f413b8b9dfdc8ee75a6806d54
2019-10-03 15:06:48 -07:00
Colin Cross
5c17b4e9bb Add InstallInRoot to allow modules to install into root partition
am: 90ba5f4e98

Change-Id: I73a597b875c336624b0016302c3710177bb0a658
2019-10-03 15:06:40 -07:00
Colin Cross
70dda7e3da Separate InstallPath from OutputPath
Create a new type InstallPath that is similar to OutputPath to
differentiate intermediates output paths from installed output
paths.

RelPathString is a poorly defined, undocumented function that is
primarily used to get an install path relative to out/soong to
generate an equivalent install path for Make relative to $(OUT_DIR).
Move it to InstallPath for now, and fix the one remaining user on
OutputPath.

Add a method to create an NDK install path so that ndk_sysroot.go
doesn't have to do it manually with PathForOutput.

Bug: 141877526
Test: m checkbuild
Change-Id: I83c5a0bd1fd6c3dba8d3b6d20d039f64f353ddd5
2019-10-03 10:07:53 -07:00
Colin Cross
ff6c33d885 Replace RelPathString() with ToMakePath()
Add a ToMakePath() method that returns a new path that points out
out/ instead of out/soong/, and replace the
"$(OUT_DIR)/" + path.RelPathString()
pattern with
path.ToMakePath().String()

Bug: 141877526
Test: m checkbuild
Change-Id: I391b9f2ed78c83a58d905d48355ce9b01d610d16
2019-10-03 10:07:53 -07:00
Colin Cross
90ba5f4e98 Add InstallInRoot to allow modules to install into root partition
If InstallInRoot() returns true the module will be installed to
$OUT/root or $OUT/recovery/root.

Bug: 141877526
Test: m checkbuild
Test: no change to build.ninja or Android-${TARGET_PRODUCT}.mk
Test: TestPathForModuleInstall
Change-Id: Id6e435c6019f11eeb5806528fd464dbf220b88d9
2019-10-03 10:07:46 -07:00
Colin Cross
bf0adb2c88 Merge changes from topic "filter_arch_properties"
am: 2f429160c1

Change-Id: I20821e595ad22a08ebc64a0a6c779ddf021e8a86
2019-10-02 13:26:01 -07:00
Colin Cross
21c6067ebb Move arch properties to proptools.FilterPropertyStruct
am: 7444910e93

Change-Id: I043dd52f1ec805dab45ee9604bf3f0c6932f27c0
2019-10-02 13:25:47 -07:00
Treehugger Robot
2f429160c1 Merge changes from topic "filter_arch_properties"
* changes:
  Make CreateModule return the newly created module
  Move arch properties to proptools.FilterPropertyStruct
2019-10-02 18:53:54 +00:00
Jiyong Park
b0413c3a80 Merge "Add apex_available to control the availablity of a module to APEXes"
am: 321d7114c3

Change-Id: I7cdb151256cedfe779b7fdf380c5a9eef1a12a36
2019-10-02 01:15:59 -07:00
Jiyong Park
7916bfc3cc Remove no_apex in favor or apex_available
This change reverts following three changes to remove the no_apex
property. no_apex: true is equivalent to apex_available:
["//apex_available:platform"].

Revert "fix: "no_apex" can be put in defaults"
This reverts commit cc372c5b1d.

Revert "Add no_apex check for static library"
This reverts commit 2db7f46d0c.

Revert "Add no_apex property"
This reverts commit 4f7dd9b4db.

Bug: 139870423
Bug: 128708192
Test: m

Change-Id: Ia4b094e371e9f8adff94ae6dc3ebb8e081381d4e
2019-10-02 14:12:16 +09:00
Jiyong Park
127b40b316 Add apex_available to control the availablity of a module to APEXes
apex_available property controls the availability of a module to APEXes.
For example, `apex_available: ["myapex", "otherapex"]` makes the module
available only to the two APEXes: myapex and otherapex, and nothing
else, even to the platform.

If the module is intended to be available to any APEX, then a pseudo
name "//apex_available:anyapex" can be used.

If the module is intended to be available to the platform, then another
pseudo name "//apex_available:platform" is used.

For now, if unspecified, this property defaults to ["//apex_available:platform",
"//apex_available:anyapex"], which means the module is available to everybody.
This will be reduced to ["//apex_available:platform"], when marking for
apex_available for existing modules are finished.

Bug: 139870423
Bug: 128708192
Test: m
Change-Id: Id4b233c3056c7858f984cbf9427cfac4118b2682
2019-10-02 14:12:16 +09:00
Yo Chiang
0a52b0eab9 Merge "Change RRO enforcement logic"
am: fdc9afa15b

Change-Id: Ia72f34bee493afd455d5ca9ee23e495b048d516c
2019-10-01 19:47:43 -07:00
Yo Chiang
fdc9afa15b Merge "Change RRO enforcement logic" 2019-10-02 02:34:35 +00:00
Colin Cross
2e2dbc250a Use localPool consistently for UseGoma() == true
Remove the distinction between pctx.StaticRule and
pctx.AndroidStaticRule so that all of the local rules correctly
get assigned to the localPool.  Also put Module and Singleton
rules into the localPool.

Test: compare out/soong/build.ninja
Change-Id: Id2bb38eff3c7209340fe55bc9006f00bd3661d81
2019-10-01 14:11:20 -07:00
Colin Cross
c7503e2fd8 Move sharding functions for reuse
am: 0a2f719bca

Change-Id: I4d1e85ac2fe3fd61f82e4783ce48b42f7a3bbf53
2019-10-01 13:14:34 -07:00
Treehugger Robot
f856c005cb Merge changes from topic "soong_c_flags"
* changes:
  Creation of C Flags Build Variables
  Move sharding functions for reuse
2019-10-01 19:25:50 +00:00
Jaewoong Jung
58a6de1c5b Merge changes I3d6506f5,I3667eac9
am: 9dc1756484

Change-Id: I5da90cdf8c36b3d3cdad2c9f3077465087dda545
2019-10-01 10:09:16 -07:00
Yo Chiang
4ebd06aa57 Change RRO enforcement logic
Change RRO logic from
"Enforce RRO for all modules when PRODUCT_ENFORCE_RRO_TARGETS is '*'"
to
"Enforce RRO for all modules when PRODUCT_ENFORCE_RRO_TARGETS includes '*'"

Bug: b/137727426
Test: test build on local machine
Change-Id: I5df1a776d324c92c0c8bbf79b4f24536cb9b5c21
2019-10-01 15:08:56 +08:00
Colin Cross
0a2f719bca Move sharding functions for reuse
Move shardPaths and shardTests to android.ShardPaths and
android.ShardStrings for reuse in other packages.

Test: m checkbuild
Change-Id: I868802872c73616b80f56cbf11f959c01a8b793a
2019-09-29 23:26:37 -07:00
Jaewoong Jung
0949f31657 Fix android_test install path.
Test: m nothing + diff soong mk and ninja files.
Bug: 140795853
Change-Id: I3667eac951dea7e447cf73219ff89199fca9ed63
2019-09-27 16:42:20 -07:00
Jaewoong Jung
a5ba702ca6 Migrate java/androidmk.go to new system #2
am: 9a1e8bdd0b

Change-Id: If7a85110014d50d901c42a61fd17a9abb1fdaa08
2019-09-27 12:30:16 -07:00
Jaewoong Jung
c2f794a401 Merge "Migrate java/androidmk.go to new system #1"
am: 2784fda152

Change-Id: I488367e21eba6fd40ea27ef727b139448ab53dcf
2019-09-27 09:26:02 -07:00
Jaewoong Jung
9a1e8bdd0b Migrate java/androidmk.go to new system #2
This change migrates remaining AndroidMk()s in java/androidmk.go to
AndroidMkEntries().

Test: Soong tests
Test: Built a system image
Test: Manual inspection of diffs
Change-Id: Ib1107fafb175fdfd8539bf6158548224e4c87a6d
2019-09-27 08:10:39 -07:00
Jaewoong Jung
2784fda152 Merge "Migrate java/androidmk.go to new system #1" 2019-09-27 14:40:24 +00:00
Colin Cross
18c46807c9 Filter product variable property structs
For each module, take the default product variable properties and
create a new type that contains only the properties that exist in
the current module.  This will provide better errors when attemping
to set product variable properties that will never get used for
a module, and fixes errors when a module attempts to use a product
variable that also contains properties that don't apply to the
current module.

Fixes: 79249983
Test: TestProductVariables
Test: m checkbuild
Change-Id: I4dc24f7781b8ce798651cfc8bf3563005a92c13d
2019-09-26 15:03:07 -07:00
Colin Cross
7444910e93 Move arch properties to proptools.FilterPropertyStruct
Test: m checkbuild
Change-Id: I85c5e6c86aea4ccf5bcddc2e5d468d66e0b38671
2019-09-26 15:03:07 -07:00
Colin Cross
e003c4abdd Make CreateModule return the newly created module
Allow mutators to modify properties of the newly created module
by returning it.

Test: m checkbuild
Change-Id: I682caca86c0c8f7c3ae815a494d4c75962c8e2e8
2019-09-26 15:03:07 -07:00
Colin Cross
e6825e58e4 Make CreateModule take an android.ModuleFactory
am: 84dfc3d331

Change-Id: I923ea9e9bf757ff78d5e6d2325840284b77c69b7
2019-09-26 11:46:22 -07:00
Colin Cross
84dfc3d331 Make CreateModule take an android.ModuleFactory
Reduce the boilerplate required to call CreateModule by taking an
android.ModuleFactory instead of a blueprint.ModuleFactory.

Test: m checkbuild
Change-Id: I1259d2dd3f7893b5319c333bc180727ac40f9e91
2019-09-26 17:19:26 +00:00
Jiyong Park
303b2992af Merge "Introduce module type 'sdk'"
am: b1102ba828

Change-Id: I2fe48c7185491a9d092cd69260bf2edfa86462da
2019-09-22 22:02:44 -07:00
Jiyong Park
d1063c1586 Introduce module type 'sdk'
This change introduces a new module type named 'sdk'. It is a logical
group of prebuilt modules that together provide a context (e.g. APIs)
in which Mainline modules (such as APEXes) are built.

A prebuilt module (e.g. java_import) can join an sdk by adding it to the
sdk module as shown below:

sdk {
    name: "mysdk#20",
    java_libs: ["myjavalib_mysdk_20"],
}

java_import {
    name: "myjavalib_mysdk_20",
    srcs: ["myjavalib-v20.jar"],
    sdk_member_name: "myjavalib",
}

sdk {
    name: "mysdk#21",
    java_libs: ["myjavalib_mysdk_21"],
}

java_import {
    name: "myjavalib_mysdk_21",
    srcs: ["myjavalib-v21.jar"],
    sdk_member_name: "myjavalib",
}

java_library {
    name: "myjavalib",
    srcs: ["**/*/*.java"],
}

An APEX can specify the SDK(s) that it wants to build with via the new
'uses_sdks' property.

apex {
    name: "myapex",
    java_libs: ["libX", "libY"],
    uses_sdks: ["mysdk#20"],
}

With this, libX, libY, and their transitive dependencies are all built
with the version 20 of myjavalib (the first java_import module) instead
of the other one (which is for version 21) and java_library having the
same name (which is for ToT).

Bug: 138182343
Test: m (sdk_test.go added)
Change-Id: I7e14c524a7d6a0d9f575fb20822080f39818c01e
2019-09-22 08:21:27 +09:00
Colin Cross
3b19f5d71d Remove old-style support for translated second architectures
Translated second architectures now go in NativeBridgeArch instead
of DeviceSecondaryArch.

This reapplies I568046330abc002d4eed582cb999b62a5eaba790 with
ctx.Config().HasMulitlibConflict() added to fix the NDK build,
which has arm64, arm, x86_64, and x86 architectures enabled.

Test: m checkbuild
Test: OUT_DIR=out_ndk build/soong/scripts/build-ndk-prebuilts.sh
Test: no change to build.ninja or Android-aosp_cf_x86_phone.mk
Change-Id: Iadcafbd64bfb9579ae7c86914927c43a062b0c8e
2019-09-19 12:54:32 -07:00
Colin Cross
39293b4068 Merge "Revert "Remove old-style support for translated second architectures""
am: 4c5032bb66

Change-Id: Iab516935ff26b0c20d46732f93ec46b3c7907f50
2019-09-18 14:25:12 -07:00
Colin Cross
402be41aa8 Revert "Remove old-style support for translated second architectures"
This reverts commit fe6330c7d2.

Reason for revert: this was accidentally propping up NDK builds
Bug: 141242600
Change-Id: Ie9f8e31479a74e8e9e14d720a5936da6b1d5d113
2019-09-18 21:12:31 +00:00
Colin Cross
94bac35d78 Merge "Remove old-style support for translated second architectures"
am: da62bf96ce

Change-Id: Ia517bd20003e187f693264b8106baa33bf5cbb4f
2019-09-18 13:59:35 -07:00
Colin Cross
fe6330c7d2 Remove old-style support for translated second architectures
Translated second architectures now go in NativeBridgeArch instead
of DeviceSecondaryArch.

Bug: 141242600
Test: m checkbuild
Change-Id: I568046330abc002d4eed582cb999b62a5eaba790
2019-09-18 16:23:18 +00:00
Jooyung Han
87f0f3781c Merge "Add "apex_vndk" module type"
am: 1f6c94a3ac

Change-Id: I3d92b1ba4ffccd3bce4f18963bc92ef24b827bee
2019-09-17 10:30:15 -07:00
Treehugger Robot
1f6c94a3ac Merge "Add "apex_vndk" module type" 2019-09-17 17:14:48 +00:00
TreeHugger Robot
fb041f8508 Merge "Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master" into stage-aosp-master 2019-09-11 20:31:35 +00:00
Jaewoong Jung
b0c127cfd7 Migrate java/androidmk.go to new system #1
This change migrates some of AndroidMk()s in java/androidmk.go to
AndroidMkEntries(), mainly focusing on deduping test-related helper
funcs.

Test: Soong tests
Test: Built a system image
Test: Manual inspection of diffs
Change-Id: I7810085521600d9ea2df078837688ade41c04825
2019-09-10 07:38:31 -07:00
Ivan Lozano
022a73b9ad Move splitFileExt to the android package.
Both Rust and cc use this function, so move it over to android
package's util.go and export it.

Bug: 140734195
Test: m -j

Change-Id: Ibe8b7a94592e402468a027ad6027b187f29c8e07
2019-09-09 20:29:31 -07:00
Jooyung Han
344d5439c1 Add "apex_vndk" module type
"apex_vndk" is a variant of "apex" module.

apex_vndk {
  name: "com.android.vndk",
  ..
}

This rule is used to produce a VNDK APEX per vndk version.
It supports automatic inclusion of vndk libs.

If "vndk_version" property is set, the prebuilt vndk libs of
the version will be included in the apex bundle.

apex_vndk {
  name: "com.android.vndk.v29"
  vndk_version: "29",
  ...
}

Otherwise, platform's vndk version is used.

This will replace /system/{lib}/vndk-{ver} and vndk-sp-{ver}.

Bug: 134357236
Bug: 139772411
Test: m com.android.vndk
Change-Id: Ib5c86e625839389670d13c683a7427198ef6852f
2019-09-10 11:22:59 +09:00
Xin Li
c0c04685b3 Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master
Bug: 135460123
Change-Id: Ifc81184a113f1f41d1dccfc0e6cd04c6791dcfdb
Merged-In: Ic676d1c55807ac806a18ce8b9f845bfccb0ffa26
2019-09-08 13:12:49 -07:00
Steven Moreland
349cd474ef CreateModule also inherits variableProperties.
Bug: N/A
Test: manual
Change-Id: Ic5ecbeac04841d4016c0caa8710a6adae1ec2bd6
2019-09-06 18:28:58 -07:00
Dan Willemsen
f80ef34c80 Merge "Rewrite depfile from sbox to stay reproducible"
am: e2ce551909

Change-Id: I2a51549dfb4419b9b6444d33104d35e655c82f4f
2019-09-04 12:38:05 -07:00
Dan Willemsen
e2ce551909 Merge "Rewrite depfile from sbox to stay reproducible" 2019-09-04 19:16:01 +00:00
Paul Duffin
7322b5271a Allow per test rules in neverallow_test.go
am: 115445b5d6

Change-Id: I6e7ce7fc42e2fbd186ed4e37fa362faf8cc30fac
2019-09-03 05:44:15 -07:00
Paul Duffin
115445b5d6 Allow per test rules in neverallow_test.go
Makes testing individual rules easier by allowing them to be specified
per test rather than having to add them to the global defaults.

Bug: 138428610
Test: m nothing
Change-Id: Ic65a55dee2a02b6d33254753c047295dd5804408
2019-09-03 10:33:29 +01:00
Paul Duffin
91e3819335 Support multiple expected errors in neverallow_test.go
Extracted some common code used by visibility_test.go and
neverallow_test.go into a new function CheckErrorsAgainstExpectations
in testing.go.

Bug: 138428610
Test: m nothing
Change-Id: I6996fa52968c387e38b4a67ffa59cd07c2d524e8
Merged-In: Iafbadf12c6ffdc4d9128fcfe7f15792df5cfd020
2019-09-03 10:33:29 +01:00
Dan Willemsen
c89b6f1981 Rewrite depfile from sbox to stay reproducible
sbox will generate a random directory for the output root, and most
tools will encode that directory name in the output target of the
depfile.

So embed the library from dep_fixer into sbox so that it can rewrite the
output filename to a static (reproducible) value. Ninja doesn't care
what that value is, so it's just "outputfile".

Also fix up rule_builder to actually tell sbox about the depfile.

Test: mmma system/iorap; check the contents of:
out/soong/.intermediates/system/iorap/libiorap-binder/android_arm_armv7-a-neon_core_static/gen/aidl/system/iorap/binder/com/google/android/startop/iorap/IIorap.cpp.d

Change-Id: I3640a2e8b0c034f143a35e398a8418a6d621b265
2019-08-29 14:47:40 -07:00
Roland Levillain
e78b1103af Allow modules to be enabled/disabled depending on whether APEXes are flattened.
am: 2879d41a98

Change-Id: I4ec408f99805b5229f926163fea2ebefb8515032
2019-08-29 08:34:33 -07:00
Roland Levillain
af93360ef9 Merge changes from topic "check-flattened-art-apex"
* changes:
  Add an output file type for flattened APEXes.
  Allow modules to be enabled/disabled depending on whether APEXes are flattened.
2019-08-29 15:17:29 +00:00
Jaewoong Jung
6e104c7ee5 Merge changes Ife12ba69,Ibf910262
am: 7ca5576905

Change-Id: I4e486be727b3be79afac66644cc3e9967e43bd45
2019-08-28 18:17:30 -07:00
Jaewoong Jung
7ca5576905 Merge changes Ife12ba69,Ibf910262
* changes:
  Implement android_test_import
  AndroidMkEntries minor refactoring.
2019-08-29 00:55:14 +00:00
Jooyung Han
7e035187e9 Merge "soong: Add tests for depending on disabled module"
am: a9caf47ea2

Change-Id: I201c11b499650c96c3d52b53eda72f163364681e
2019-08-28 17:24:44 -07:00
Jaewoong Jung
e0dc8dfd22 AndroidMkEntries minor refactoring.
This includes a few changes that make AndroidMkEntries more resemble
AndroidMkData, especially in terms of how extra entries are added.
Most importantly it can now have multiple custom functions.

Test: Soong tests
Change-Id: Ibf9102624d16d0c1c9894a2794fc7c797bb34c9a
2019-08-28 13:07:03 -07:00
Roland Levillain
2879d41a98 Allow modules to be enabled/disabled depending on whether APEXes are flattened.
Allow the `enabled` Soong/Blueprint property (e.g. in `genrule` and
`cc_prebuilt_binary` module definitions) to have a different value
when APEX flattening is enabled.

Test: m checkbuild
Bug: 139277987
Change-Id: Ic586bdfac7690077445da12543154381d92cf98e
Merged-In: Ic586bdfac7690077445da12543154381d92cf98e
2019-08-27 14:25:59 +01:00
Jooyung Han
d48f3c3885 soong: Add tests for depending on disabled module
This will check if direct deps of android.Module type is "Enabled()".
Previously, this is checked only if a module calls VisitDeps*()
functions in GenerateAndroidBuildActions().

Most modules call VisitDeps*() in GenerateAndroidBuildActions(),
but some modules don't. For example, "apex" module calls
WalkDepsBlueprint() or VisitDirectDepsBlueprint() since it
exceptionally depends on non-android.Module modules.

Therefore, when an apex module depends on disabled(enabled:false) module,
build fails with panic, which is fixed by this change.

Test: m # runs soong tests
Change-Id: I81c5c148bbd51a253d2904690eb76ae7b6df1a0f
2019-08-26 13:19:42 +00:00
Jiyong Park
90c36cedc2 Merge "Add no_apex property"
am: fb7e0b3aa2

Change-Id: I6f2b54d15ab4e7f787a2a714fabe4c8596173e29
2019-08-23 02:34:03 -07:00
Treehugger Robot
fb7e0b3aa2 Merge "Add no_apex property" 2019-08-23 04:00:38 +00:00
Pete Bentley
677ba298a5 Merge changes I75b4a761,I779f28c6,If1422372,I26307dd1
am: 792942de47

Change-Id: I48b5288882430733400f897aee1eb76a83fa64c2
2019-08-22 17:32:40 -07:00
Treehugger Robot
792942de47 Merge changes I75b4a761,I779f28c6,If1422372,I26307dd1
* changes:
  Introduce inject_bssl_hash library property.
  BoringSSL FIPS build - introduce extraLibFlags and use for STL libs.
  Allow linker scripts when building objects.
  Allow .o files as srcs.
2019-08-23 00:15:08 +00:00
Pete Bentley
fcf55bf656 Allow .o files as srcs.
Test: m nothing
Test: TreeHugger
Bug: 134581881
Bug: 137267623

Change-Id: I26307dd1129e58878f0468da3b61c53f074bd674
2019-08-22 13:21:37 -07:00
Jiyong Park
4f7dd9b4db Add no_apex property
This change adds 'no_apex' property which, when set to true, prevents
the module from being installed to any APEX. If the module is included
either directly or transitively in an APEX, but build fails.

Bug: 139016109
Test: m

Change-Id: If1478aa9660a3442f7dd1ffe45e4ca5611a6acbe
2019-08-22 20:37:07 +09:00
Roland Levillain
79ccffad7d Merge "Rename Soong variable FlattenApex as Flatten_apex."
am: 5f576375fa

Change-Id: I76f5104d5bbcdcbf08919b4acea6ff30179e56a8
2019-08-21 13:13:55 -07:00
Roland Levillain
5f576375fa Merge "Rename Soong variable FlattenApex as Flatten_apex." 2019-08-21 19:55:47 +00:00
Jaewoong Jung
833c5b89b1 Merge "Add arch variant support to android_app_import." am: a701d9071e
am: 7a6bb1d925

Change-Id: I9a7e6a1ff5ba46863d5f9856ab31939850609ba0
2019-08-16 09:35:23 -07:00
Jaewoong Jung
7a6bb1d925 Merge "Add arch variant support to android_app_import."
am: a701d9071e

Change-Id: I7e20e0a6f4f0adaec0897fee3a371adcf78106d3
2019-08-16 09:26:58 -07:00
Jaewoong Jung
1ce9ac6755 Add arch variant support to android_app_import.
Bug: 128610294
Fixes: 138792623
Test: app_test.go
Change-Id: I47c80ec283ce58a0ce9b7d0af40844bd73e9d3f1
2019-08-15 16:26:18 -07:00
Hsin-Yi Chen
02b4c8a5c7 Merge "Add tags to the list of lsdump paths" am: eef3366ab3
am: d5c7188d45

Change-Id: Ia6af125f7dc2d5f8504c04198342b6b13ab1776d
2019-08-14 19:54:15 -07:00
Hsin-Yi Chen
d5c7188d45 Merge "Add tags to the list of lsdump paths"
am: eef3366ab3

Change-Id: Ia08611a0c926ccebfcdbfade31b09878712b82e9
2019-08-14 19:44:45 -07:00
Hsin-Yi Chen
eef3366ab3 Merge "Add tags to the list of lsdump paths" 2019-08-15 02:20:30 +00:00
Roland Levillain
a386321345 Rename Soong variable FlattenApex as Flatten_apex.
This is so that it can be used as a Soong/Blueprint property.

Test: m
Bug: 139277987
Change-Id: I8840811fde92a71e97ed100aacfc7fbb003580d0
2019-08-13 15:08:29 +01:00
Jiyong Park
39ba226192 Merge "java_import can be included in apex" am: f02f30952d
am: 046a62833c

Change-Id: Icefe0b263fa39c9bd94a120b02a42ea359ebda03
2019-08-12 21:59:42 -07:00
Jiyong Park
046a62833c Merge "java_import can be included in apex"
am: f02f30952d

Change-Id: Ia8fb126cd81b6108d3d2b213cecf0cb38acd06d2
2019-08-12 21:50:11 -07:00
Treehugger Robot
f02f30952d Merge "java_import can be included in apex" 2019-08-13 04:18:29 +00:00
Jiyong Park
9e6c242856 java_import can be included in apex
java_import can be included in apex via 'java_libs' property.

Bug: 139175488
Test: m (apex_test.go updated)
Change-Id: I3680a47cdac93b0cb2d41da8df3f8defa2bbe670
2019-08-13 09:36:39 +09:00
Inseob Kim
f716cad758 Merge "Include headers and props to VNDK snapshot" am: 337698988a
am: 4cfa0dffeb

Change-Id: I72da53fd5854405d75d2f0ebe70c094ce9ac36f2
2019-08-11 16:31:13 -07:00
Inseob Kim
4cfa0dffeb Merge "Include headers and props to VNDK snapshot"
am: 337698988a

Change-Id: Ie21ee147be804d07d7089f9bc59ce658f6d3c21e
2019-08-11 16:21:14 -07:00
Treehugger Robot
337698988a Merge "Include headers and props to VNDK snapshot" 2019-08-11 23:04:49 +00:00
Jiyong Park
dbb5da87ed Merge "Fix sanitizer dep" am: e49256e564
am: 72969547dc

Change-Id: Iede7979035dffe4ab0cc0b84b65d7d82d512bd39
2019-08-11 10:55:22 -07:00
Jiyong Park
72969547dc Merge "Fix sanitizer dep"
am: e49256e564

Change-Id: I2199bff441c53410030ccf7f48fc386a7e123c4f
2019-08-11 10:45:55 -07:00
Treehugger Robot
e49256e564 Merge "Fix sanitizer dep" 2019-08-11 17:12:47 +00:00
Paul Duffin
23937cbac8 Merge "Support multiple expected errors in neverallow_test.go" into stage-aosp-master
am: 9a324ba693

Change-Id: I19ce2d70bf0226d139a67a54c4aa96704a94e6c1
2019-08-09 22:25:45 -07:00
Paul Duffin
b5af6204d3 Support multiple expected errors in neverallow_test.go
Extracted some common code used by visibility_test.go and
neverallow_test.go into a new function CheckErrorsAgainstExpectations
in testing.go.

(cherry picked from commit 8e47e8bc41)
Bug: 138428610
Test: m nothing
Change-Id: Iafbadf12c6ffdc4d9128fcfe7f15792df5cfd020
2019-08-09 09:31:41 +00:00
Colin Cross
87fddf0631 Merge changes I918b4878,I85238d93,Iefee8a91 am: a48f8c8070
am: f3d807778d

Change-Id: I3b82dbc8218a6bae371285b206fc6aa9877317b7
2019-08-08 18:01:46 -07:00
Colin Cross
f3d807778d Merge changes I918b4878,I85238d93,Iefee8a91
am: a48f8c8070

Change-Id: Icaea636b21c37c1017d11f104b100805c77459ab
2019-08-08 17:50:47 -07:00
Treehugger Robot
a48f8c8070 Merge changes I918b4878,I85238d93,Iefee8a91
* changes:
  Add an output file tag for proguard dictionaries
  Add InstallBypassMake
  Document wokaround for yama ptrace restrictions
2019-08-09 00:12:27 +00:00
Inseob Kim
ae55303f36 Include headers and props to VNDK snapshot
For all vndk snapshot libraries, header files exported by the libraries
will be included to the snapshot. Android.bp will contain necessary
information to link against/install vndk snapshot libraires:
export_include_dirs, export_system_include_dirs, export_flags, and
relative_install_path.

Bug: 132818174
Test: 1) m nothing && mv out/soong/build.ninja /tmp && m nothing &&
         diff -u -u out/soong/build.ninja /tmp/build.ninja
Test: 2) VNDK_SNAPSHOT_BUILD_ARTIFACTS=true \
           development/vndk/snapshot/build.sh
Test: 3) development/vndk/snasphot/update.py
Test: 4) see contents of Android.bp and include directories
Change-Id: I791ab181545eb483242b04446afd40958bbb2b17
2019-08-08 18:45:59 +09:00
Jiyong Park
1d1119f4bd Fix sanitizer dep
This change fixes a problem in sanitizerMutator where a module is linked
with of non-sanitized variant of a lib at build-time, but is linked with
the sanitized variant of the lib at run-time.

This happened because, for each sanitizer type, every shared libs are
split into non-sanitized and sanitized variants, and then either of the
variants are suppressed from Make so that it isn't installed to the
device.

This change fixes the problem by NOT splitting for shared libs; only the
sanitized variant is created if needed. Header libs, static libs and
shared libs for a few sanitizer types (asan/fuzzer) are however split
into two. This is because the static and headers libs become part of the
depending module, and asan/fuzzer require that the depending module and
the dependant module should be compiled for the same sanitizer.

Bug: 138103882
Bug: 138426065
Test: m com.android.runtime.debug
Check that libziparchive exists under both
/system/apex/com.android.runtime/[lib|lib64]

Change-Id: Ia447785c485c0d049e19477b32bc638bfe6f1608
2019-08-08 01:51:26 +09:00
Paul Duffin
595a0de80e Merge changes from topic "restrict-libandroidicu-usages" am: d5a57d8fc5
am: c9c0f52ea5

Change-Id: I610dbac70955d23bec65730c43b0284b538884ab
2019-08-07 04:21:12 -07:00
Paul Duffin
c9c0f52ea5 Merge changes from topic "restrict-libandroidicu-usages"
am: d5a57d8fc5

Change-Id: I5c6fa0a1806bbbb502564d96a8f28a110162c6e8
2019-08-07 04:10:21 -07:00
Hsin-Yi Chen
5348964723 Add tags to the list of lsdump paths
This commit adds tags, such as NDK, VNDK-core, and PLATFORM, to
LSDUMP_PATHS. The script updating the reference ABI dumps uses the tags
to determine the directories where the dumps should be created.

Test: make findlsdumps
Bug: 133176785
Change-Id: I8540286238cf0ec55c65e1c4f60cb9c12e5e57a1
2019-08-07 13:40:11 +08:00
Colin Cross
607d8587e4 Add InstallBypassMake
Allow modules to mark themselves as InstallBypassMake, which will
cause android.PathForModuleInstall to return a path in $OUT_DIR
instead of $OUT_DIR/soong.  This can be used for modules that
can handle installation to the final location on their own.  The
main blocker for most modules is support for the "required" property,
which requires adding dependencies on the installed location of
other modules.

Bug: 122332855
Test: m checkbuild
Change-Id: I85238d937ff30335167d4b3fec79bbefc734b5e1
2019-08-06 09:45:04 -07:00
Paul Duffin
f1c9bbee88 Support restrictions based on a module's OsClass
Bug: 137543088
Test: m nothing
Change-Id: Ibb05f222594d8180746b612c04ab1538a1cf3c0b
2019-08-06 11:09:09 +01:00
Paul Duffin
3578188fac Support restrictions based on a module's dependencies
Adds a neverallow InDirectDeps(deps) verb that will allow a neverallow
rule to restrict access to a specific dependency, irrespective of how
it is specified.

Bug: 137543088
Test: m nothing
Change-Id: I0c6bb702d55175e9b78b79e86e96924c5dd83efa
2019-08-06 11:09:02 +01:00
Jooyung Han
4d34c5b39a Put dependency in apex_manifest.json am: e16330393a
am: 3c6423ef1a

Change-Id: I2890b9949ba79f996f4a01a0be046f3961a36b51
2019-08-05 17:39:48 -07:00
Jooyung Han
3c6423ef1a Put dependency in apex_manifest.json
am: e16330393a

Change-Id: I1090b2cc5154e7fefb1a16655ac874799fab740f
2019-08-05 17:33:57 -07:00
Treehugger Robot
d62b4af8b7 Merge changes from topic "put-dep-in-apex"
* changes:
  Add jsonmodify tool
  Put dependency in apex_manifest.json
2019-08-06 00:21:11 +00:00
Elliott Hughes
2ad30002d5 Merge "Reland "Remove product_is_iot."" am: 80e071d1da
am: 4177df9567

Change-Id: Ifd2537508ccd9f9331ef94bfdd1ea824f817ca3e
2019-08-01 12:08:42 -07:00
Elliott Hughes
4177df9567 Merge "Reland "Remove product_is_iot.""
am: 80e071d1da

Change-Id: I875289d3b5f88034b4e1256054b41fb9e05dfdd1
2019-08-01 11:59:54 -07:00
Elliott Hughes
80e071d1da Merge "Reland "Remove product_is_iot."" 2019-08-01 18:24:26 +00:00
Jooyung Han
e16330393a Put dependency in apex_manifest.json
To generate ld.config.txt dynamically(b/123722631), each APEX should
provide some dependency information:
a) list of libraries which other APEXes(or system) can use from this apex
b) list of libraries which this apex uses from other APEXes(or system)

This change puts dependency information in apex_manifest.json at
build-time with two additional keys:
a) provideNativeLibs
b) requireNativeLibs

Bug: 138695532
Test: m (runs soong tests)
Test: find $OUT/apex -name apex_manifest.json  -exec cat {} \;
 (shows contents of apex_manifest.json files)

Change-Id: Iaad12c8c35454222ad177ce923cce76ef12a8a5a
2019-08-01 23:45:37 +09:00
Elliott Hughes
1f3a239953 Reland "Remove product_is_iot."
This reverts commit 5089c11b1e.

Change-Id: Iaedc22e63560a01ab01859982dc627569a421025
Test: treehugger
2019-08-01 14:42:12 +00:00
Nelson Li
171f6bfa7b Merge "Revert "Remove product_is_iot."" am: 604374742d
am: 742677d7b6

Change-Id: If961e139b66b79dcea3dbd555c6a517f9307447d
2019-08-01 03:48:15 -07:00
Nelson Li
742677d7b6 Merge "Revert "Remove product_is_iot.""
am: 604374742d

Change-Id: I85167277df48f3887d17a2670167b6aba6c5519d
2019-08-01 03:37:17 -07:00
Treehugger Robot
604374742d Merge "Revert "Remove product_is_iot."" 2019-08-01 10:16:24 +00:00
Nelson Li
5089c11b1e Revert "Remove product_is_iot."
This reverts commit 14fa562fbb.

Reason for revert: Broken build on 5772180

error: frameworks/av/media/utils/Android.bp:49:23: unrecognized property "product_variables.product_is_iot"

Bug: 138764596
Change-Id: I37944dfb974e4180a683361f514b404f92b943e5
2019-08-01 06:28:05 +00:00
Elliott Hughes
bde44fc84d Merge "Remove product_is_iot." am: 75b3788d6c
am: 7bb10aa40d

Change-Id: I6effeaa5ee93faf83a237b80505a4d1243182598
2019-07-31 22:29:03 -07:00
Elliott Hughes
7bb10aa40d Merge "Remove product_is_iot."
am: 75b3788d6c

Change-Id: Ic639b5f1ac256be3369c6fe789bbef428aeac353
2019-07-31 22:07:05 -07:00
Treehugger Robot
75b3788d6c Merge "Remove product_is_iot." 2019-08-01 04:42:40 +00:00
Steven Moreland
03b76a9965 Merge "Automatically inherit common properties." am: d28f688e69
am: e3ff85b968

Change-Id: Id2e996d5d30120fabca41b96666452ba9784045f
2019-07-31 09:21:44 -07:00
Steven Moreland
e3ff85b968 Merge "Automatically inherit common properties."
am: d28f688e69

Change-Id: I2608257a595ade933d291ef5c4fb1f2c633c292b
2019-07-31 09:10:41 -07:00
Steven Moreland
d28f688e69 Merge "Automatically inherit common properties." 2019-07-31 15:47:51 +00:00
Jiyong Park
42aaba73ac Merge "Delete prebuilt APEXes when installing source-built APEXes" am: a822256e15
am: fb45ee3d1e

Change-Id: I8d8eddee843c34fbce4c19a6cbb5a1d2ce3f218e
2019-07-31 00:50:07 -07:00
Jiyong Park
fb45ee3d1e Merge "Delete prebuilt APEXes when installing source-built APEXes"
am: a822256e15

Change-Id: I576969455e028010da6631f06010fd6369c4b589
2019-07-31 00:40:06 -07:00
Treehugger Robot
a822256e15 Merge "Delete prebuilt APEXes when installing source-built APEXes" 2019-07-31 07:03:49 +00:00
Steven Moreland
12f23e0883 Automatically inherit common properties.
Before, the values were often simply ignored. If bad values are provided
now, we should be able to catch them.

Bug: 119771576
Test: relying on this for AIDL/HIDL
Change-Id: I8d2ff26da0b2d01ebe7f78c26d69c7b618a65367
2019-07-30 22:42:19 +00:00
Elliott Hughes
14fa562fbb Remove product_is_iot.
Test: treehugger
Change-Id: I0935f463138e1d2a364cd2a5bc8b6e977da1ec47
2019-07-30 08:43:50 -07:00
Jiyong Park
03b68ddd10 Delete prebuilt APEXes when installing source-built APEXes
To build the platform for ASAN, we do

`m && SANITIZE_TARGET='addresss' m`

However, at the end of the second build, the system partition could have
conflicting APEXes; prebuilt APEXes from the first build and
source-built APEXes from the second build. Since the file names for the
prebuilt and the source-built are different (e.g.
com.google.android.media.apex v.s. com.android.media.apex), we end up
having two files for the same APEX. This is confusing apexd at runtime
and the device fails to boot.

To fix this, when building a non-prebuilt APEX, the prebuilt APEX might
have been installed by the previous build is deleted.

Bug: 138146044
Test: lunch aosp_cf_x86_pasan; m && SANITIZE_TARGET='address' m
check that out/target/product/vsoc_x86/system/apex has
com.android.*.apex only.

Change-Id: Ib5a021a297cf0173ea5a3b50e9398b1cf295c558
2019-07-30 13:52:15 +09:00
Sasha Smundak
94704e9594 Merge "Support source code cross-referencing for C++ and Java" am: 247de68b89
am: 61272795a7

Change-Id: Ib39b5d0fb8ae386ec0616c9fe26496644d9e7460
2019-07-29 18:22:09 -07:00
Sasha Smundak
61272795a7 Merge "Support source code cross-referencing for C++ and Java"
am: 247de68b89

Change-Id: I5284d9be9865e95671ce8ec1927f74059f7fdf44
2019-07-29 18:13:05 -07:00
Treehugger Robot
247de68b89 Merge "Support source code cross-referencing for C++ and Java" 2019-07-30 00:13:12 +00:00
Sasha Smundak
2a4549ec98 Support source code cross-referencing for C++ and Java
Use Kythe (https://kythe.io) to build cross reference for the Android
source code. ~generate the input for it during the build. This is done
on demand: if XREF_CORPUS environment variable is set, build emits a
Ninja rule to generate Kythe input for each compilation rule. It
also emits two consolidation rules (`xref_cxx` and `xref_java`),
that depend on all Kythe input generation rules for C++ and Java.

The value of the XREF_CORPUS environment variable is recorded in the
generated files and thus passed to Kythe. For the AOSP master branch it is
`android.googlesource.com/platform/superproject`, so the command to build
all input for Kythe on that branch is:
```
XREF_CORPUS=android.googlesource.com/platform/superproject m xref_cxx xref_java
```

Each Kythe input generation rule generates a single file with .kzip
extension. Individual .kzip files have a lot of common information, so
there will be a post-build consolidation step run to combine them.
The consolidated .kzip file is then passed to Kythe backend.

The tools to generate .kzip files are provided by Kythe (it calls them
'extractors'). We are going to build them in toolbuilding branches
(clang-tools and build-tools) and check them in as binaries into master
and other PDK branches:
For C++,  `prebuilts/clang-tools/linux-x86/bin/cxx_extractor`
for Java, `prebuilts/build-tools/common/framework/javac_extractor.jar`

Bug: 121267023
Test: 1) When XREF_CORPUS is set, build generates Ninja rules to create
.kzip files; 2) When XREF_CORPUS is set, building
`xref_cxx`/`xref_java` creates .kzip files; 3) Unless XREF_CORPUS is
set, build generates the same Ninja rules as before

Change-Id: If957b35d7abc82dbfbb3665980e7c34afe7c789e
2019-07-26 09:16:47 -07:00
Paul Duffin
9561fd3f78 Merge changes I7b9462d3,Icadd470a,I1d459da1,I01d8f518 am: 4b03cb46a5
am: cdfa3fb705

Change-Id: I130af385902c928e10e183a2ae47965f49d66c29
2019-07-26 02:09:13 -07:00
Paul Duffin
cdfa3fb705 Merge changes I7b9462d3,Icadd470a,I1d459da1,I01d8f518
am: 4b03cb46a5

Change-Id: I6a5fc7321e80333390189a1adb7a1ffb3553bd7c
2019-07-26 01:59:32 -07:00
Paul Duffin
4b03cb46a5 Merge changes I7b9462d3,Icadd470a,I1d459da1,I01d8f518
* changes:
  Add defaults_visibility support
  Refactor visibility to support visibility on defaults modules
  Add DefaultsModule interface
  Improve documentation of defaults mechanism
2019-07-26 08:35:15 +00:00
Jooyung Han
646c483619 Merge "fix: prebuilt_etc_xml" am: 04b2a82b77
am: 4739405a0e

Change-Id: I0e531e46fa7cd2707847958fb5a0e6bbf5f7ab64
2019-07-25 22:35:27 -07:00
Jooyung Han
4739405a0e Merge "fix: prebuilt_etc_xml"
am: 04b2a82b77

Change-Id: I581999dc553a745d49f05a0954d965ca0fa28213
2019-07-25 22:24:39 -07:00
Treehugger Robot
04b2a82b77 Merge "fix: prebuilt_etc_xml" 2019-07-26 04:57:29 +00:00
Paul Duffin
abc1838a78 Merge "Fixed minor typo" am: e515886a8b
am: f5df899687

Change-Id: I2cbd019e80992bcc10295f99e3a01bc2c7791a21
2019-07-25 11:01:14 -07:00
Paul Duffin
f5df899687 Merge "Fixed minor typo"
am: e515886a8b

Change-Id: I5d99efb2e18c02eacb5946320fd7d3504e1e32b5
2019-07-25 10:51:11 -07:00
Paul Duffin
036cacee51 Fixed minor typo
Bug: 138207002
Test: m nothing
Change-Id: Idc6bc6ae9d7e4052da0c0bde6247bff47eab60be
2019-07-25 14:44:56 +01:00
Paul Duffin
95d53b584f Add defaults_visibility support
Bug: 130796911
Test: m nothing
Change-Id: I7b9462d3360be2bbeaf6ff38c5328f45ff5b5ebb
2019-07-25 11:48:21 +01:00
Paul Duffin
63c6e183d5 Refactor visibility to support visibility on defaults modules
Existing modules, either general one or package ones have a single
visibility property, called visibility in general, and
default_visibility on package, that controls access to that module, or
in the case of package sets the default visibility of all modules in
that package. The property is checked and gathered during the similarly
named phases of visibility processing.

The defaults module will be different as it will have two properties.
The first, visibility, will not affect the visibility of the module, it
only affects the visibility of modules that 'extend' the defaults. So,
it will need checking but not parsing. The second property,
defaults_visibility, will affect the visibility of the module and so
will need both checking and parsing.

The current implementation does not handle those cases because:
1) It does not differentiate between the property that affects the
   module and those that do not. It checks and gathers all of them with
   the last property gathered overriding the rules for the previous
   properties.

2) It relies on overriding methods in MethodBase in order to change the
   default behavior for the package module. That works because
   packageModule embeds ModuleBase but will not work for
   DefaultsModuleBase as it does not embed ModuleBase and instead is
   embedded alongside it so attempting to override a method in
   MethodBase leads to ambiguity.

This change addresses the issues as follows:
1) It adds a new visibility() []string method to get access to the
   primary visibility rules, i.e. the ones that affect the module.

2) It adds two fields, 'visibilityPropertyInfo []visibilityProperty'
   to provide information about all the properties that need checking,
   and 'primaryVisibilityProperty visibilityProperty' to specify the
   property that affects the module.

The PackageFactory() and InitAndroidModule(Module) functions are
modified to initialize the fields. The override of the
visibilityProperties() method for packageModule is removed and the
default implementations of visibilityProperties() and visibility()
on ModuleBase return information from the two new fields.

The InitDefaultsModule is updated to also initialize the two new
fields. It uses nil for primaryVisibilityProperty for now but that
will be changed to return defaults_visibility. It also uses the
commonProperties structure created for the defaults directly instead
of having to search for it through properties().

Changed the visibilityProperty to take a pointer to the property that
can be used to retrieve the value rather than a lambda function.

Bug: 130796911
Test: m nothing
Change-Id: Icadd470a5f692a48ec61de02bf3dfde3e2eea2ef
2019-07-25 11:31:42 +01:00
Paul Duffin
e62432feee Add DefaultsModule interface
Changes the InitDefaultsModule method from taking a DefaultableModule
to taking a DefaultsModule in preparation for adding visibility support
to defaults modules.

Bug: 130796911
Test: m nothing
Change-Id: I1d459da1017ae7f2654e7eb275cb424e52d85730
2019-07-25 10:51:27 +01:00
Paul Duffin
7df7fb0dff Improve documentation of defaults mechanism
Also, removes unnecessary cast from DefaultableModule to Defaultable.

Bug: 130796911
Test: m nothing
Change-Id: I01d8f5186927215a1aa6b7431558041f427d7381
2019-07-25 10:50:57 +01:00
Roland Levillain
574743ccf3 Merge "Fix some typos in Soong." am: 5260acef69
am: e41bbbf94c

Change-Id: Ic5bf2a6c84e79b93757152643bb1fa1e5b7caced
2019-07-23 13:18:32 -07:00
Roland Levillain
e41bbbf94c Merge "Fix some typos in Soong."
am: 5260acef69

Change-Id: I61050b05bf4831ca753e4a70efb5e184c379232b
2019-07-23 12:58:15 -07:00
Roland Levillain
dfe75b389c Fix some typos in Soong.
Test: m
Change-Id: I5b332ce12d70f13eca93b23060620c0ea4f46db7
2019-07-23 17:29:57 +01:00
Ramy Medhat
87f0108f37 Merge "Add USE_RBE support to soong." am: 2b78fda705
am: 66b73ceddc

Change-Id: I2242a686fe3b307f49b975e9c07d70883be3a343
2019-07-23 05:29:20 -07:00
Ramy Medhat
66b73ceddc Merge "Add USE_RBE support to soong."
am: 2b78fda705

Change-Id: I69e20f5e54c1d156e26d4634dfec05d17cee126d
2019-07-23 05:19:25 -07:00
Ramy Medhat
2b78fda705 Merge "Add USE_RBE support to soong." 2019-07-23 11:49:10 +00:00
Colin Cross
d0cb1f57c7 Merge changes Ic2a585ea,I11ccabc4,Icc932c4a,I020556c7,I08713e91 am: ed9a92c311
am: a373a94fc0

Change-Id: Idace0a12e475ef12a5055974052b10197ca1c561
2019-07-22 14:13:42 -07:00
Colin Cross
a373a94fc0 Merge changes Ic2a585ea,I11ccabc4,Icc932c4a,I020556c7,I08713e91
am: ed9a92c311

Change-Id: I0367335939181566063b777184e864a7afb02308
2019-07-22 14:04:58 -07:00
Treehugger Robot
ed9a92c311 Merge changes Ic2a585ea,I11ccabc4,Icc932c4a,I020556c7,I08713e91
* changes:
  Fix date on mac builds
  Convert javadoc modules to android.RuleBuilder
  Convert droiddoc modules to android.RuleBuilder
  Add a systemModules utility type
  Convert droidstubs to android.RuleBuilder
2019-07-22 20:29:59 +00:00
Paul Duffin
c5d109063d Merge "Revert "Revert "Prevent runtime module paths being used in include_dirs""" into stage-aosp-master
am: cebbe099df

Change-Id: Ib9abc9a0942fd189104b644ec7b5b5eb4ac53998
2019-07-22 11:48:15 -07:00
Paul Duffin
c811170ab6 Revert "Revert "Prevent runtime module paths being used in include_dirs""
This reverts commit ff3d72f0bf.

Repplies original change now that issue causing build breakage has been
resolved.

Adds a new StartsWith(string) ValueMatcher along with
With[Out]Matcher(...) methods to support new restrictions that prevent
any paths into runtime module repositories from being added to the
include_dirs.

Test: m nothing
Bug: 35624006
Change-Id: I4c802ef25ef56f0f9b0b5e9d75531ea6f7475714
2019-07-22 12:24:49 +01:00
Jooyung Han
a0171822be fix: prebuilt_etc_xml
Since aosp/872653 and aosp/904233 landed, prebuilt_etc_xml has been broken.
aosp/872653: Enable arch variant properties in prebuilt_etc.
aosp/904233: Add a prebuilt module type for usr/share.

This change fixes
1) pass baseDir "etc" to initialize PrebuiltEtc struct
2) change "multlib" argument to MultilibFirst to reflect aosp/872653

Bug: 138082739
Test: m com.google.vr.platform.xml && see if it is installed in /system/etc
Change-Id: I4802107fd8ccf28a1170d7d165700c92df32e341
2019-07-22 16:15:25 +09:00
Ming-Shin Lu
d6e4a90b01 Revert "Prevent runtime module paths being used in include_dirs"
am: ff3d72f0bf

Change-Id: Iaa36cca8e24121e9dc673a757a3a22266f117768
2019-07-22 00:14:38 -07:00
Ming-Shin Lu
ff3d72f0bf Revert "Prevent runtime module paths being used in include_dirs"
This reverts commit 31d0688df9.

Reason for revert: cause build breakage on stage-aosp-master

Change-Id: I7626f8ec36caaaa5eb4c7e9891565fc164a7f6c7
2019-07-22 06:44:34 +00:00
Paul Duffin
4d1663e8a3 Prevent runtime module paths being used in include_dirs am: 2ac2befc9a
am: 31d0688df9

Change-Id: I7614050e521b7091ac1aee57ade672bad11648a2
2019-07-21 04:20:25 -07:00
Paul Duffin
31d0688df9 Prevent runtime module paths being used in include_dirs
am: 2ac2befc9a

Change-Id: Ia7683cb3400013a78bd62b4f7c002c7f0e352903
2019-07-21 04:14:26 -07:00
Paul Duffin
7d8e40c8ad Abstract property value matching logic behind an interface am: 73bf054a52
am: 34ae60b2bb

Change-Id: If903d26eb145c3489fcf9ef8567f55c43c648f46
2019-07-19 22:49:42 -07:00
Paul Duffin
34ae60b2bb Abstract property value matching logic behind an interface
am: 73bf054a52

Change-Id: Ibf0ea69ea2b6be407046810b1d6fa15fe8e8dd2f
2019-07-19 22:43:42 -07:00
Paul Duffin
2ac2befc9a Prevent runtime module paths being used in include_dirs
Adds a new StartsWith(string) ValueMatcher along with
With[Out]Matcher(...) methods to support new restrictions that prevent
any paths into runtime module repositories from being added to the
include_dirs.

Test: m nothing
Bug: 35624006
Change-Id: Ib954998e5fc190d8a11a8c6ac5f810cad927aac3
2019-07-19 19:36:25 +01:00
Paul Duffin
73bf054a52 Abstract property value matching logic behind an interface
Make it easy to add additional ways of matching property values. Needed
to add support for a 'starts with' matcher that can be used to restrict
allowable values in include_dir.

Test: m nothing
Bug: 35624006
Change-Id: I82e7d95f08847bf294aac311968e1d9f3e4b385d
2019-07-19 19:34:36 +01:00
Colin Cross
ab05443ffb Convert droiddoc modules to android.RuleBuilder
Test: m docs
Test: m checkapi
Test: m updateapi
Change-Id: Icc932c4a9a3fc642c96ab9cbd8df3229b5ab86d3
2019-07-18 14:28:17 -07:00
Colin Cross
33961b54e6 Convert droidstubs to android.RuleBuilder
The droiddoc rules are ripe for converting to android.RuleBuilder,
they conditionally use many input files which is hard to track
with the standard blueprint.Rule style, as the argument and the
dependency have to be handled independently.  Start converting
to android.RuleBuilder by converting the droidstubs module.

Test: m docs
Test: m checkapi
Test: m updateapi
Change-Id: I08713e91149471e88a40115f69824cf5eaf88fb6
2019-07-18 14:28:14 -07:00
Ramy Medhat
bbf2567cc1 Add USE_RBE support to soong.
Test: Built aosp_arm-user with and without USE_RBE. USE_RBE uses
a proxy script in place of rewrapper.

Change-Id: I5bf008a940513872d70b5b215bd6209f759826ae
2019-07-17 18:46:47 +00:00
Colin Cross
1ad744326f Merge changes from topic "buildnumberfromfile" am: 223e6a65b6
am: 9dbe4eea79

Change-Id: I7bbf93f6a7416d5fd19e8d905972984414d4f6f6
2019-07-16 20:09:10 -07:00
Colin Cross
9dbe4eea79 Merge changes from topic "buildnumberfromfile"
am: 223e6a65b6

Change-Id: I4e2f0514434ddf6833d03334dbf36869d762214e
2019-07-16 19:59:12 -07:00
Colin Cross
223e6a65b6 Merge changes from topic "buildnumberfromfile"
* changes:
  Allow jar wrapper to take quoted arguments
  Add rspfile support to RuleBuilder
  Prepare droiddoc for using RuleBuilder
  Manually escape BuildNumberFromFile
  Fix android.Expand and ninja escaping
  Add RuleBuilder helper functions for built and prebuilt tools
  Add documentation to droiddoc.go module types
2019-07-17 02:45:03 +00:00
Colin Cross
96e77eece5 Merge changes Ia106d48e,Ib6c0e778 am: 63f4b57a7f
am: 723cc24f2e

Change-Id: I467f93f44713b548c48a09d7b88f7a538cdd6b0a
2019-07-16 15:07:58 -07:00
Colin Cross
723cc24f2e Merge changes Ia106d48e,Ib6c0e778
am: 63f4b57a7f

Change-Id: I65b761fd319f820b9d02f2a652fa2d844c353cd4
2019-07-16 14:59:09 -07:00
Colin Cross
63f4b57a7f Merge changes Ia106d48e,Ib6c0e778
* changes:
  Remove use of deprecated ExtractSourcesDeps
  Dedup path properties across property structs
2019-07-16 21:31:09 +00:00
Colin Cross
0cb0d7b1c5 Add rspfile support to RuleBuilder
Allow RuleBuilderCommands to use an rspfile with FlagWithRspFileInputList.
This requires being more careful with ninja escaping, as the rspfile
will be $out.rsp, and the value for $out may not be known yet so it
must be inserted as a ninja variable that must not be escaped.

Test: rule_builder_test.go
Change-Id: Ifa91e24a0bb8f0ceeb5c9bfa5689be2a4ff3b9cd
2019-07-16 11:12:04 -07:00
Colin Cross
527f3e5511 Dedup path properties across property structs
Listing a property in multiple property structs would cause it to
add multiple dependencies with the same dependency tag, which would
trip the panic in getDirectDepInternal when calling
PathForModuleSrc.  Dedup the properties with the android:"path"
struct tag across all property structs.

Test: path_properties_test.go
Change-Id: Ib6c0e7789443d340ee7551721df0135c5ee64c0f
2019-07-16 09:52:23 -07:00
Dimitry Ivanov
ddf273bcd4 Merge "Make relative path for native_bridge binaries configurable" am: 2ca7a8835e
am: 1866802e07

Change-Id: I49f854acc05be48cd69669a1b4e4102c0b94df9e
2019-07-16 02:49:42 -07:00
Dimitry Ivanov
1866802e07 Merge "Make relative path for native_bridge binaries configurable"
am: 2ca7a8835e

Change-Id: I2cc8f8145c6464cf0ab91a602a5861ffc5a24505
2019-07-16 02:43:41 -07:00