Commit graph

14 commits

Author SHA1 Message Date
Jooyung Han
12df5fb471 soong: Fix AndroidMk with *Required properties
java.Module is using "Custom" function to write Android.mk.
And if "hostdex" is set to "true", it writes "hostdex" module definition
as well as original module.

As of now, Required/Host_required/Target_required props are filled in
the AndroidMkEntries structure(aosp/939505). But these are not
passed to old AndroidMkData.Custom function.

So, if a java_library declares "hostdex:true" and "required:[...]"
together, "required" is not applied to the "hostdex" variant.

This change copies *Required props from AndroidMkEntries to
AndroidMkData before calling its Custom callback.

Test: m (runs soong unit tests)
Change-Id: I5f85714f721a2a0917ab18072dbea52294c770e7
2019-07-16 02:28:29 +09:00
Inseob Kim
1a365c6a7f Clean up sortedKeys function
This introduces a generic function SortedStringKeys which can be used to
get a slice of sorted string keys for all kinds of maps having string
keys.

Bug: N/A
Test: m
Change-Id: I542194c68984d909b7ad1dbf060d4d3a98f0ef23
2019-06-08 16:10:38 +09:00
Inseob Kim
1f086e2f0d Generate VNDK snapshot with Soong except configs
This is the first commit to generate VNDK snapshot with Soong: .so
files, some txt files, and notice files are captured with Soong. As
ld.config.txt is currently in Android.mk and will be deprecated soon,
configs files (and zipping all of artifacts) are still handled with
Makefile.

Bug: 131564934
Test: 1) DIST_DIR=out/dist development/vndk/snapshot/build.sh
Test: 2) try installing vndk snapshot with:
     development/vndk/snapshot/update.py

Change-Id: I8629e1e25bfc461fd495565bb4872c9af176cf92
2019-05-15 10:26:54 +09:00
Colin Cross
3020fee889 Support go 1.12
go 1.12 changed the stack trace of a function call during global
variable initialization to contain a function called
"PKG.init.ializers".  Fix callerName to split the package path
and function name on the first "." after the last "/", and look
for functions called "init.ializers" or functions with the
prefix "init."

Test: Soong tests with go 1.12
Change-Id: I25f1ba989ef2d65ca85cb7c9d84454cca230ff86
2019-03-19 23:47:22 +00:00
Colin Cross
454c087be6 Add CopyOf utility method
Add a utility method that returns a copy of a slice of strings.
This is primarily useful when appending to a string slice to avoid
accidentally reusing the backing array.

Test: util_test.go
Change-Id: I7801fc7ca19e27ddc9f1b1b452788b723c7f619c
2019-02-19 11:19:09 -08:00
Jiyong Park
7f67f48cbb Add PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES
It is a list of <module_name>:<manifest_name> pairs. When the module
name of an APK or an APEX matches with <module_name>, then its app
manifest name is overridden to <manifest_name>.

<module_name> and <manifest_name> can be patterns as in
com.android.%:com.mycompany.android.%.release

Note that, in case of APEXes, the manifest name refers to the name of
the zip container. The apex manifest name (which is specified in
apex_manifest.json) is not overridden.

Test: m with PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES for
1) an APK in Android.mk
2) an APK in ANdroid.bp
3) an APEX
and check that manifest names are modified as specified

Change-Id: Ie58882d90884695e893944c43d9c8803b283e93d
2019-01-09 21:12:27 +09:00
Logan Chien
7922ab8da6 RemoveFromList() should remove all matches
RemoveFromList() should remove all matches.  Before this commit,
RemoveFromList() only removes the first match.  This commit rewrites
RemoveFromList() so that it will remove all matches.  Besides, a unit
test is written.

Note: aosp/461936 wants to make sure libc.so precedes libdl.so in
DT_NEEDED entries.  However, if there are two "libdl" in shared_libs,
aosp/461936 won't achieve its goal because RemoveFromList() (prior to
this commit) only removes the first "libdl".

