Convert android_app and android_test's module-info.json to soong
This produces the following diffs, which I beleive are benign:
https://paste.googleplex.com/5631028455276544
We need to convert these to soong so that you can run these tests
with atest in soong-only builds.
Bug: 389720048
Test: diff'd out/target/product/vsoc_x86_64/module-info.json
Change-Id: Ic25e14d2cfbb56d9527302baefa6f69f55f113ee
diff --git a/android/module_context.go b/android/module_context.go
index 1620390..fd804d0 100644
--- a/android/module_context.go
+++ b/android/module_context.go
@@ -655,19 +655,21 @@
orderOnlyDeps = InstallPaths(deps).Paths()
}
- if m.Config().KatiEnabled() {
- // When creating the install rule in Soong but embedding in Make, write the rule to a
- // makefile instead of directly to the ninja file so that main.mk can add the
- // dependencies from the `required` property that are hard to resolve in Soong.
- m.katiInstalls = append(m.katiInstalls, katiInstall{
- from: srcPath,
- to: fullInstallPath,
- implicitDeps: implicitDeps,
- orderOnlyDeps: orderOnlyDeps,
- executable: executable,
- extraFiles: extraZip,
- })
- } else {
+ // When creating the install rule in Soong but embedding in Make, write the rule to a
+ // makefile instead of directly to the ninja file so that main.mk can add the
+ // dependencies from the `required` property that are hard to resolve in Soong.
+ // In soong-only builds, the katiInstall will still be created for semi-legacy code paths
+ // such as module-info.json or compliance, but it will not be used for actually installing
+ // the file.
+ m.katiInstalls = append(m.katiInstalls, katiInstall{
+ from: srcPath,
+ to: fullInstallPath,
+ implicitDeps: implicitDeps,
+ orderOnlyDeps: orderOnlyDeps,
+ executable: executable,
+ extraFiles: extraZip,
+ })
+ if !m.Config().KatiEnabled() {
rule := CpWithBash
if executable {
rule = CpExecutableWithBash
@@ -717,15 +719,17 @@
}
if m.requiresFullInstall() {
- if m.Config().KatiEnabled() {
- // When creating the symlink rule in Soong but embedding in Make, write the rule to a
- // makefile instead of directly to the ninja file so that main.mk can add the
- // dependencies from the `required` property that are hard to resolve in Soong.
- m.katiSymlinks = append(m.katiSymlinks, katiInstall{
- from: srcPath,
- to: fullInstallPath,
- })
- } else {
+ // When creating the symlink rule in Soong but embedding in Make, write the rule to a
+ // makefile instead of directly to the ninja file so that main.mk can add the
+ // dependencies from the `required` property that are hard to resolve in Soong.
+ // In soong-only builds, the katiInstall will still be created for semi-legacy code paths
+ // such as module-info.json or compliance, but it will not be used for actually installing
+ // the file.
+ m.katiSymlinks = append(m.katiSymlinks, katiInstall{
+ from: srcPath,
+ to: fullInstallPath,
+ })
+ if !m.Config().KatiEnabled() {
// The symlink doesn't need updating when the target is modified, but we sometimes
// have a dependency on a symlink to a binary instead of to the binary directly, and
// the mtime of the symlink must be updated when the binary is modified, so use a
@@ -768,15 +772,17 @@
m.module.base().hooks.runInstallHooks(m, nil, fullInstallPath, true)
if m.requiresFullInstall() {
- if m.Config().KatiEnabled() {
- // When creating the symlink rule in Soong but embedding in Make, write the rule to a
- // makefile instead of directly to the ninja file so that main.mk can add the
- // dependencies from the `required` property that are hard to resolve in Soong.
- m.katiSymlinks = append(m.katiSymlinks, katiInstall{
- absFrom: absPath,
- to: fullInstallPath,
- })
- } else {
+ // When creating the symlink rule in Soong but embedding in Make, write the rule to a
+ // makefile instead of directly to the ninja file so that main.mk can add the
+ // dependencies from the `required` property that are hard to resolve in Soong.
+ // In soong-only builds, the katiInstall will still be created for semi-legacy code paths
+ // such as module-info.json or compliance, but it will not be used for actually installing
+ // the file.
+ m.katiSymlinks = append(m.katiSymlinks, katiInstall{
+ absFrom: absPath,
+ to: fullInstallPath,
+ })
+ if !m.Config().KatiEnabled() {
m.Build(pctx, BuildParams{
Rule: Symlink,
Description: "install symlink " + fullInstallPath.Base() + " -> " + absPath,