Lines Matching +full:- +full:p
7 // http://www.apache.org/licenses/LICENSE-2.0
186 // out/ - make install files go here.
187 // out/soong - this is the buildDir passed to NewTestConfig()
188 // ... - the source files
233 func GenPathWithExt(ctx ModuleOutPathContext, subdir string, p Path, ext string) ModuleGenPath {
234 if path, ok := p.(genPathProvider); ok {
237 …f(ctx, "Tried to create generated file from unsupported path: %s(%s)", reflect.TypeOf(p).Name(), p)
243 func ObjPathWithExt(ctx ModuleOutPathContext, subdir string, p Path, ext string) ModuleObjPath {
244 if path, ok := p.(objPathProvider); ok {
247 …orf(ctx, "Tried to create object file from unsupported path: %s (%s)", reflect.TypeOf(p).Name(), p)
254 func ResPathWithName(ctx ModuleOutPathContext, p Path, name string) ModuleResPath {
255 if path, ok := p.(resPathProvider); ok {
258 …Errorf(ctx, "Tried to create res file from unsupported path: %s (%s)", reflect.TypeOf(p).Name(), p)
277 func (p OptionalPath) Valid() bool {
278 return p.valid
283 func (p OptionalPath) Path() Path {
284 if !p.valid {
287 return p.path
294 func (p OptionalPath) AsPaths() Paths {
295 if !p.valid {
298 return Paths{p.path}
303 func (p OptionalPath) RelativeToTop() OptionalPath {
304 if !p.valid {
305 return p
307 p.path = p.path.RelativeToTop()
308 return p
312 func (p OptionalPath) String() string {
313 if p.valid {
314 return p.path.String()
325 func (p Paths) RelativeToTop() Paths {
327 if p == nil {
328 return p
330 ret := make(Paths, len(p))
331 for i, path := range p {
338 for _, p := range paths {
339 if p == path {
358 // omitted from the list, and dependencies are added so that we're re-run when they are added.
362 p := ExistentPathForSource(ctx, path)
363 if p.Valid() {
364 ret = append(ret, p.Path())
422 func (p OutputPaths) Paths() Paths {
423 if p == nil {
426 ret := make(Paths, len(p))
427 for i, path := range p {
434 func (p OutputPaths) Strings() []string {
435 if p == nil {
438 ret := make([]string, len(p))
439 for i, path := range p {
552 for _, p := range paths {
553 if !InList(p.String(), expandedExcludes) {
554 remainder = append(remainder, p)
570 p := pathForModuleSrc(ctx, sPath)
571 if exists, _, err := ctx.Config().fs.Exists(p.String()); err != nil {
572 ReportPathErrorf(ctx, "%s: %s", p, err.Error())
574 ReportPathErrorf(ctx, "module source path %q does not exist", p)
577 if InList(p.String(), expandedExcludes) {
580 return Paths{p}, nil
595 for _, p := range paths {
596 if !incDirs && strings.HasSuffix(p, "/") {
599 path := filepath.Clean(p)
601 ReportPathErrorf(ctx, "Path %q is not in module source directory %q", p, prefix)
631 func (p Paths) Strings() []string {
632 if p == nil {
635 ret := make([]string, len(p))
636 for i, path := range p {
738 for i := len(list) - 1; i >= totalSkip; i-- {
740 for j := i - 1; j >= totalSkip; j-- {
759 ret[i] = list[len(list)-1-i]
771 return -1
774 func inPathList(p Path, list []Path) bool {
775 return indexPathList(p, list) != -1
779 return FilterPathListPredicate(list, func(p Path) bool { return inPathList(p, filter) })
795 func (p Paths) HasExt(ext string) bool {
796 for _, path := range p {
806 func (p Paths) FilterByExt(ext string) Paths {
807 ret := make(Paths, 0, len(p))
808 for _, path := range p {
817 func (p Paths) FilterOutByExt(ext string) Paths {
818 ret := make(Paths, 0, len(p))
819 for _, path := range p {
842 func (p DirectorySortedPaths) PathsInDirectory(dir string) Paths {
844 start := sort.Search(len(p), func(i int) bool {
845 return prefix < p[i].String()
848 ret := p[start:]
864 func (p WritablePaths) RelativeToTop() WritablePaths {
866 if p == nil {
867 return p
869 ret := make(WritablePaths, len(p))
870 for i, path := range p {
877 func (p WritablePaths) Strings() []string {
878 if p == nil {
881 ret := make([]string, len(p))
882 for i, path := range p {
889 func (p WritablePaths) Paths() Paths {
890 if p == nil {
893 ret := make(Paths, len(p))
894 for i, path := range p {
905 func (p basePath) Ext() string {
906 return filepath.Ext(p.path)
909 func (p basePath) Base() string {
910 return filepath.Base(p.path)
913 func (p basePath) Rel() string {
914 if p.rel != "" {
915 return p.rel
917 return p.path
920 func (p basePath) String() string {
921 return p.path
924 func (p basePath) withRel(rel string) basePath {
925 p.path = filepath.Join(p.path, rel)
926 p.rel = rel
927 return p
938 func (p SourcePath) RelativeToTop() Path {
940 return p
945 func (p SourcePath) withRel(rel string) SourcePath {
946 p.basePath = p.basePath.withRel(rel)
947 return p
950 // safePathForSource is for paths that we expect are safe -- only for use by go
953 p, err := validateSafePath(pathComponents...)
954 ret := SourcePath{basePath{p, ""}, ctx.Config().srcDir}
969 p, err := validatePath(pathComponents...)
970 ret := SourcePath{basePath{p, ""}, ctx.Config().srcDir}
1064 func (p SourcePath) String() string {
1065 return filepath.Join(p.srcDir, p.path)
1070 func (p SourcePath) Join(ctx PathContext, paths ...string) SourcePath {
1075 return p.withRel(path)
1079 func (p SourcePath) join(ctx PathContext, paths ...string) SourcePath {
1084 return p.withRel(path)
1089 func (p SourcePath) OverlayPath(ctx ModuleMissingDepsPathContext, path Path) OptionalPath {
1097 dir := filepath.Join(p.srcDir, p.path, relDir)
1110 relPath := Rel(ctx, p.srcDir, paths[0])
1124 func (p OutputPath) withRel(rel string) OutputPath {
1125 p.basePath = p.basePath.withRel(rel)
1126 p.fullPath = filepath.Join(p.fullPath, rel)
1127 return p
1130 func (p OutputPath) WithoutRel() OutputPath {
1131 p.basePath.rel = filepath.Base(p.basePath.path)
1132 return p
1135 func (p OutputPath) getBuildDir() string {
1136 return p.buildDir
1139 func (p OutputPath) RelativeToTop() Path {
1140 return p.outputPathRelativeToTop()
1143 func (p OutputPath) outputPathRelativeToTop() OutputPath {
1144 p.fullPath = StringPathRelativeToTop(p.buildDir, p.fullPath)
1145 p.buildDir = OutSoongDir
1146 return p
1149 func (p OutputPath) objPathWithExt(ctx ModuleOutPathContext, subdir, ext string) ModuleObjPath {
1150 return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1187 path = fullPath[len(fullPath)-len(path):]
1200 func (p OutputPath) writablePath() {}
1202 func (p OutputPath) String() string {
1203 return p.fullPath
1208 func (p OutputPath) Join(ctx PathContext, paths ...string) OutputPath {
1213 return p.withRel(path)
1217 func (p OutputPath) ReplaceExtension(ctx PathContext, ext string) OutputPath {
1221 ret := PathForOutput(ctx, pathtools.ReplaceExtension(p.path, ext))
1222 ret.rel = pathtools.ReplaceExtension(p.rel, ext)
1227 func (p OutputPath) InSameDir(ctx PathContext, paths ...string) OutputPath {
1233 ret := PathForOutput(ctx, filepath.Dir(p.path), path)
1234 ret.rel = filepath.Join(filepath.Dir(p.rel), path)
1238 // PathForIntermediates returns an OutputPath representing the top-level
1255 p, err := validatePath(pathComponents...)
1259 paths, err := expandOneSrcPath(ctx, p, nil)
1272 ReportPathErrorf(ctx, "%q produced no files, expected exactly one", p)
1275 ReportPathErrorf(ctx, "%q produced %d files, expected exactly one", p, len(paths))
1281 p, err := validatePath(paths...)
1286 path, err := pathForSource(ctx, ctx.ModuleDir(), p)
1291 path.basePath.rel = p
1318 // valid path if p is non-nil.
1319 func OptionalPathForModuleSrc(ctx ModuleMissingDepsPathContext, p *string) OptionalPath {
1320 if p == nil {
1323 return OptionalPathForPath(PathForModuleSrc(ctx, *p))
1326 func (p SourcePath) genPathWithExt(ctx ModuleOutPathContext, subdir, ext string) ModuleGenPath {
1327 return PathForModuleGen(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1330 func (p SourcePath) objPathWithExt(ctx ModuleOutPathContext, subdir, ext string) ModuleObjPath {
1331 return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1334 func (p SourcePath) resPathWithName(ctx ModuleOutPathContext, name string) ModuleResPath {
1336 return PathForModuleRes(ctx, p.path, name)
1344 func (p ModuleOutPath) RelativeToTop() Path {
1345 p.OutputPath = p.outputPathRelativeToTop()
1346 return p
1352 func (p ModuleOutPath) objPathWithExt(ctx ModuleOutPathContext, subdir, ext string) ModuleObjPath {
1353 return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1390 dirName = "platform" // opt-in libs
1402 return ExistentPathForSource(ctx, "prebuilts", "abi-dumps", dirName,
1403 version, binderBitness, archNameAndVariant, "source-based",
1410 p, err := validatePath(paths...)
1415 OutputPath: pathForModuleOut(ctx).withRel(p),
1425 func (p ModuleGenPath) RelativeToTop() Path {
1426 p.OutputPath = p.outputPathRelativeToTop()
1427 return p
1438 p, err := validatePath(paths...)
1444 OutputPath: pathForModuleOut(ctx).withRel("gen").withRel(p),
1449 func (p ModuleGenPath) genPathWithExt(ctx ModuleOutPathContext, subdir, ext string) ModuleGenPath {
1451 return PathForModuleGen(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1454 func (p ModuleGenPath) objPathWithExt(ctx ModuleOutPathContext, subdir, ext string) ModuleObjPath {
1455 return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1464 func (p ModuleObjPath) RelativeToTop() Path {
1465 p.OutputPath = p.outputPathRelativeToTop()
1466 return p
1475 p, err := validatePath(pathComponents...)
1479 return ModuleObjPath{PathForModuleOut(ctx, "obj", p)}
1488 func (p ModuleResPath) RelativeToTop() Path {
1489 p.OutputPath = p.outputPathRelativeToTop()
1490 return p
1499 p, err := validatePath(pathComponents...)
1504 return ModuleResPath{PathForModuleOut(ctx, "res", p)}
1515 …// For example, it is host/<os>-<arch> for host modules, and target/product/<device>/<partition> f…
1524 if PrefixInList(os.Args, "-test.") {
1530 func (p InstallPath) RelativeToTop() Path {
1532 p.buildDir = OutSoongDir
1533 return p
1536 func (p InstallPath) getBuildDir() string {
1537 return p.buildDir
1540 func (p InstallPath) ReplaceExtension(ctx PathContext, ext string) OutputPath {
1547 func (p InstallPath) writablePath() {}
1549 func (p InstallPath) String() string {
1550 if p.makePath {
1552 return filepath.Join(p.buildDir, "../", p.path)
1554 return filepath.Join(p.buildDir, p.path)
1559 // out/soong/target/product/<device>/<partition> for device modules, and out/soong/host/<os>-<arch>…
1561 func (p InstallPath) PartitionDir() string {
1562 if p.makePath {
1563 return filepath.Join(p.buildDir, "../", p.partitionDir)
1565 return filepath.Join(p.buildDir, p.partitionDir)
1571 func (p InstallPath) Join(ctx PathContext, paths ...string) InstallPath {
1576 return p.withRel(path)
1579 func (p InstallPath) withRel(rel string) InstallPath {
1580 p.basePath = p.basePath.withRel(rel)
1581 return p
1586 func (p InstallPath) ToMakePath() InstallPath {
1587 p.makePath = true
1588 return p
1627 // SOONG_HOST_OUT is set to out/host/$(HOST_OS)-$(HOST_PREBUILT_ARCH)
1636 partionPaths = []string{"host", osName + "-" + archName, partition}
1672 return pathForNdkOrSdkInstall(ctx, "mainline-sdks", paths)
1743 func (p InstallPaths) Paths() Paths {
1744 if p == nil {
1747 ret := make(Paths, len(p))
1748 for i, path := range p {
1755 func (p InstallPaths) Strings() []string {
1756 if p == nil {
1759 ret := make([]string, len(p))
1760 for i, path := range p {
1804 func (p PhonyPath) writablePath() {}
1806 func (p PhonyPath) getBuildDir() string {
1811 func (p PhonyPath) RelativeToTop() Path {
1815 return p
1818 func (p PhonyPath) ReplaceExtension(ctx PathContext, ext string) OutputPath {
1829 func (p testPath) RelativeToTop() Path {
1831 return p
1834 func (p testPath) String() string {
1835 return p.path
1843 p, err := validateSafePath(paths...)
1847 return testPath{basePath{path: p, rel: p}}
1852 p := make(Paths, len(strs))
1854 p[i] = PathForTesting(s)
1857 return p
1937 // default-initialized, which leaves blueprint.baseModuleContext set to nil, so methods that are
2019 // PathsIfNonNil returns a Paths containing only the non-nil input arguments.