Commit graph

187 commits

Author SHA1 Message Date
Jaewoong Jung
3ef77e89f0 Make runtime_resource_overlay product specific.
When mk2bp'ing a runtime_resource_overlay module, make it product
specific by default so that it reflects how the current make
configuration works.

Bug: 155783598
Test: bpfix_test.go
Change-Id: Icafa8228fe65ecc5b33ad80ad721e7997fbff383
2021-02-25 18:58:16 -08:00
Bob Badour
02040de891 Add LOCAL_LICENSE_KINDS to build/soong
Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  android/Android.bp
  android/soongconfig/Android.bp
  androidmk/Android.bp
  apex/Android.bp
  bazel/Android.bp
  bp2build/Android.bp
  bpf/Android.bp
  bpfix/Android.bp
  cc/Android.bp
  cc/config/Android.bp
  cc/libbuildversion/Android.bp
  cc/libbuildversion/tests/Android.bp
  cc/ndk_api_coverage_parser/Android.bp
  cc/ndkstubgen/Android.bp
  cc/symbolfile/Android.bp
  cmd/dep_fixer/Android.bp
  cmd/diff_target_files/Android.bp
  cmd/extract_apks/Android.bp
  cmd/extract_jar_packages/Android.bp
  cmd/extract_linker/Android.bp
  cmd/fileslist/Android.bp
  cmd/host_bionic_inject/Android.bp
  cmd/javac_wrapper/Android.bp
  cmd/merge_zips/Android.bp
  cmd/multiproduct_kati/Android.bp
  cmd/path_interposer/Android.bp
  cmd/pom2bp/Android.bp
  cmd/pom2mk/Android.bp
  cmd/sbox/Android.bp
  cmd/soong_build/Android.bp
  cmd/soong_env/Android.bp
  cmd/soong_ui/Android.bp
  cmd/zip2zip/Android.bp
  cmd/zipsync/Android.bp
  cuj/Android.bp
  dexpreopt/Android.bp
  dexpreopt/dexpreopt_gen/Android.bp
  env/Android.bp
  etc/Android.bp
  filesystem/Android.bp
  finder/Android.bp
  finder/cmd/Android.bp
  genrule/Android.bp
  jar/Android.bp
  java/Android.bp
  java/config/Android.bp
  kernel/Android.bp
  linkerconfig/Android.bp
  linkerconfig/proto/Android.bp
  makedeps/Android.bp
  partner/Android.bp
  phony/Android.bp
  python/Android.bp
  python/tests/Android.bp
  remoteexec/Android.bp
  rust/Android.bp
  rust/config/Android.bp
  scripts/Android.bp
  sdk/Android.bp
  sh/Android.bp
  shared/Android.bp
  symbol_inject/Android.bp
  symbol_inject/cmd/Android.bp
  sysprop/Android.bp
  tradefed/Android.bp
  ui/build/Android.bp
  ui/logger/Android.bp
  ui/metrics/Android.bp
  ui/metrics/proc/Android.bp
  ui/status/Android.bp
  ui/terminal/Android.bp
  ui/tracer/Android.bp
  xml/Android.bp
  zip/Android.bp
  zip/cmd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  finder/fs/Android.bp
  third_party/zip/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: Ia47ca14f16b8c9f84f9d533a07e5b00e2c04e8d4
2021-02-06 04:23:21 +00:00
Jaewoong Jung
18aefc1977 Remove unnecessary snake case variables.
Test: m nothing + TreeHugger
Change-Id: I99f7162944daa6c57c6ae4763261e108bb5cb6b1
2020-12-22 12:38:35 -08:00
Sasha Smundak
d63f7f0846 Add missing export/unexport directives
Test: treehugger
Bug: 172923994
Change-Id: I70494a02d37d149042a4d5772f1cf14b8bbcc06e
2020-12-07 14:15:07 -08:00
Sasha Smundak
cbc17ee62d Fix empty item handling in Split function, rewrite Words function
Test: treehugger
Bug: 172923994
Change-Id: Ic7ee7b1af6e1438df5cf06754b9bec7038b624f2
2020-12-04 17:24:03 -08:00
Sasha Smundak
7890211d58 Fix comments with continuation
Backgound: aog/919954 tried to handle
```
   second line
```

but did it incorrectly. The parser works correctly (so this change
reverts aog/919954), it returns multiline comment, but the serializer
converting the internal representation to Blueprint was not emitting
'//' on the lines after the first.

