diff options
author | 2024-03-07 19:24:47 +0000 | |
---|---|---|
committer | 2024-03-11 14:02:08 +0000 | |
commit | f4775ca238a91d9c6002f2b98ebd6e72663b3063 (patch) | |
tree | a62f4563ace5dcb4305dd582f6c8925310b23926 /sysprop | |
parent | b952c848417ee458682d3e3f6589cb31e221a9cb (diff) |
Make syspropRustGenRule work with absolute paths
This rule should be able to work with OUT_DIR set as absolute path,
which is used in "development/tools/ndk/update_ndk_abi.sh".
The problem appears if sysprop file itself is generated and
"syspropFile.String()" returns an absolute path, which is not accepted
as path component for "PathForModuleGen".
The fix is to use "android.GenPathWithExt" like in "syspropJavaGenRule".
Fixes: 328506541
Test: TreeHugger
Test: development/tools/ndk/update_ndk_abi.sh
Change-Id: Ia1e9a0ad51ebd957be97c48f5e1cf0e06a0da0ee
Diffstat (limited to 'sysprop')
-rw-r--r-- | sysprop/sysprop_library.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sysprop/sysprop_library.go b/sysprop/sysprop_library.go index 22582327e..82abba4cb 100644 --- a/sysprop/sysprop_library.go +++ b/sysprop/sysprop_library.go @@ -154,10 +154,10 @@ func (g *syspropRustGenRule) GenerateAndroidBuildActions(ctx android.ModuleConte }) for _, syspropFile := range android.PathsForModuleSrc(ctx, g.properties.Srcs) { - syspropDir := strings.TrimSuffix(syspropFile.String(), syspropFile.Ext()) - outputDir := android.PathForModuleGen(ctx, syspropDir, "src") - libPath := android.PathForModuleGen(ctx, syspropDir, "src", "lib.rs") - parsersPath := android.PathForModuleGen(ctx, syspropDir, "src", "gen_parsers_and_formatters.rs") + syspropDir := android.GenPathWithExt(ctx, "sysprop", syspropFile, "srcrust") + outputDir := syspropDir.Join(ctx, "src") + libPath := syspropDir.Join(ctx, "src", "lib.rs") + parsersPath := syspropDir.Join(ctx, "src", "gen_parsers_and_formatters.rs") ctx.Build(pctx, android.BuildParams{ Rule: syspropRust, |