Commit graph

28 commits

Author SHA1 Message Date
Kevin
93f7cd8528 Add support for prebuilt_overlay module type in soong
In Android 11 or higher, you can use OverlayConfig
to configure the mutability, default state, and priority
of overlays.

To configure an overlay, you need to create a config.xml
in partition/overlay/config/. Since there is no module type
in soong to install prebuilt artifacts on that location
(like prebuilt_etc for example) we need to manually create
and move that file using Make duing the build process.

This commit adds support to instead create that file
using soong. Then we can instead do something along the
lines of:

prebuilt_overlay {
    name: "test-overlay",
    src: ":generate-test-overlay",
    sub_dir: "config",
    filename: "config.xml",
    product_specific: true,
}

which would create a config.xml file at the overlay/
directory of the partion in which the overlay is configured,
product/ in this example.

Test: cd build/soong/etc ; go test -run \
      TestPrebuiltOverlayInstallDirPath

Bug: 340833016

Change-Id: Iaecae7784683fb9c4306a6834b3ee705c9c20806
2024-05-16 11:00:32 +02:00
yangbill
85527e6aab Add support for keyboard prebuilt module type
Add 3 different module type:
 - prebuilt_usr_keylayout
 - prebuilt_usr_keychars
 - prebuilt_usr_idc

Bug: 337998675
Test: cd build/soong/etc ; go test -run \
      TestPrebuiltPrebuiltUserKeyLayoutInstallDirPath
Test: cd build/soong/etc ; go test -run \
      TestPrebuiltPrebuiltUserKeyCharsInstallDirPath
Test: cd build/soong/etc ; go test -run \
      TestPrebuiltPrebuiltUserIdcInstallDirPath
Change-Id: I5bafbc48dd0edd0d06783b89b904330a2a30c743
2024-04-30 08:24:50 +00:00
Kiyoung Kim
1db4a74a59 Remove VNDK information from Rust, etc, and sysprop tests
VNDK is deprecated in 24Q2, so soong should be tested with no device and
platform vndk versions. This change removes all VNDK related tests and
VNDK versions from soong-etc, soong-rust and soong-sysprop tests.

Bug: 330100430
Test: m nothing --no-skip-soong-tests passed
Change-Id: Ie34d23f0facab31078de54682f7cc78d37fcd4be
2024-04-01 15:53:58 +09:00
yangbill
63c5e192c3 Add support for prebuilt_usr_hyphendata type
Bug: 331551860
Test: cd build/soong/etc ; go test -run \
      TestPrebuiltPrebuiltUserHyphenDataInstallDirPath
Change-Id: I78d647eea9a84665dd9c78940c51d2fb948c04f8
2024-03-27 09:06:06 +00:00
Thiébaud Weksteen
00e8b31ee6 Support multiple sources for prebuilt_etc
Keep the Src attribute for compatibility. The new attribute (Srcs) is
mutually exclusive with Src.

Keep SourceFilePath and OutputFile for compatibility with other modules.
These can be removed in a follow up change.

Bug: 328313691
Test: presubmit
Test: m blueprint_tests
Test: prebuilts/build-tools/build-prebuilts.sh (on build-tools branch)
Change-Id: I5d5b2657715a7180a829c7ed0f501872d561b662
2024-03-21 11:30:15 +11:00
Colin Cross
8ff105860d Remove ConvertWithBp2build implementations
Remove the ConvertWithBp2build implementations from all the module
types, along with the related code.

Bug: 315353489
Test: m blueprint_tests
Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
2023-12-08 13:51:05 -08:00
Cole Faust
dff9c14148 Add install_symlink soong module type
This can be used to install symlinks to arbitrary locations/targets
on the device. Used to replace a make-built symlink.

Bug: 205632228
Test: built and ran the emulator observed the /system/bin/hwservicemanager symlink is still there
Change-Id: I6df922c8d919e6d56fa79702815a89c98f4d65ed
2023-09-01 17:18:48 -07:00
Spandan Das
756d3400d6 Mixed builds support for prebuilt_* targets
These targets do not have any build actions per se, but return a
PrebuiltFileInfo provider. Parse this info from cquery and generate the
appropriate installation rules and androidmk entries

Details
- Support the bp2build available properties. Not all properties have
  been converted by bp2build yet, and those are being tracked in b/207489266
- Create a addInstallRules helper function to reduce duplication between
  GenerateAndroidBuildActions and ProcessBazelQueryResponse

Test: unit test
Bug: 280094612
Change-Id: Ia67986af1dd2ff4712586dbec86ee9fda380f726
2023-06-07 22:08:35 +00:00
Wei Li
598f92d704 Export Soong module type to LOCAL_SOONG_MODULE_TYPE to Make for SBOM generation.
Bug: 266726655
Test: CI