Bug: 62815515
Test: Build sailfish and check libstagefright.so
Change-Id: I9bec563cbf800bff4bd508fb21e28869a92cfe56
2018-03-09 13:41:56 +08:00
Colin Cross
b4330e222b Move string list utility functions to android package
Test: m checkbuild
Change-Id: I50a7ccf9fd7ed82b688e3eb90489c0bc0af33287
2017-12-28 17:41:02 +00:00
Sundong Ahn
0926fae350 Add system_$(VER)
The system_$(VER) is added for vendor, similar to sdk.

Bug: 67724799
Test: build
Merged-In: I2545c92707591ca278066870c74e9f49e9825855
Change-Id: I2545c92707591ca278066870c74e9f49e9825855
(cherry picked from commit b8baff1fa3)
2017-12-01 00:41:59 +00:00
Colin Cross
b671544973 Move first/last unique elements utility functions to android package
Move firstUniqueElements to android.FirstUniqueStrings,
lastUniqueElements to android.LastUniqueStrings, and lastUniquePaths
to android.LastUniquePaths.

Test: m checkbuild
Change-Id: Ieac840405126c7f8f98afb4a4ef35c01a18fe7fb
2017-10-24 12:12:32 -07:00
Ivan Lozano
5f59553bca Allow integer_overflow sanitizer path exclusion.
Add support for excluding paths from having integer_overflow applied to
them when using SANITIZE_TARGET=integer_overflow via an
INTEGER_OVERFLOW_EXCLUDE_PATHS make variable. This covers the soong side
of the change.

Bug: 30969751
Test: Build with SANITIZE_TARGET=integer_overflow
SANITIZE_TARGET_DIAG=integer_overflow
INTEGER_OVERFLOW_EXCLUDE_PATHS=<path> and confirmed this was no
longer being applied to binaries in that path.

Change-Id: I298b772f5425da28dff1cf007825be19558db3a8
2017-07-18 13:38:20 -07:00
Colin Cross
7f19f37443 Move globbing to Blueprint
Move Soong's globbing-with-dependencies support into Blueprint so it can
be used for subdirs= lines in Android.bp files.

Blueprint has a slight change in behavior around subname= lines, it now
always uses the subname and doesn't fall back to Blueprints.  To support
the Blueprints files in build/blueprint, use them directly with build=.

Test: build, add source file that matches glob, rebuild
Change-Id: Ifd0b0d3bc061aae0a16d6c7ca9a1cd8672656b4d
2016-11-04 04:54:16 +00:00
Dan Willemsen
b1957a5021 Dynamically generate arch struct
Now we don't need to hardcode the list of OS/Arch/Variant/Features in
android/arch.go.

Change-Id: I0f9cc35d55baa31f036825fdf5b9dd30d076e56e
2016-09-08 13:50:36 -07:00
Colin Cross
635c3b0157 Rename common to android
Rename the "common" package to "android", because common is too
generic.  Also removes all android.Android naming stutter.

Ran:
gomvpkg -from 'android/soong/common' -to 'android/soong/android'
gorename -from '"android/soong/android".AndroidModuleContext' -to 'ModuleContext'
gorename -from '"android/soong/android".AndroidBaseContext' -to 'BaseContext'
gorename -from '"android/soong/android".AndroidModuleBase' -to 'ModuleBase'
gorename -from '"android/soong/android".AndroidBottomUpMutatorContext' -to 'BottomUpMutatorContext'
gorename -from '"android/soong/android".AndroidTopDownMutatorContext' -to 'TopDownMutatorContext'
gorename -from '"android/soong/android".AndroidModule' -to 'Module'

Change-Id: I3b23590b8ce7c8a1ea1139411d84a53163288da7
2016-05-18 15:37:25 -07:00
Renamed from common/util.go (Browse further)