Lines Matching refs:path

155 	if path, ok := p.(genPathProvider); ok {
156 return path.genPathWithExt(ctx, subdir, ext)
165 if path, ok := p.(objPathProvider); ok {
166 return path.objPathWithExt(ctx, subdir, ext)
176 if path, ok := p.(resPathProvider); ok {
177 return path.resPathWithName(ctx, name)
186 path Path member
190 func OptionalPathForPath(path Path) OptionalPath {
191 if path == nil {
194 return OptionalPath{valid: true, path: path}
208 return p.path
214 return p.path.String()
223 func (paths Paths) containsPath(path Path) bool {
225 if p == path {
235 for i, path := range paths {
236 ret[i] = PathForSource(ctx, path)
246 for _, path := range paths {
247 p := ExistentPathForSource(ctx, path)
293 for i, path := range p {
294 ret[i] = path
305 for i, path := range p {
306 ret[i] = path.String()
446 path := filepath.Clean(p)
447 if !strings.HasPrefix(path, prefix) {
452 srcPath, err := safePathForSource(ctx, ctx.ModuleDir(), path[len(prefix):])
458 srcPath.basePath.rel = srcPath.path
473 path := filepath.Join(ctx.Config().srcDir, ctx.ModuleDir(), def)
474 return ctx.Glob(path, nil)
483 for i, path := range p {
484 ret[i] = path.String()
604 for _, path := range p {
605 if path.Ext() == ext {
616 for _, path := range p {
617 if path.Ext() == ext {
618 ret = append(ret, path)
627 for _, path := range p {
628 if path.Ext() != ext {
629 ret = append(ret, path)
676 for i, path := range p {
677 ret[i] = path.String()
688 for i, path := range p {
689 ret[i] = path
695 path string member
701 return filepath.Ext(p.path)
705 return filepath.Base(p.path)
712 return p.path
716 return p.path
720 p.path = filepath.Join(p.path, rel)
772 func existsWithDependencies(ctx PathContext, path SourcePath) (exists bool, err error) {
778 files, err = gctx.GlobWithDeps(path.String(), nil)
783 files, deps, err = ctx.Config().fs.Glob(path.String(), nil, pathtools.FollowSymlinks)
798 path, err := pathForSource(ctx, pathComponents...)
803 if pathtools.IsGlob(path.String()) {
804 reportPathErrorf(ctx, "path may not contain a glob: %s", path.String())
808 exists, err := existsWithDependencies(ctx, path)
813 modCtx.AddMissingDependencies([]string{path.String()})
815 } else if exists, _, err := ctx.Config().fs.Exists(path.String()); err != nil {
816 reportPathErrorf(ctx, "%s: %s", path, err.Error())
818 reportPathErrorf(ctx, "source path %q does not exist", path)
820 return path
827 path, err := pathForSource(ctx, pathComponents...)
833 if pathtools.IsGlob(path.String()) {
834 reportPathErrorf(ctx, "path may not contain a glob: %s", path.String())
838 exists, err := existsWithDependencies(ctx, path)
846 return OptionalPathForPath(path)
850 return filepath.Join(p.config.srcDir, p.path)
856 path, err := validatePath(paths...)
860 return p.withRel(path)
865 path, err := validateSafePath(paths...)
869 return p.withRel(path)
874 func (p SourcePath) OverlayPath(ctx ModuleContext, path Path) OptionalPath {
876 if srcPath, ok := path.(SourcePath); ok {
877 relDir = srcPath.path
879 reportPathErrorf(ctx, "Cannot find relative path for %s(%s)", reflect.TypeOf(path).Name(), path)
882 dir := filepath.Join(p.config.srcDir, p.path, relDir)
912 p.basePath.rel = filepath.Base(p.basePath.path)
935 func pathForBuildToolDep(ctx PathContext, path string) toolDepPath {
936 return toolDepPath{basePath{path, ctx.Config(), ""}}
943 path, err := validatePath(pathComponents...)
947 fullPath := filepath.Join(ctx.Config().buildDir, path)
948 path = fullPath[len(fullPath)-len(path):]
949 return OutputPath{basePath{path, ctx.Config(), ""}, fullPath}
955 for i, path := range paths {
956 ret[i] = PathForOutput(ctx, path)
970 path, err := validatePath(paths...)
974 return p.withRel(path)
982 ret := PathForOutput(ctx, pathtools.ReplaceExtension(p.path, ext))
989 path, err := validatePath(paths...)
994 ret := PathForOutput(ctx, filepath.Dir(p.path), path)
995 ret.rel = filepath.Join(filepath.Dir(p.rel), path)
1002 path, err := validatePath(paths...)
1006 return PathForOutput(ctx, ".intermediates", path)
1047 path, err := pathForSource(ctx, ctx.ModuleDir(), p)
1052 path.basePath.rel = p
1054 return path
1063 for i, path := range paths {
1064 rel := Rel(ctx, subDirFullPath.String(), path.String())
1072 func PathWithModuleSrcSubDir(ctx ModuleContext, path Path, subDir string) Path {
1074 rel := Rel(ctx, subDirFullPath.String(), path.String())
1088 return PathForModuleGen(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1092 return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1097 return PathForModuleRes(ctx, p.path, name)
1108 return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1191 return PathForModuleGen(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1195 return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1252 return filepath.Join(p.config.buildDir, p.baseDir, p.path)
1258 path, err := validatePath(paths...)
1262 return p.withRel(path)
1318 path, err := validatePath(outPaths...)
1323 ret := InstallPath{basePath{path, ctx.Config(), ""}, ""}
1330 path, err := validatePath(paths...)
1334 return InstallPath{basePath{path, ctx.Config(), ""}, ""}
1345 func InstallPathToOnDevicePath(ctx PathContext, path InstallPath) string {
1346 …rel := Rel(ctx, PathForOutput(ctx, "target", "product", ctx.Config().DeviceName()).String(), path.…
1403 for i, path := range p {
1404 ret[i] = path
1415 for i, path := range p {
1416 ret[i] = path.String()
1424 for _, path := range pathComponents {
1425 path := filepath.Clean(path)
1426 if path == ".." || strings.HasPrefix(path, "../") || strings.HasPrefix(path, "/") {
1427 return "", fmt.Errorf("Path is outside directory: %s", path)
1440 for _, path := range pathComponents {
1441 if strings.Contains(path, "$") {
1442 return "", fmt.Errorf("Path contains invalid character($): %s", path)
1473 return p.path
1483 return testPath{basePath{path: p, rel: p}}
1548 func WriteFileToOutputDir(path WritablePath, data []byte, perm os.FileMode) error {
1549 return ioutil.WriteFile(absolutePath(path.String()), data, perm)
1552 func absolutePath(path string) string {
1553 if filepath.IsAbs(path) {
1554 return path
1556 return filepath.Join(absSrcDir, path)