Test: treehugger
Bug: 127521510
Change-Id: I0257a8b3cc4ffcaa6bea44113ceba66bb99d7e43
2020-11-19 11:52:20 -08:00
Sasha Smundak
9c35d8bfde Parse else ifxxx statement
More recent versions of make provide "else ifdef/ifndef/ifeq/ifneq" directive:
ifdef FOO
...
else ifdef BAR
...
endif
Fix the parser to handle it. It returns the same Directive as the respective ifxxx
counterpart, only that the Name is set to "elifdef/elifndef/elifeq/elifneq".

Test: treehugger
Change-Id: I74c6a2c7224bce1dd3465012fa84880fae21349b
2020-11-17 23:18:14 -08:00
Dan Shi
d79572f73e Add unit_test test option in test configs
This change allows a test (native, java, rust or python) to be included
in host-unit-tests suite when test option `unit_test` is set to true.

Bug: 172006742
Test: m host-unit-tests
Change-Id: I69d3eb5b51198c549e2e6914ceac3a4fc33c3cf2
2020-11-16 11:05:00 -08:00
Colin Cross
405af07859 Revert "Make lots of tests run in parallel"
This reverts commit 323dc60712.

Reason for revert: Possible cause of test instability
Bug: 170513220
Test: soong tests

Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
2020-10-09 18:34:24 -07:00
Dan Shi
ee0b81a4fe Revert "Implement vts_config module"
This reverts commit ff36da04e8.

Reason for revert: remove vts10 harness and build configs
Bug: 169581727
Bug: 166662663
Test: build

Change-Id: I090b41c99c2279d24f08e4343289cbdcc7934f5d
2020-10-08 10:38:08 -07:00
Colin Cross
323dc60712 Make lots of tests run in parallel
Putting t.Parallel() in each test makes them run in parallel.
Additional t.Parallel() could be added to each subtest, although
that requires making a local copy of the loop variable for
table driven tests.

Test: m checkbuild
Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
2020-10-06 15:12:22 -07:00
Liz Kammer
0449a6337e Add relative_install_path property to prebuilt_etc
This supports a more consistent property across modules for specifying a
subdirectory to install a file into for prebuilt_etc modules.

Updates bpfix to rewrite `sub_dir` to `relative_install_path`.

Test: gotest prebuilt_etc_test
Test: gotest bpfix_test
Bug: 156568187
Change-Id: Idd05cd2178c46e290764a3b708faa8275818ca1e
2020-06-29 10:54:03 -07:00
Liz Kammer
5e4070cb6b Add androidmk error for multiple assignments
Identify variables that are cleared or reassigned, add an error and
prevent reassignment which caused a parser error.

Test: go test androidmk_test
Bug: 112653593
Change-Id: I0db3372b60812ff4cdaebb38a56ed0af0dbdb27e
2020-06-24 10:33:59 -07:00
Liz Kammer
9946f0308f Rename variables with "-" in androidmk
Make variables containg a "-" would succeed the translation to
blueprint, only to fail during the blueprint format step. Rename those
variables with a "-" and update references to them.

Test: androidmk_test.go
Bug: 112653593
Change-Id: Ifcbe1c6749a1e7f1e0b78cd6f01a8f1f52a334d0
2020-06-17 17:20:53 -07:00
Chris Parsons
26cdf135ff When bpfix fails in androidmk, output the tree anyway
This can help with debugging cases where the resulting blueprint file is
invalid.

Test: Manual run of androidmk
Change-Id: I39605afa851aa6cdd8b49cc56386a8fc7347115c
2020-06-09 16:01:51 -04:00
Liz Kammer
6e85e4c2bc Support preprocessed prebuilt tests in androidmk
Adds support to translate app prebuilt tests to android_test_import and
LOCAL_REPLACE_PREBUILT_APK_INSTALLED to preprocessed property.

Test: androidmk_test.go, bpfix_test.go
Bug: 155412211
Change-Id: I77c07c684125adf228ba91911998823a68b3a65d
2020-05-26 09:12:42 -07:00
Liz Kammer
74151f2c8c Add androidmk support for runtime_resource_overlay
Test: androidmk_test.go
Bug: 148673525
Change-Id: I25c277c52b91e9308e15d92364b5504a8f556c9f
2020-05-07 14:40:57 -07:00
Elliott Hughes
da3a071eaa Remove unused mips workarounds.
This was never really finished, and hasn't been supported for years.

