Commit graph

8148 commits

Author SHA1 Message Date
Colin Cross
7f09c40c49 Unset envsetup.sh variables inside build
Using ANDROID_BUILD_TOP and other envsetup.sh varialbes is already
forbidden in makefiles, but some tools run by the build (like
hidl-gen) will use it if it is set.  Since they are set by envsetup.sh,
and sourcing envsetup.sh before building is optional, unset them inside
the build to get consistent behavior.

Bug: 79250545
Test: m checkbuild
Change-Id: I3e7d9f01390ccdc34c49115f2f15cd7542d9974b
2018-07-11 15:18:29 -07:00
John Reck
6b9e67ecc0 Merge "Allow disabling LTO on eng"
am: 7f1c57ee33

Change-Id: I349e5e5856d6991fff465a77c5bd6ad938b2b575
2018-07-11 14:44:57 -07:00
Colin Cross
6ef0948855 [automerger skipped] Use manifest merger in Soong
am: 31656958d6  -s ours

Change-Id: I1b0d68dcf1b62b6cfd42b34f952ac361843f1527
2018-07-11 13:30:27 -07:00
Treehugger Robot
7f1c57ee33 Merge "Allow disabling LTO on eng" 2018-07-11 20:21:19 +00:00
Colin Cross
31656958d6 Use manifest merger in Soong
Move the manifest merger config to Soong, and use it to merge
manifests of static dependencies of android_library and android_app
modules.

Bug: 110848854
Test: m checkbuild
Change-Id: Ib89e1f1a52a8b76157e4e0348baf42800412df0d
Merged-In: Ib89e1f1a52a8b76157e4e0348baf42800412df0d
Merged-In: I5d055ce63b8371db500f8868fb73ab3604b8c24a
2018-07-11 19:46:38 +00:00
Colin Cross
c376617cb5 Merge "Translate java libraries to java_library"
am: 5e48b1d183

Change-Id: Ieece3e42538a19f01bde82cf453afcbe072f3e1b
2018-07-11 12:13:24 -07:00
Colin Cross
5e48b1d183 Merge "Translate java libraries to java_library" 2018-07-11 18:58:03 +00:00
Colin Cross
a90861ae3f Merge "Don't install java libraries by default"
am: d6a8e0fe00

Change-Id: If194f5a3986a6787e6a37f1fae0653155915f99b
2018-07-11 11:41:47 -07:00
Colin Cross
d6a8e0fe00 Merge "Don't install java libraries by default" 2018-07-11 18:30:16 +00:00
John Reck
1d2b7eea6b Allow disabling LTO on eng
Test: Verified setting never to true in hwui resulted
in a fast incremental build
Bug: 111277863

Change-Id: Ic3da6f3adc2c97f0d5f287402c460907533a5f71
2018-07-11 18:24:49 +00:00
TreeHugger Robot
f6cd6f6014 Merge "Use manifest merger in Soong" into stage-aosp-master 2018-07-11 17:39:12 +00:00
Peter Kalauskas
dceb75dcc4 Merge "Fix error in build when OUT_DIR_COMMON_BASE is used"
am: ff2af2c743

Change-Id: I5995b743e5bbdeaca69b885179230004aec551ab
2018-07-11 08:45:57 -07:00
Treehugger Robot
ff2af2c743 Merge "Fix error in build when OUT_DIR_COMMON_BASE is used" 2018-07-11 15:34:52 +00:00
Logan Chien
7eefdc4ed2 Support text ABI dump file format
This commit adds an option to read ABI reference dump in text file
format directly from `prebuilts/abi-dumps`.  If both the text file and
the gzip format exist, an error will be emitted.

Bug: 78650426
Test: create libexif.lsdump.gz and it works as usual
Test: create libexif.lsdump (decompressed) and it works
Test: touch both libexif.lsdump.gz and libexif.lsdump and it errors
Change-Id: I420a5953fb80855cb5c07e5a4d347fb6709f0340
2018-07-11 18:37:50 +08:00
Logan Chien
5237bed1c4 Remove vndkVsNdk()
This commmit removes `vndkVsNdk()`, which is essentially
`!inList(ctx.baseModuleName(), llndkLibraries)`.

