2020-10-20 09:49:26 +02:00
|
|
|
package whitesource
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
"os"
|
2021-02-03 15:52:48 +02:00
|
|
|
|
|
|
|
"github.com/SAP/jenkins-library/pkg/maven"
|
2020-10-20 09:49:26 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// File defines the method subset we use from os.File
|
|
|
|
type File interface {
|
|
|
|
io.Writer
|
|
|
|
io.StringWriter
|
|
|
|
io.Closer
|
|
|
|
}
|
|
|
|
|
|
|
|
// Utils captures all external functionality that needs to be exchangeable in tests.
|
|
|
|
type Utils interface {
|
2020-11-10 18:14:55 +02:00
|
|
|
maven.Utils
|
2020-10-20 09:49:26 +02:00
|
|
|
|
|
|
|
Chdir(path string) error
|
|
|
|
Getwd() (string, error)
|
|
|
|
FileRead(path string) ([]byte, error)
|
|
|
|
FileWrite(path string, content []byte, perm os.FileMode) error
|
|
|
|
FileRemove(path string) error
|
|
|
|
FileRename(oldPath, newPath string) error
|
2021-02-03 15:52:48 +02:00
|
|
|
GetExitCode() int
|
2020-10-20 09:49:26 +02:00
|
|
|
RemoveAll(path string) error
|
|
|
|
FileOpen(name string, flag int, perm os.FileMode) (File, error)
|
|
|
|
|
|
|
|
FindPackageJSONFiles(config *ScanOptions) ([]string, error)
|
|
|
|
InstallAllNPMDependencies(config *ScanOptions, packageJSONFiles []string) error
|
|
|
|
}
|