Test: treehugger
Change-Id: I21d4c3112aa8cf0c56e59f0cc19ff8725ef714b9
2020-03-06 18:15:44 -08:00
Sasha Smundak
6a9f5cfa1e Emit error if expression cannot be evaluated to boolean during androidmk conversion
Fixes: 127517965
Test: run androidmk /sdx/asmundak/repos/iandr/vendor/google_paintbox/amber/camera/tests/Android.mk
Change-Id: If7b6bcb88bb8f25d3f421a847750a82b1e50833e
2020-02-28 09:18:08 -08:00
Colin Cross
988414c2cf Sandbox soong_build by changing to root directory
This relands I12a0f907753fefd1997ab8b4ea2ac331234093cf along with
a fix to blueprint for absolute paths.

Store the current working directory and then change to the root
directory so that all file accesses must go through helpers in
the android package that properly track dependencies.

Change-Id: I24ac485677aa102eec1a2521d16820da6ee1ae77
Fixes: 146437378
Test: m checkbuild
Test: m OUT_DIR=/tmp/out nothing
2020-01-11 01:11:46 +00:00
Colin Cross
47e4f9e1e8 Revert "Sandbox soong_build by changing to root directory"
This reverts commit 05c25ccb4a.

Reason for revert: broke absolute OUT_DIR
Bug: 146437378

Change-Id: I523ed79d40e1c1ef040212ba794a7a084abea75d
2020-01-10 18:51:04 +00:00
Colin Cross
05c25ccb4a Sandbox soong_build by changing to root directory
Store the current working directory and then change to the root
directory so that all file accesses must go through helpers in
the android package that properly track dependencies.

Fixes: 146437378
Test: m checkbuild
Change-Id: I12a0f907753fefd1997ab8b4ea2ac331234093cf
2020-01-09 14:19:46 -08:00
Colin Cross
ce23942f3c Move partner androidmk and bpfix files to match their package path
Using a gomod-aware editor with build/soong requires that files
in build/soong can be mapped to the android/soong package path.
Move the partner androidmk and bpfix files such that their path
matches the package path when the android/soong package prefix is
replaced with the build/soong path prefix.

Test: go test ./...
Test: m bpfix androidmk partner_bpfix partner_androidmk
Change-Id: Ic7f7aad9e5eb9178eef0383f0b37e4fb93ce8314
2019-11-11 15:44:09 -08:00
Sasha Smundak
541056c3fa Add dont_merge_manifests attribute to android_test
Bug: 122332514
Test: treehugger, convert cts/tests/tests/content
Change-Id: Ib66fcafd7c31913402cd390dfecce292b1817729
2019-10-28 15:55:58 -07:00
Justin DeMartino
ac38d7e521 Add support to extend commands bpfix and androidmk
Allows our partners to maintain partner-specific fixes in their repos. Converts most of androidmk into a library similar to bpfix. Makes some methods and types public for use by extended versions.

Bug:140727544
Test: Ran unit test cases &&
  ran test conversions with sample
Change-Id: I7e1fbf3a6a7a8bd47334f43fe3eb68cbbd3426c1
2019-10-25 16:18:15 +00:00
changho.shin
b5432b7a3d Add 'Additional_manifest' property to merge other manifests
This is equivalent to 'LOCAL_FULL_LIBS_MANIFEST_FILES' in Make.

Fixes: 123374442
Test: m -j
Change-Id: Ic4b40a08f2454687c74949020598651acea3b2dd
2019-08-13 08:30:00 +00:00
Justin Yun
d5f6c8261a Rename product_services to system_ext
Bug: 134359158
Test: build and check if system_ext.img is created
Change-Id: Ice3229baf97a94c24a6eea22e7d4571941d7f843
2019-07-09 08:57:05 +00:00
Paul Duffin
a3d0986cfc Remove the no_standard_libs property
Corrects an error message that refers to no_standard_libs.

Removes any tests that use no_standard_libs:true where possible as
there are duplicate tests for sdk_version:"none". Otherwise, switches
them over to use sdk_version:"none".

The androidmk mapping from LOCAL_NO_STANDARD_LIBRARIES to
no_standard_libs has also been removed. There was little point in
updating the tool to map it through to sdk_version:"none" as there are
only a couple of places where it is used, in art's test running mk
targets and in some unbundled packages to work around some limitation
in .mk based build.