Test: lunch aosp_arm64_ab-userdebug && make
Change-Id: I8e2352f302df30057997944678f176f4550d3f75
2018-07-11 17:30:39 +08:00
Logan Chien
83c415f955 Remove isSourceDump from PathForVndkRefAbiDump()
This commit removes `isSourceDump` from `PathForVndkRefAbiDump()`
because the binary dump paths are not being used at all.

Test: lunch aosp_arm64_ab-userdebug && make
Change-Id: I7a6bb9053a6b052590fb1152982949fee897df8d
2018-07-11 15:27:36 +08:00
Colin Cross
cfae5a6e2c Use manifest merger in Soong
Move the manifest merger config to Soong, and use it to merge
manifests of static dependencies of android_library and android_app
modules.

Bug: 110848854
Test: m checkbuild
Change-Id: Ib89e1f1a52a8b76157e4e0348baf42800412df0d
2018-07-11 05:52:26 +00:00
Colin Cross
0fa89a3ff9 Translate java libraries to java_library
In androidmk, translate BUILD_JAVA_LIBRARY to java_library plus
installable: true, and BUILD_STATIC_JAVA_LIBRARY to java_library.
In bpfix, rewrite java_library_static to java_library.

Bug: 110885583
Test: androidmk_test.go, bpfix_test.go
Change-Id: I63c2f759ae9c62a43f3439526552d2cd8e8cedc3
2018-07-11 05:50:32 +00:00
Colin Cross
9ae1b927d4 Don't install java libraries by default
Very few java libraries need to be installed, most are statically
included in other modules.  Device modules that are not installed
also don't need to be dexed, saving checkbuild time.  Change the
default for java_library to not be installed, and allow libraries
that should be installed to specify installed: true.  This makes
java_libary and java_library_static identical.  It also simplifies
some corner cases when converting from Make to Soong if a module
is built for the host (which doesn't differentiate between static
and non-static/installable) and statically for the device, which
couldn't be represented in a single java_library in soong.

Bug: 110885583
Test: m checkbuild, compare presubmit target files
Change-Id: Idc0841c39a17cebd7bac3559c9408596d167a393
2018-07-11 05:35:59 +00:00
Logan Chien
322ab10d5a Merge "Cleanup createVndkSourceAbiDump()"
am: f33dca0ada

Change-Id: I4be5bfa5f3c9affc946942f9dd6915c1f36e0e65
2018-07-10 20:18:54 -07:00
Logan Chien
f33dca0ada Merge "Cleanup createVndkSourceAbiDump()" 2018-07-11 03:08:31 +00:00
Colin Cross
9405da836c Add min_sdk_version to android_library_import modules
am: 479884c93d

Change-Id: Ie0406567bbf45fd42932c1bc57feffa1f103a400
2018-07-10 16:01:24 -07:00
Colin Cross
5d06ac18b5 pom2bp: move misplaced {{end}}
am: 461ba49a0a

Change-Id: I3b2b9f0e2649ba36afa342134a06020644aa2358
2018-07-10 16:01:10 -07:00
Colin Cross
479884c93d Add min_sdk_version to android_library_import modules
pom2bp now inserts a min_sdk_version into android_library_import
modules.

Bug: 110848854
Test: m checkbuild
Change-Id: I1396eabd8bfa02755c829ddac03022ffb7a5673e
2018-07-10 13:46:58 -07:00
Colin Cross
461ba49a0a pom2bp: move misplaced {{end}}
manifest property should only be added to aar imports and not jar
imports.

Bug: 110848854
Test: cd prebuilts/sdk/current/support && pom2bp -regen Android.bp
Change-Id: Ifaab81582c87f0af4419f90c3928d0d5d52cec33
2018-07-10 13:46:58 -07:00
Peter Kalauskas
39b0deb0d7 Fix error in build when OUT_DIR_COMMON_BASE is used
Without this change, gen-kotlin-build-file.sh will generate
kotlinc-build.xml file with path that look like:

/path/to/aosp-top//path/to/aosp-out/soong/.intermediates/...

Also fixed a couple lint errors.

