Move/dedupe some host path functions in package_ctx.go.
These functions don't need a PackageContext object.
Test: m
Bug: 145934348
Change-Id: Ia1da2c76cbad292f9ca79617199b2b5b6b265568
diff --git a/java/config/config.go b/java/config/config.go
index 333de32..fee6341 100644
--- a/java/config/config.go
+++ b/java/config/config.go
@@ -124,7 +124,7 @@
if ctx.Config().UnbundledBuild() {
return "prebuilts/build-tools/common/framework/" + turbine
} else {
- return pctx.HostJavaToolPath(ctx, turbine).String()
+ return ctx.Config().HostJavaToolPath(ctx, turbine).String()
}
})
@@ -170,7 +170,7 @@
if ctx.Config().UnbundledBuild() || ctx.Config().IsPdkBuild() {
return filepath.Join("prebuilts/sdk/tools", runtime.GOOS, "bin", tool)
} else {
- return pctx.HostBinToolPath(ctx, tool).String()
+ return ctx.Config().HostToolPath(ctx, tool).String()
}
})
}
@@ -180,7 +180,7 @@
if ctx.Config().UnbundledBuild() || ctx.Config().IsPdkBuild() {
return filepath.Join("prebuilts/sdk/tools/lib", tool+".jar")
} else {
- return pctx.HostJavaToolPath(ctx, tool+".jar").String()
+ return ctx.Config().HostJavaToolPath(ctx, tool+".jar").String()
}
})
}
@@ -194,7 +194,7 @@
}
return filepath.Join("prebuilts/sdk/tools", runtime.GOOS, "lib64", tool+ext)
} else {
- return pctx.HostJNIToolPath(ctx, tool).String()
+ return ctx.Config().HostJNIToolPath(ctx, tool).String()
}
})
}
@@ -204,7 +204,7 @@
if ctx.Config().UnbundledBuild() || ctx.Config().IsPdkBuild() {
return filepath.Join("prebuilts/build-tools", ctx.Config().PrebuiltOS(), "bin", tool)
} else {
- return pctx.HostBinToolPath(ctx, tool).String()
+ return ctx.Config().HostToolPath(ctx, tool).String()
}
})
}