MCPcopy Create free account
hub / github.com/celer-pkg/celer / PackageFiles

Method PackageFiles

configs/port.go:403–437  ·  view source on GitHub ↗
(packageDir, platformName, projectName string)

Source from the content-addressed store, hash-verified

401}
402
403func (p Port) PackageFiles(packageDir, platformName, projectName string) ([]string, error) {
404 if !fileio.PathExists(packageDir) {
405 return nil, nil
406 }
407
408 var files []string
409 if err := filepath.WalkDir(packageDir, func(path string, d os.DirEntry, err error) error {
410 if err != nil {
411 return err
412 }
413
414 if d.IsDir() {
415 return nil
416 }
417
418 relativePath, err := filepath.Rel(packageDir, path)
419 if err != nil {
420 return err
421 }
422
423 if p.DevDep || p.HostDep {
424 file := filepath.Join(p.ctx.Platform().GetHostName()+"-dev", relativePath)
425 files = append(files, file)
426 } else {
427 libraryDir := filepath.Join(platformName, projectName, p.ctx.BuildType())
428 file := filepath.Join(libraryDir, relativePath)
429 files = append(files, file)
430 }
431 return nil
432 }); err != nil {
433 return nil, err
434 }
435
436 return files, nil
437}
438
439func (p Port) IsHostSupported() bool {
440 // Only build_tool ports (like m4, automake, libtool, autoconf) are restricted to Linux/Darwin.

Callers 2

doInstallFromPackageMethod · 0.95
writeTraceFileMethod · 0.95

Calls 4

PathExistsFunction · 0.92
GetHostNameMethod · 0.65
PlatformMethod · 0.65
BuildTypeMethod · 0.65

Tested by

no test coverage detected