Test: Set OUT_DIR_COMMON_BASE and was able to build
Bug: 111309264
Change-Id: I86173571667deca79ee0d9a7324715c9a0e4cd97
2018-07-10 12:42:22 -07:00
Colin Cross
7c0f8e6ec7 Don't install android_library modules
am: 73ea6a3cf1

Change-Id: I23da7d99a5811345819f4dfc03e851487013a251
2018-07-10 08:20:02 -07:00
Colin Cross
a636d4181b Merge "Fix error reporting when parsing genrule cmd"
am: 4bf3d33846

Change-Id: I3e0f7fd861ccb919e77ad8262fea37d70f1acda7
2018-07-10 08:16:41 -07:00
Colin Cross
73ea6a3cf1 Don't install android_library modules
Skip dexing and installing android_library modules, the platform
can't load them directly anyways.

Test: m checkbuild
Change-Id: I4940569f0deb0eefbe52ac1bee6a32a8b2a2c5be
2018-07-10 14:54:24 +00:00
Colin Cross
4bf3d33846 Merge "Fix error reporting when parsing genrule cmd" 2018-07-10 14:53:06 +00:00
Tobias Thierer
7215e2c1cd Merge "Generate system modules for any value of EXPERIMENTAL_USE_OPENJDK9."
am: 4599ec5b0b

Change-Id: I89c1f9fc33eddd8f41896b19cfef3bc646d8b60b
2018-07-10 04:09:55 -07:00
Tobias Thierer
4599ec5b0b Merge "Generate system modules for any value of EXPERIMENTAL_USE_OPENJDK9." 2018-07-10 11:02:59 +00:00
Mathew Inwood
06a96bbc9d Add support for -apiMapping parameter in DocLava.
am: 76c3de1cea

Change-Id: I4050d5a0ae39e8206e81238d20d04e871ca69885
2018-07-10 00:43:20 -07:00
Logan Chien
2f2b890a18 Cleanup createVndkSourceAbiDump()
This commit cleans up `createVndkSourceAbiDump()` and renames it to
`shouldcreateVndkSourceAbiDump()`.

Test: lunch aosp_walleye-userdebug && make
Change-Id: Iff4379e2812c4b5c5baff288b938eed5d92e024f
2018-07-10 15:03:44 +08:00
Mathew Inwood
76c3de1cea Add support for -apiMapping parameter in DocLava.
This is used to output a mapping of class member signature to source
position, which in turn is used for automated addition of annotations in
frameworks code.

Metalava support does not exist (yet), and may not be needed, since the
addition of these annotations in a one-time thing. This change can be
reverted once this is complete.

See go/hidden-api-annotations for more context.

Test: m
Bug: 110868826
Change-Id: I90e409f6ea02b16eb9e03d92382f9bb46a8fdab5
2018-07-10 05:48:49 +00:00
Jiyong Park
0d08b06820 Merge "Fix: recovery module is disabled on 32-bit targets"
am: bdf16ec5b2

Change-Id: Ice8e0442c79ec3d673f33e8f8a229c1eccaa8b78
2018-07-09 18:45:11 -07:00
Treehugger Robot
bdf16ec5b2 Merge "Fix: recovery module is disabled on 32-bit targets" 2018-07-10 01:36:42 +00:00
Colin Cross
7540e609ea Merge "Sort and uniqify dangling rules list"
am: 93bb483ce2

Change-Id: Icb93e7cd27eca1add7105ba953b6964b89d56c8a
2018-07-09 18:16:01 -07:00
Treehugger Robot
93bb483ce2 Merge "Sort and uniqify dangling rules list" 2018-07-10 00:35:32 +00:00
Colin Cross
b6d2b5d931 Merge changes Ieaf37ba6,Ic69f1f93
am: ad234e4894

Change-Id: I53ede4011f281b0ab84f7e9a1fd36ee1f1a6a488
2018-07-09 17:18:44 -07:00
Colin Cross
f21c25f0fb Document build/soong/scripts/setup_go_workspace_for_soong.sh
am: aa070b422e