Bug: 134566750
Test: m droid
Change-Id: I6413c9b1fe3e63b93753a6a017d2981e32b7e013
2019-06-17 11:21:39 +01:00
Treehugger Robot
b6fd6f75f2 Merge "Clean up sortedKeys function" 2019-06-10 19:16:14 +00: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
Patrice Arruda
1ef3bb5d51 Soong: Add mk2bp conversion for prebuilt_firmare.
There are a couple of makefiles that have etc with $(TARGET_OUT)/etc/firmware,
$(TARGET_OUT_VENDOR)/firmare as the local module path. Added the conversion in
androidmk for target.

Bug: b/133711895
Test: Unit test cases.
Change-Id: I74aca18a7eb8aa4dd692cde680fa4e112edcf6d1
2019-06-04 17:10:48 -07:00
Mitch Phillips
bfeade6424 Fix fuzzer builds [#2].
- Updates the fuzzer builds to use SANITIZE_TARGET='fuzzer' instead of
'coverage'.
- Removed an old dependency that made fuzzer builds without ASan
an error.
- Fixed up the build flags to allow fuzzers to be built. Previously, the
coverage flags were manually provided. As the toolchain has moved on,
these flags are no longer compatible with libFuzzer, and so I've updated
them to use the correct, compatible flags.
- Added a dependency mutator for fuzzer coverage.

Bug: 121042685
Test: With all patches in the bug merged, build a fuzzer using
'SANITIZE_TARGET=fuzzer mmma <your_fuzzer>'.

Change-Id: Ib6246980f77bc4babe587b1e88038aa12228fa83
Merged-In: Ib6246980f77bc4babe587b1e88038aa12228fa83
2019-05-30 16:49:42 +00:00
Treehugger Robot
13feeb7b62 Merge "Convert LOCAL_COMPATIBILITY_SUPPORT_FILES to data: attribute in androidmk" 2019-05-24 16:25:48 +00:00
Jaewoong Jung
a725681ed8 Merge "androidmk conversion logic for android_app_import" 2019-05-23 20:55:57 +00:00
Sasha Smundak
0d11feb42f Convert LOCAL_COMPATIBILITY_SUPPORT_FILES to data: attribute in androidmk
Fixes: 133434805
Test: build executes internal tests
Change-Id: I688672cec640f0113dc06a19a87c097cda60d180
2019-05-23 13:02:06 -07:00
Patrice Arruda
d1f45c8967 Soong: Add mk2bp conversion for prebuilt_font.
There are a couple of makefiles that have etc with $(TARGET_OUT)/fonts
and $(TARGET_OUT_PRODUCT)/fonts  as the local module path. Added the
conversion in androidmk for target.

bug: b/123403785
Test: Wrote and ran unit test cases, did a test conversion on
        * platform/external/google-fonts/dancing-script/Android.mk
        * internal/external/google-fonts/arbutus-fonts/Android.mk
Change-Id: Id67e10f80b32b27c5027cd274a7944801dad0880
2019-05-16 10:48:32 -07:00
Jaewoong Jung
e07b0b60e5 androidmk conversion logic for android_app_import
Test: androidmk_test.go, bpfix_test.go
Bug: 128610294
Change-Id: Ide183ba1e696fa0ffb4245e3288ffc47535b39af
2019-05-15 12:33:11 -07:00
Patrice Arruda
77311df787 Soong: Add mk2bp conversion for prebuilt_usr_share.
There are a couple of makefiles that have etc with $(TARGET_OUT)/usr/share
as the local module path. Added the conversion in androidmk for target
and host.

Bug: b/132123818
Test: Wrote and ran unit test cases, did a test conversion on
      external/neven/Android.mk makefile.

Change-Id: Iafed89f4cee499f561a1235f8870b1f1329e99bc
2019-05-10 12:59:37 -07:00
Dan Willemsen
4e0aa23dd3 Convert yacc to a single RuleBuilder rule
So that <module>/gen/yacc/... is (re)created by a single rule, previous
files are removed, and location.hh is in the build graph when it is
produced.

Test: treehugger
Change-Id: I2f6e47ea07f315e10ae1cb8ad50697e7123d0285
2019-04-15 14:52:05 -07:00
Sasha Smundak
9223a6262a Handle LOCAL_JAVA_RESOURCE_FILES variable
Fixes: 130040716
Test: treehugger, internal unit test
Change-Id: I3fcc5e041d6e4eaa5d2d4ab75f9a645e724fab1b
2019-04-05 13:53:39 -07:00
Sasha Smundak
b6d230515e Implement host_required and target_required properties.
They are counterparts of LOCAL_HOST_REQUIRED_MODULES and
LOCAL_TARGET_REQUIRED_MODULES respectively.

Fixes: 128693436
Test: treehugger, convert cts/hostsidetests/devicepolicy/Android.bp
Change-Id: Id66ffca6edffe18993ac51e8930f1d0e78178249
2019-04-04 11:24:01 -07:00
Colin Cross
1001a7971a Rename jetifier property and add it to androidmk
Rename jetifier_enabled to jetifier since there are no users
yet and it is more consistent with the rest of the Soong
properties.  Also add it to androidmk translation.

Fixes: 123524520
Test: androidmk_test.go
Change-Id: Ib4c688cf3cb171a822ddf7dd49467522c4c1276c
2019-03-22 15:25:30 +00:00
Ng Zhi An
2935b409fc Rename test description
Bug: 127712304
Test: m androidmk
Change-Id: I1ffb07c2bce0c3890d8e8d8a5661ba351bcadd68
2019-03-19 12:50:13 -07:00
Ng Zhi An
e02e41a9ea Skip obsolete JACK flags
Fixes: 127712304
Test: m androidmk
Change-Id: Ia2f0ccd184151c691563779d1828c111800ed382
2019-03-15 15:03:49 -07:00
Sasha Smundak
177a1a589d Fix crash in mergeListProperties
The value of a property to be merged may be a reference to a variable.
When we first create an attribute for a makefile variable (e.g. we
create 'android_static_libs' from LOCAL_STATIC_ANDROID_LIBRARIES), we
set its type correctly. However, reparse in bpfix erases this
information, so by the time 'android_static_libs' attribute is to be
merged with 'static_libs', it has no type and merge occurs. It isn't
easy to fix properly, so just don't merge in such case, Soong will
complain and it will be fixed manually.

Fixes: 125519127
Test: unit tests in androidmk_test.go
Change-Id: Ic66d7ab686a2fdde987f32e2b204c72d9bf0d026
2019-03-11 10:11:17 -07:00
Sasha Smundak
e10952b442 Do not "escape" newline if comment ends with ESC character.
Fixes: 127521510
Test: manual
Change-Id: I88a8eb2ca94b8aa06e2682d2c14f9e74f5ada286
2019-03-06 16:46:23 -08:00
Jaewoong Jung
b8ba8a5ee8 Fixe typos in androidmk.
Replace contitional with conditional.

Test: androidmk_test.go
Change-Id: Ic261701f4588b9b8b6d3560598831368c3422508
2019-03-05 22:29:58 +00:00
Sasha Smundak
aa7fdad7f3 Revert $(LOCAL_PATH) handling for certificate and
`additional_certificates` properties.

Bug: 122728056
Test: builtin tests
Change-Id: I96f84bf7396447b0207438a4073c864f2d9b1ab7
2019-03-01 11:11:10 -08:00
Sasha Smundak
1d318cbaa9 Handle $(LOCAL_PATH) in androidmk
The variables LOCAL_ADDITIONAL_CERTIFICATES. LOCAL_ASSET_DIR,
LOCAL_CERTIFICATE, LOCAL_JARJAR_RULES, LOCAL_PROGUARD_FLAG_FILES,
LOCAL_RESOURCE_DIR specify the paths relative to the top of the
source tree using $(LOCAL_PATH)/. Remove it when converting to
blueprint files and diagnose the cases when these paths do not start
with $(LOCAL_PATH).

Fixes: 122728056
Test: Internal tests
Change-Id: Id3fcacdd5445a97365c03e00656291bfe829c035
2019-02-25 15:19:06 -08:00
Sasha Smundak
f7ed0513e9 Handle LOCAL_MODULE_PATH assignment for android_test modules
Many Android.mk files for the CTS tests have
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
statement. This can be dropped during the conversion to blueprint
files.
Also, ignore the assignments to obsolete LOCAL_CTS_TEST_PACKAGE
variable.

Fixes: 125405331
Test: Internal tests, selectively run androidmk on Android.mk's in cts/
directory

Change-Id: I2ed88acd3c8837f96b84be6eb7c7b9b0b5405f57
2019-02-22 15:10:08 -08:00