Add android_info module type
This is heavily inspired by the implementation in
https://r.android.com/3081436. `android_info` will generate a .txt file
with board specific information which will subsequently be used to
generate build.prop file for vendor.
The key differences are
1. `android_info` is not a singleton module.
2. Create android_info.prop from android_info.txt. The .prop file will
be passed to --prop-files when generating /vendor/build.prop
3. Board info properties like `TARGET_BOARD_INFO_FILES` will not be
added to android.Config API. (But they will be added to the unstable
`PartitionVarsForSoongMigrationOnlyDoNotUse` in a followup CL)
3. android-info.txt will _not_ be installed via ctx.InstallFile,
atleast for now. This file is created in $PRODUCT_OUT, but not
installed on device.
Test: m nothing --no-skip-soong-tests
Bug: 375500423
Change-Id: Ie79f4f5fe828d7876c12e224f4dff1cc17e1b4d4
diff --git a/android/build_prop_test.go b/android/build_prop_test.go
new file mode 100644
index 0000000..e75975a
--- /dev/null
+++ b/android/build_prop_test.go
@@ -0,0 +1,41 @@
+// Copyright 2024 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package android
+
+import (
+ "testing"
+)
+
+func TestPropFileInputs(t *testing.T) {
+ bp := `
+build_prop {
+ name: "vendor-build.prop",
+ stem: "build.prop",
+ vendor: true,
+ android_info: ":board-info",
+ //product_config: ":product_config",
+}
+android_info {
+ name: "board-info",
+ stem: "android-info.txt",
+}
+`
+
+ res := GroupFixturePreparers(
+ FixtureRegisterWithContext(registerBuildPropComponents),
+ ).RunTestWithBp(t, bp)
+ buildPropCmd := res.ModuleForTests("vendor-build.prop", "").Rule("vendor-build.prop_.vendor-build.prop").RuleParams.Command
+ AssertStringDoesContain(t, "Could not find android-info in prop files of vendor build.prop", buildPropCmd, "--prop-files=out/soong/.intermediates/board-info/android-info.prop")
+}