Change-Id: I05ad4f5d8160b23801817e055065a7387fd01125
2018-07-09 17:17:52 -07:00
Treehugger Robot
ad234e4894 Merge changes Ieaf37ba6,Ic69f1f93
* changes:
  pom2bp: extract minSdkVersion from manifest into Android.bp
  Add support for min_sdk_version
2018-07-10 00:16:29 +00:00
Colin Cross
aa070b422e Document build/soong/scripts/setup_go_workspace_for_soong.sh
Test: none
Change-Id: I507b7118bfc240166dced0cc26ab523ce56f68a2
2018-07-09 20:14:11 +00:00
Colin Cross
63b4e0f5c1 Sort and uniqify dangling rules list
Make the dangling rules list sorted and unique in order to avoid
very long lists when a dangling rule is referenced many times.

Also prettify the output by indenting the list and printing
"stopping" instead of a blank line for the fatal.

Test: m checkbuild
Change-Id: I8f7c27ae39b59f506b529d9995d90b0d6b9835d1
2018-07-09 20:13:52 +00:00
Colin Cross
cf53e608a7 pom2bp: extract minSdkVersion from manifest into Android.bp
When manifest merging in Soong is turned on the modules created
by pom2bp will need to have min_sdk_version specified in order
to prevent manifest_fixer from setting it to the current SDK
level.  Read the minSdkVersion attribute out of the
AndroidManifest.xml file inside each .aar file.

Bug: 110848854
Test: cd prebuilts/sdk/current/support && pom2bp -regen Android.bp
Change-Id: Ieaf37ba6eccaf32dc5d3411566335830b1a327ff
2018-07-09 13:10:35 -07:00
Colin Cross
83bb3167f6 Add support for min_sdk_version
Add min_sdk_version properties and use it for aapt2
--min-sdk-version and --target-sdk-version flags.  Add an sdkContext
interface that any function that needs an sdk version can take in
order to get the values for the current module.

Bug: 110848854
Test: m checkbuild
Change-Id: Ic69f1f935d8b865ec77689350407df08bfac5925
2018-07-09 12:42:01 -07:00
Colin Cross
85a2e89a14 Fix error reporting when parsing genrule cmd
Report errors inside the android.Expand lambda and don't return an
error so that processing can continue and multiple errors can be
reported.  Check for errors (for example incorrect syntax of variables)
immediately after Expand returns.  Avoids a misleading error message:
specified depfile=true but did not include a reference to '${depfile}' in cmd

Bug: 111219250
Test: m checkbuild
Change-Id: Id9a16c1609f5fd9345bfa1a2191261cff72fd382
2018-07-09 19:01:36 +00:00
Tobias Thierer
b1c697d03e Generate system modules for any value of EXPERIMENTAL_USE_OPENJDK9.
The flag EXPERIMENTAL_USE_OPENJDK9 controls the *default* value
of java_version / LOCAL_JAVA_LANGUAGE_VERSION, but that default
value can be overridden by individual build targets.

One requirement for individual build targets to opt-in to
java_version 1.9 is for system modules to be generated even if
the default language version is still < 1.9. We plan to allow
this soon for libcore targets; therefore, this CL changes the
system module targets to always be defined, regardless of the
value of EXPERIMENTAL_USE_OPENJDK9.

Test: In a workspace that has http://r.android.com/646840
      "make" no longer runs into the build failure from bug 76219552.
Bug: 76219552

Change-Id: I5193347452c7967f7695929619509aea0fd46844
2018-07-09 19:47:33 +01:00
David Brazdil
bd8b75e636 Add option to compile dex for a Java library
am: 17ef5635fa

Change-Id: Idc5df275cffabb7a4180a79ace529f03e9f0389a
2018-07-09 09:34:29 -07:00
David Brazdil
17ef5635fa Add option to compile dex for a Java library
Currently Soong will only compile a Java library into dex if the
library has device support and is installable. For our use case of
inspecting the dex at build time this is not sufficient. Add a new
"compile_dex" device property which forces the creation of a dex
rule. In this case, the class jar remains the output file of the
module.

Bug: 79409988
Test: on related CL
Change-Id: Ia908a47148a03a0bdb0da4315cce6efc86c51865
2018-07-09 16:04:41 +00:00