@@ -2,7 +2,13 @@ package golang
22
33import (
44 "github.com/fossas/fossa-cli/analyzers/golang/resolver"
5+ "github.com/fossas/fossa-cli/buildtools/dep"
6+ "github.com/fossas/fossa-cli/buildtools/gdm"
7+ "github.com/fossas/fossa-cli/buildtools/glide"
58 "github.com/fossas/fossa-cli/buildtools/gocmd"
9+ "github.com/fossas/fossa-cli/buildtools/godep"
10+ "github.com/fossas/fossa-cli/buildtools/govendor"
11+ "github.com/fossas/fossa-cli/buildtools/vndr"
612 "github.com/fossas/fossa-cli/errutil"
713 "github.com/fossas/fossa-cli/log"
814 "github.com/fossas/fossa-cli/module"
@@ -25,20 +31,54 @@ func (a *Analyzer) Analyze(m module.Module) (module.Module, error) {
2531 // Read lockfiles to get revisions.
2632 var r resolver.Resolver
2733 switch a .Options .Strategy {
28- // Read revisions from a tool manifest at a specified location.
29- // TODO: implement these strategies.
3034 case "manifest:dep" :
31- return m , errutil .ErrNotImplemented
35+ if a .Options .LockfilePath == "" {
36+ return m , errors .New ("manifest strategy specified without lockfile path" )
37+ }
38+ r , err = dep .FromFile (a .Options .LockfilePath )
39+ if err != nil {
40+ return m , err
41+ }
3242 case "manifest:gdm" :
33- return m , errutil .ErrNotImplemented
43+ if a .Options .LockfilePath == "" {
44+ return m , errors .New ("manifest strategy specified without lockfile path" )
45+ }
46+ r , err = gdm .FromFile (a .Options .LockfilePath )
47+ if err != nil {
48+ return m , err
49+ }
3450 case "manifest:glide" :
35- return m , errutil .ErrNotImplemented
51+ if a .Options .LockfilePath == "" {
52+ return m , errors .New ("manifest strategy specified without lockfile path" )
53+ }
54+ r , err = glide .FromFile (a .Options .LockfilePath )
55+ if err != nil {
56+ return m , err
57+ }
3658 case "manifest:godep" :
37- return m , errutil .ErrNotImplemented
59+ if a .Options .LockfilePath == "" {
60+ return m , errors .New ("manifest strategy specified without lockfile path" )
61+ }
62+ r , err = godep .FromFile (a .Options .LockfilePath )
63+ if err != nil {
64+ return m , err
65+ }
3866 case "manifest:govendor" :
39- return m , errutil .ErrNotImplemented
67+ if a .Options .LockfilePath == "" {
68+ return m , errors .New ("manifest strategy specified without lockfile path" )
69+ }
70+ r , err = govendor .FromFile (a .Options .LockfilePath )
71+ if err != nil {
72+ return m , err
73+ }
4074 case "manifest:vndr" :
41- return m , errutil .ErrNotImplemented
75+ if a .Options .LockfilePath == "" {
76+ return m , errors .New ("manifest strategy specified without lockfile path" )
77+ }
78+ r , err = vndr .FromFile (a .Options .LockfilePath )
79+ if err != nil {
80+ return m , err
81+ }
4282
4383 // Resolve revisions by traversing the local $GOPATH and calling the package's
4484 // VCS.
0 commit comments