forked from golang/dep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
importers.go
45 lines (38 loc) · 1.45 KB
/
importers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package importers
import (
"log"
"github.com/golang/dep"
"github.com/golang/dep/gps"
"github.com/golang/dep/internal/importers/glide"
"github.com/golang/dep/internal/importers/glock"
"github.com/golang/dep/internal/importers/godep"
"github.com/golang/dep/internal/importers/govend"
"github.com/golang/dep/internal/importers/govendor"
"github.com/golang/dep/internal/importers/gvt"
"github.com/golang/dep/internal/importers/vndr"
)
// Importer handles importing configuration from other dependency managers into
// the dep configuration format.
type Importer interface {
// Name of the importer.
Name() string
// Import the config found in the directory.
Import(path string, pr gps.ProjectRoot) (*dep.Manifest, *dep.Lock, error)
// HasDepMetadata checks if a directory contains config that the importer can handle.
HasDepMetadata(dir string) bool
}
// BuildAll returns a slice of all the importers.
func BuildAll(logger *log.Logger, verbose bool, sm gps.SourceManager) []Importer {
return []Importer{
glide.NewImporter(logger, verbose, sm),
godep.NewImporter(logger, verbose, sm),
vndr.NewImporter(logger, verbose, sm),
govend.NewImporter(logger, verbose, sm),
gvt.NewImporter(logger, verbose, sm),
govendor.NewImporter(logger, verbose, sm),
glock.NewImporter(logger, verbose, sm),
}
}