Lines Matching refs:ctx

158 func constructPath(ctx android.PathContext, path string) android.Path {
159 buildDirPrefix := ctx.Config().BuildDir() + "/"
163 return android.PathForOutput(ctx, strings.TrimPrefix(path, buildDirPrefix))
165 return android.PathForSource(ctx, path)
169 func constructPaths(ctx android.PathContext, paths []string) android.Paths {
172 ret = append(ret, constructPath(ctx, path))
177 func constructWritablePath(ctx android.PathContext, path string) android.WritablePath {
181 return constructPath(ctx, path).(android.WritablePath)
186 func ParseGlobalConfig(ctx android.PathContext, data []byte) (*GlobalConfig, error) {
203 …config.GlobalConfig.DirtyImageObjects = android.OptionalPathForPath(constructPath(ctx, config.Dirt…
204 config.GlobalConfig.BootImageProfiles = constructPaths(ctx, config.BootImageProfiles)
219 func GetGlobalConfig(ctx android.PathContext) *GlobalConfig {
220 return getGlobalConfigRaw(ctx).global
225 func GetGlobalConfigRawData(ctx android.PathContext) []byte {
226 return getGlobalConfigRaw(ctx).data
232 func getGlobalConfigRaw(ctx android.PathContext) globalConfigAndRaw {
233 return ctx.Config().Once(globalConfigOnceKey, func() interface{} {
234 if data, err := ctx.Config().DexpreoptGlobalConfig(ctx); err != nil {
237 globalConfig, err := ParseGlobalConfig(ctx, data)
245 return ctx.Config().Once(testGlobalConfigOnceKey, func() interface{} {
267 func ParseModuleConfig(ctx android.PathContext, data []byte) (*ModuleConfig, error) {
291 constructLibraryPaths := func(ctx android.PathContext, paths jsonLibraryPaths) LibraryPaths {
295 constructPath(ctx, path.Host),
310 config.ModuleConfig.BuildPath = constructPath(ctx, config.BuildPath).(android.OutputPath)
311 config.ModuleConfig.DexPath = constructPath(ctx, config.DexPath)
312 config.ModuleConfig.ManifestPath = constructPath(ctx, config.ManifestPath)
313 …config.ModuleConfig.ProfileClassListing = android.OptionalPathForPath(constructPath(ctx, config.Pr…
314 config.ModuleConfig.LibraryPaths = constructLibraryPaths(ctx, config.LibraryPaths)
315 config.ModuleConfig.DexPreoptImages = constructPaths(ctx, config.DexPreoptImages)
317 …config.ModuleConfig.PreoptBootClassPathDexFiles = constructPaths(ctx, config.PreoptBootClassPathDe…
346 func RegisterToolDeps(ctx android.BottomUpMutatorContext) {
347 dex2oatBin := dex2oatModuleName(ctx.Config())
348 v := ctx.Config().BuildOSTarget.Variations()
349 ctx.AddFarVariationDependencies(v, dex2oatDepTag, dex2oatBin)
352 func dex2oatPathFromDep(ctx android.ModuleContext) android.Path {
353 dex2oatBin := dex2oatModuleName(ctx.Config())
355 dex2oatModule := ctx.GetDirectDepWithTag(dex2oatBin, dex2oatDepTag)
371 func createGlobalSoongConfig(ctx android.ModuleContext) *GlobalSoongConfig {
372 if ctx.Config().TestProductVariables != nil {
380 Profman: ctx.Config().HostToolPath(ctx, "profman"),
381 Dex2oat: dex2oatPathFromDep(ctx),
382 Aapt: ctx.Config().HostToolPath(ctx, "aapt"),
383 SoongZip: ctx.Config().HostToolPath(ctx, "soong_zip"),
384 Zip2zip: ctx.Config().HostToolPath(ctx, "zip2zip"),
385 ManifestCheck: ctx.Config().HostToolPath(ctx, "manifest_check"),
386 ConstructContext: ctx.Config().HostToolPath(ctx, "construct_context"),
404 func GetGlobalSoongConfig(ctx android.ModuleContext) *GlobalSoongConfig {
405 globalSoong := ctx.Config().Once(globalSoongConfigOnceKey, func() interface{} {
406 return createGlobalSoongConfig(ctx)
411 myDex2oat := dex2oatPathFromDep(ctx)
425 func GetCachedGlobalSoongConfig(ctx android.PathContext) *GlobalSoongConfig {
426 return ctx.Config().Once(globalSoongConfigOnceKey, func() interface{} {
444 func ParseGlobalSoongConfig(ctx android.PathContext, data []byte) (*GlobalSoongConfig, error) {
453 Profman: constructPath(ctx, jc.Profman),
454 Dex2oat: constructPath(ctx, jc.Dex2oat),
455 Aapt: constructPath(ctx, jc.Aapt),
456 SoongZip: constructPath(ctx, jc.SoongZip),
457 Zip2zip: constructPath(ctx, jc.Zip2zip),
458 ManifestCheck: constructPath(ctx, jc.ManifestCheck),
459 ConstructContext: constructPath(ctx, jc.ConstructContext),
465 func (s *globalSoongConfigSingleton) GenerateBuildActions(ctx android.SingletonContext) {
466 if GetGlobalConfig(ctx).DisablePreopt {
470 config := GetCachedGlobalSoongConfig(ctx)
489 ctx.Errorf("failed to JSON marshal GlobalSoongConfig: %v", err)
493 ctx.Build(pctx, android.BuildParams{
495 Output: android.PathForOutput(ctx, "dexpreopt_soong.config"),
502 func (s *globalSoongConfigSingleton) MakeVars(ctx android.MakeVarsContext) {
503 if GetGlobalConfig(ctx).DisablePreopt {
507 config := GetCachedGlobalSoongConfig(ctx)
512 ctx.Strict("DEX2OAT", config.Dex2oat.String())
513 ctx.Strict("DEXPREOPT_GEN_DEPS", strings.Join([]string{
524 func GlobalConfigForTests(ctx android.PathContext) *GlobalConfig {