Change-Id: If5b1a77930a591b6061ca2749c9c5ad29b4491fb
2023-03-06 22:51:03 +00:00
Colin Cross
725eac60a2 Add AllowMissingDependencies support for prebuilt_etc module with no src property
Arch-specific prebuilt_etc modules may be missing source files for new
architectures.  Allow build analysis to continue when there is no
source file when AllowMissingDependencies is set.

Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Test: TestPrebuiltEtcAllowMissingDependencies
Change-Id: I647c7305339e3ed80283be5e59e6f4ef15ae2384
2022-10-04 16:38:14 -07:00
Colin Cross
78fd15f7d6 Merge "Replace android.BuildOs with Config.BuildOS" 2021-07-23 00:07:01 +00:00
Colin Cross
0c66bc615b Replace android.BuildOs with Config.BuildOS
Replace the android.BuildOs constant with Config.BuildOS so that it
can vary based on the product config.

Bug: 190084016
Test: all Soong tests
Change-Id: Ia67f872d8b2ab788747a22e3a9659dc21c9775cd
2021-07-20 12:46:48 -07:00
Kiyoung Kim
ae11c233b5 Update prebuilt_etc available for snapshot
Make prebuilt_etc module available for the snapshot. This change
includes implementing snapshot interface for the prebuilt_etc module so
it can be added to the snapshot from the fake snapshot, or when the
module is specified in the list.

Bug: 192430376
Test: m nothing passed
Test: Checked if the module is included in the snapshot properly
Change-Id: I3574d2a1b8f8f4e5f083f3913e8768f5088d0c46
2021-07-20 11:24:03 +09:00
Colin Cross
8d0ed7ebd5 Merge "Add prebuilt_rfsa module type" 2021-04-30 16:35:20 +00:00
Inseob Kim
27408bf32c Add prebuilt_root module
prebuilt_root supports installing files directly under root.

Bug: 181728482
Test: soong test, manual
Change-Id: Ib1f9a4fd4c9a47094d5f41106fc12696741e2ff1
2021-04-14 13:19:29 +09:00
Colin Cross
83ebf23a0d Add prebuilt_rfsa module type
Add a prebuilt_rfsa module type that can install firmware files to
vendor/lib/rfsa.

Bug: 181289338
Test: TestPrebuiltRFSADirPath
Change-Id: I9dcf6a2188e60f361673bf876a52e985ab709d2e
2021-04-09 10:27:03 -07:00
Paul Duffin
89648f98fa Remove usages of FixtureFactory from misc packages
These packages have already been migrated to use per test build
directory so have no need for a FixtureFactory.

Bug: 183235980
Test: m nothing
Change-Id: I667d1d992caaf0f615de91f89efdae11c44986c2
2021-03-22 18:31:53 +00:00
Paul Duffin
5f9f771dab Migrate etc package to a per test build directory
Bug: 182885307
Test: m nothing
Change-Id: I0f516efdf3344ba4c5d70c2fcc8d322f56e12a86
2021-03-16 12:46:52 +00:00
Paul Duffin
e84b1338c5 Migrate from result methods to function Asserts
Bug: 181070625
Test: m nothing
Change-Id: Iadb85270290acb52c55f2ad70c9f145f1c34b611
2021-03-12 22:24:51 +00:00
Paul Duffin
921fac7cf9 Convert etc tests to use test fixtures
Bug: 181070625
Test: m nothing
Change-Id: Ic248e233f57f966164284d7cab813398305482c9
2021-03-10 09:51:30 +00:00
Paul Duffin
1172fed8eb Support test fixtures in etc package
Restructures the etc package test setup code to create FixturePreparer
instances for setting up a test fixture.

Bug: 181070625
Test: m nothing
Change-Id: I6f269c9cb3f4ab2756beddd13a719f9b222f7156
2021-03-09 23:06:00 +00:00
Colin Cross
aa2555387d Add ctx to AndroidMkExtraEntriesFunc
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to
access providers.

Test: m checkbuild
Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
2021-02-19 23:05:40 +00:00
Colin Cross
ae8600b507 Pass Config to NewTestContext instead of ctx.Register
Prepare for using Config when adding singletons by passing
Config to NewTestContext and NewContext instead of to ctx.Register.
This will enable a followup change to store SingletonMakeVarsProviders
registered on the Context in the Config, which is necessary to run
multiple tests in parallel without data races.

Test: all soong tests
Change-Id: Id229629a4e42ff4487d317241673837726c075fc
2020-11-12 10:07:49 -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
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
Patrice Arruda
0f688004b1 Add a new module named prebuilt_dsp.
prebuilt_dsp soong module allows to install DSP related file to
<partition>/etc/dsp directory. If soc_specific property is enabled
to true, it is then installed to <partition>/dsp directory for
vendor image.

Bug: b/157259542
Test: Wrote unit test cases.
Change-Id: I15431a14bf399338a00835718dfe29544be02e34
2020-06-17 15:38:22 +00:00
Jaewoong Jung
4b79e98a6e Soong package structure refactoring
Give prebuilt_etc and sh_binary their own packages and split the
gigantic main Android.bp up to small, per-package ones.

Test: m nothing, TreeHugger
Bug: 156980228
Change-Id: I7b00cd344b9f16861f1ff39edf0029f016b853d0
2020-06-01 13:44:48 -07:00
Renamed from android/prebuilt_etc_test.go (Browse further)