diff --git a/artifactory_test.go b/artifactory_test.go index 9a5fbe194..390961e66 100644 --- a/artifactory_test.go +++ b/artifactory_test.go @@ -7,6 +7,7 @@ import ( "encoding/json" "errors" "fmt" + biutils "github.com/jfrog/build-info-go/utils" "io" "net" "net/http" @@ -191,7 +192,7 @@ func TestArtifactorySimpleUploadWithWildcardSpec(t *testing.T) { // Init tmp dir specFile, err := tests.CreateSpec(tests.UploadTempWildcard) assert.NoError(t, err) - err = fileutils.CopyDir(tests.GetTestResourcesPath()+"cache", filepath.Dir(specFile), true, nil) + err = biutils.CopyDir(tests.GetTestResourcesPath()+"cache", filepath.Dir(specFile), true, nil) assert.NoError(t, err) // Upload runRt(t, "upload", "--spec="+specFile) @@ -1536,9 +1537,9 @@ func TestArtifactorySelfSignedCert(t *testing.T) { serverDetails.InsecureTls = false certsPath, err := coreutils.GetJfrogCertsDir() assert.NoError(t, err) - err = fileutils.CopyFile(certsPath, certificate.KeyFile) + err = biutils.CopyFile(certsPath, certificate.KeyFile) assert.NoError(t, err) - err = fileutils.CopyFile(certsPath, certificate.CertFile) + err = biutils.CopyFile(certsPath, certificate.CertFile) assert.NoError(t, err) searchCmd = generic.NewSearchCommand() searchCmd.SetServerDetails(serverDetails).SetSpec(fileSpec) @@ -2281,7 +2282,7 @@ func TestUploadWithArchiveAndSymlink(t *testing.T) { testFile := filepath.Join(tests.GetTestResourcesPath(), "a", "a1.in") tmpDir, createTempDirCallback := coretests.CreateTempDirWithCallbackAndAssert(t) defer createTempDirCallback() - err := fileutils.CopyFile(tmpDir, testFile) + err := biutils.CopyFile(tmpDir, testFile) assert.NoError(t, err) // Link valid symLink to local file symlinkTarget := filepath.Join(tmpDir, "a1.in") @@ -5006,7 +5007,7 @@ func TestVcsProps(t *testing.T) { func initVcsTestDir(t *testing.T) string { testdataSrc := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "vcs") testdataTarget := tests.Temp - err := fileutils.CopyDir(testdataSrc, testdataTarget, true, nil) + err := biutils.CopyDir(testdataSrc, testdataTarget, true, nil) assert.NoError(t, err) if found, err := fileutils.IsDirExists(filepath.Join(testdataTarget, "gitdata"), false); found { assert.NoError(t, err) @@ -5420,7 +5421,7 @@ func simpleUploadWithAntPatternSpec(t *testing.T) { // Init tmp dir specFile, err := tests.CreateSpec(tests.UploadAntPattern) assert.NoError(t, err) - err = fileutils.CopyDir(tests.GetTestResourcesPath()+"cache", filepath.Dir(specFile), true, nil) + err = biutils.CopyDir(tests.GetTestResourcesPath()+"cache", filepath.Dir(specFile), true, nil) assert.NoError(t, err) // Upload runRt(t, "upload", "--spec="+specFile) @@ -5446,7 +5447,7 @@ func TestUploadWithAntPatternAndExclusionsSpec(t *testing.T) { // Init tmp dir specFile, err := tests.CreateSpec(tests.UploadAntPatternExclusions) assert.NoError(t, err) - err = fileutils.CopyDir(tests.GetTestResourcesPath(), filepath.Dir(specFile), true, nil) + err = biutils.CopyDir(tests.GetTestResourcesPath(), filepath.Dir(specFile), true, nil) assert.NoError(t, err) // Upload runRt(t, "upload", "--spec="+specFile) @@ -5464,7 +5465,7 @@ func TestUploadWithAntPatternAndPlaceholders(t *testing.T) { // Init tmp dir specFile, err := tests.CreateSpec(tests.UploadAntPatternExclusions) assert.NoError(t, err) - err = fileutils.CopyDir(tests.GetTestResourcesPath(), filepath.Dir(specFile), true, nil) + err = biutils.CopyDir(tests.GetTestResourcesPath(), filepath.Dir(specFile), true, nil) assert.NoError(t, err) // Upload runRt(t, "upload", "--spec="+specFile) @@ -5601,7 +5602,7 @@ func testProjectInit(t *testing.T, projectExampleName string, technology coreuti tmpWorkDir, deleteWorkDir := coretests.CreateTempDirWithCallbackAndAssert(t) defer deleteWorkDir() testdataSrc := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), technology.ToString(), projectExampleName) - err = fileutils.CopyDir(testdataSrc, tmpWorkDir, true, nil) + err = biutils.CopyDir(testdataSrc, tmpWorkDir, true, nil) assert.NoError(t, err) if technology == coreutils.Go { goModeOriginalPath := filepath.Join(tmpWorkDir, "createGoProject_go.mod_suffix") @@ -5700,7 +5701,7 @@ func prepareTerraformProject(projectName string, t *testing.T, copyDirs bool) st testdataTarget := filepath.Join(tests.Out, "terraformProject") assert.NoError(t, os.MkdirAll(testdataTarget+string(os.PathSeparator), 0777)) // Copy terraform tests to test environment, so we can change project's config file. - assert.NoError(t, fileutils.CopyDir(projectPath, testdataTarget, copyDirs, nil)) + assert.NoError(t, biutils.CopyDir(projectPath, testdataTarget, copyDirs, nil)) configFileDir := filepath.Join(filepath.FromSlash(testdataTarget), ".jfrog", "projects") _, err := tests.ReplaceTemplateVariables(filepath.Join(configFileDir, "terraform.yaml"), configFileDir) assert.NoError(t, err) diff --git a/docker_test.go b/docker_test.go index 7f4311374..43b59e310 100644 --- a/docker_test.go +++ b/docker_test.go @@ -3,6 +3,7 @@ package main import ( "context" "fmt" + biutils "github.com/jfrog/build-info-go/utils" "os" "path" "path/filepath" @@ -482,7 +483,7 @@ func runKaniko(t *testing.T, imageToPush string) string { assert.NoError(t, err) workspace, err := filepath.Abs(tests.Out) assert.NoError(t, err) - assert.NoError(t, fileutils.CopyFile(workspace, filepath.Join(testDir, "docker", dockerFile))) + assert.NoError(t, biutils.CopyFile(workspace, filepath.Join(testDir, "docker", dockerFile))) // Run Kaniko to build the test image and push it to Artifactory. _, err = tests.NewContainerRequest(). diff --git a/go.mod b/go.mod index 3f090d224..f5cacf810 100644 --- a/go.mod +++ b/go.mod @@ -21,19 +21,20 @@ require ( golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 golang.org/x/term v0.11.0 gopkg.in/yaml.v2 v2.4.0 + ) require ( dario.cat/mergo v1.0.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/BurntSushi/toml v1.3.2 // indirect - github.com/CycloneDX/cyclonedx-go v0.7.1 // indirect + github.com/CycloneDX/cyclonedx-go v0.7.2 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/VividCortex/ewma v1.2.0 // indirect github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect github.com/acomagu/bufpipe v1.0.4 // indirect - github.com/andybalholm/brotli v1.0.5 // indirect + github.com/andybalholm/brotli v1.0.1 // indirect github.com/c-bata/go-prompt v0.2.5 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/chzyer/readline v1.5.1 // indirect @@ -56,12 +57,12 @@ require ( github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/golang/snappy v0.0.2 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/gookit/color v1.5.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/jedib0t/go-pretty/v6 v6.4.6 // indirect + github.com/jedib0t/go-pretty/v6 v6.4.7 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/klauspost/compress v1.16.0 // indirect github.com/klauspost/cpuid/v2 v2.2.3 // indirect @@ -69,7 +70,7 @@ require ( github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mattn/go-tty v0.0.3 // indirect github.com/minio/sha256-simd v1.0.1 // indirect @@ -84,7 +85,7 @@ require ( github.com/opencontainers/runc v1.1.5 // indirect github.com/owenrumney/go-sarif/v2 v2.2.0 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/pierrec/lz4/v4 v4.1.15 // indirect + github.com/pierrec/lz4/v4 v4.1.2 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pkg/errors v0.9.1 // indirect @@ -124,8 +125,10 @@ require ( // replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20230828134416-f0db33dd9344 -replace github.com/jfrog/jfrog-cli-core/v2 => github.com/sverdlov93/jfrog-cli-core/v2 v2.0.2-0.20230830183657-14f1f373f71f +replace github.com/jfrog/jfrog-cli-core/v2 => github.com/sverdlov93/jfrog-cli-core/v2 v2.0.2-0.20230831093029-78c7cdeee907 // replace github.com/jfrog/gofrog => github.com/jfrog/gofrog v1.2.6-0.20230418122323-2bf299dd6d27 -replace github.com/jfrog/jfrog-client-go => github.com/sverdlov93/jfrog-client-go v1.0.2-0.20230830184806-817c5f8cf7a5 +replace github.com/jfrog/jfrog-client-go => github.com/sverdlov93/jfrog-client-go v1.0.2-0.20230831091720-f8dd980f08b9 + +replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20230831090828-915afc4d7380 diff --git a/go.sum b/go.sum index b53973ca3..e8b5592bb 100644 --- a/go.sum +++ b/go.sum @@ -45,14 +45,14 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CycloneDX/cyclonedx-go v0.7.1 h1:5w1SxjGm9MTMNTuRbEPyw21ObdbaagTWF/KfF0qHTRE= -github.com/CycloneDX/cyclonedx-go v0.7.1/go.mod h1:N/nrdWQI2SIjaACyyDs/u7+ddCkyl/zkNs8xFsHF2Ps= +github.com/CycloneDX/cyclonedx-go v0.7.2 h1:kKQ0t1dPOlugSIYVOMiMtFqeXI2wp/f5DBIdfux8gnQ= +github.com/CycloneDX/cyclonedx-go v0.7.2/go.mod h1:K2bA+324+Og0X84fA8HhN2X066K7Bxz4rpMQ4ZhjtSk= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.10.0-rc.8 h1:YSZVvlIIDD1UxQpJp0h+dnpLUw+TrY0cx8obKsp3bek= -github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 h1:KLq8BE0KwCL+mmXnjLWEAOYO+2l2AE4YMmqG1ZpZHBs= -github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow= github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= @@ -61,9 +61,8 @@ github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= +github.com/andybalholm/brotli v1.0.1 h1:KqhlKozYbRtJvsPrrEeXcO+N2l6NYT5A2QAFmSULpEc= github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= -github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= @@ -189,9 +188,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.2 h1:aeE13tS0IiQgFjYdoL8qN3K1N2bXXtI6Vi51/y7BpMw= github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -220,8 +218,8 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= @@ -235,10 +233,10 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jedib0t/go-pretty/v6 v6.4.6 h1:v6aG9h6Uby3IusSSEjHaZNXpHFhzqMmjXcPq1Rjl9Jw= -github.com/jedib0t/go-pretty/v6 v6.4.6/go.mod h1:Ndk3ase2CkQbXLLNf5QDHoYb6J9WtVfmHZu9n8rk2xs= -github.com/jfrog/build-info-go v1.9.9 h1:YMA9okHawBNL8SrCWzqULSf5M4W+YnWyUhmkWSjoXEE= -github.com/jfrog/build-info-go v1.9.9/go.mod h1:t31QRpH5xUJKw8XkQlAA+Aq7aanyS1rrzpcK8xSNVts= +github.com/jedib0t/go-pretty/v6 v6.4.7 h1:lwiTJr1DEkAgzljsUsORmWsVn5MQjt1BPJdPCtJ6KXE= +github.com/jedib0t/go-pretty/v6 v6.4.7/go.mod h1:Ndk3ase2CkQbXLLNf5QDHoYb6J9WtVfmHZu9n8rk2xs= +github.com/jfrog/build-info-go v1.8.9-0.20230831090828-915afc4d7380 h1:zfcXR/kIDe5npI+k0FdY0pWVTOLbK5kNkf0W0C7r6Gk= +github.com/jfrog/build-info-go v1.8.9-0.20230831090828-915afc4d7380/go.mod h1:QEskae5fQpjeY2PBzsjWtUQVskYSNDF2sSmw/Gx44dQ= github.com/jfrog/gofrog v1.3.0 h1:o4zgsBZE4QyDbz2M7D4K6fXPTBJht+8lE87mS9bw7Gk= github.com/jfrog/gofrog v1.3.0/go.mod h1:IFMc+V/yf7rA5WZ74CSbXe+Lgf0iApEQLxRZVzKRUR0= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -279,9 +277,8 @@ github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= @@ -320,9 +317,8 @@ github.com/owenrumney/go-sarif/v2 v2.2.0 h1:1DmZaijK0HBZCR1fgcDSGa7VzYkU9NDmbZ7q github.com/owenrumney/go-sarif/v2 v2.2.0/go.mod h1:MSqMMx9WqlBSY7pXoOZWgEsVB4FDNfhcaXDA1j6Sr+w= github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pierrec/lz4/v4 v4.1.2 h1:qvY3YFXRQE/XB8MlLzJH7mSzBs74eA2gg52YTk6jUPM= github.com/pierrec/lz4/v4 v4.1.2/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0= -github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= @@ -380,11 +376,12 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/sverdlov93/jfrog-cli-core/v2 v2.0.2-0.20230830183657-14f1f373f71f h1:9FJ8oJOnoCch4UTtghoTtO6W7KbucD2VJJbJFsfDhEU= -github.com/sverdlov93/jfrog-cli-core/v2 v2.0.2-0.20230830183657-14f1f373f71f/go.mod h1:kZPFkvdFemqW1YpppTAfYNxQduZiiuL4KJ2nDKA4NYE= -github.com/sverdlov93/jfrog-client-go v1.0.2-0.20230830184806-817c5f8cf7a5 h1:6Y6Ze5+uSLQwWK4oh48k7GFaYgcYXpZ0JSkTUxGjhXI= -github.com/sverdlov93/jfrog-client-go v1.0.2-0.20230830184806-817c5f8cf7a5/go.mod h1:icb00ZJN/mMMNkQduHDkzpqsXH9Flwi3f3COYexq3Nc= +github.com/sverdlov93/jfrog-cli-core/v2 v2.0.2-0.20230831093029-78c7cdeee907 h1:oDfTiC7awMg23wKV44S8r12641U2tiaNuBECAw6tLoI= +github.com/sverdlov93/jfrog-cli-core/v2 v2.0.2-0.20230831093029-78c7cdeee907/go.mod h1:5fmOT0jLlfc5deb0rMDVKlA3a30wNwM9kYmgz2T0JQY= +github.com/sverdlov93/jfrog-client-go v1.0.2-0.20230831091720-f8dd980f08b9 h1:MbImhjeba/bKjRgU56xrMnSCU8hoHRqmuZ2KzTkcG5s= +github.com/sverdlov93/jfrog-client-go v1.0.2-0.20230831091720-f8dd980f08b9/go.mod h1:1nQ4bsv24CqjDCcWcRVMfdU4SH7E0ZY/u94yncU6gcM= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/terminalstatic/go-xsd-validate v0.1.5 h1:RqpJnf6HGE2CB/lZB1A8BYguk8uRtcvYAPLCF15qguo= github.com/testcontainers/testcontainers-go v0.23.0 h1:ERYTSikX01QczBLPZpqsETTBO7lInqEP349phDOVJVs= github.com/testcontainers/testcontainers-go v0.23.0/go.mod h1:3gzuZfb7T9qfcH2pHpV4RLlWrPjeWNQah6XlYQ32c4I= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= @@ -594,7 +591,6 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/go_test.go b/go_test.go index 1b00960c0..b3640b189 100644 --- a/go_test.go +++ b/go_test.go @@ -2,6 +2,7 @@ package main import ( "fmt" + biutils "github.com/jfrog/build-info-go/utils" "os" "os/exec" "path/filepath" @@ -279,7 +280,7 @@ func prepareGoProject(projectName string, t *testing.T, copyDirs bool) string { projectPath := createGoProject(t, projectName, copyDirs) testdataTarget := filepath.Join(tests.Out, "testdata") testdataSrc := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "go", "testdata") - err := fileutils.CopyDir(testdataSrc, testdataTarget, copyDirs, nil) + err := biutils.CopyDir(testdataSrc, testdataTarget, copyDirs, nil) assert.NoError(t, err) configFileDir := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "go", projectName, ".jfrog", "projects") _, err = tests.ReplaceTemplateVariables(filepath.Join(configFileDir, "go.yaml"), filepath.Join(projectPath, ".jfrog", "projects")) @@ -326,7 +327,7 @@ func createTempGoPath(t *testing.T) (tempGoPath string, cleanUp func()) { func createGoProject(t *testing.T, projectName string, includeDirs bool) string { projectSrc := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "go", projectName) projectTarget := filepath.Join(tests.Out, projectName) - err := fileutils.CopyDir(projectSrc, projectTarget, includeDirs, nil) + err := biutils.CopyDir(projectSrc, projectTarget, includeDirs, nil) assert.NoError(t, err) projectTarget, err = filepath.Abs(projectTarget) assert.NoError(t, err) diff --git a/maven_test.go b/maven_test.go index e7de3a582..16311cb5c 100644 --- a/maven_test.go +++ b/maven_test.go @@ -3,6 +3,7 @@ package main import ( "fmt" buildinfo "github.com/jfrog/build-info-go/entities" + biutils "github.com/jfrog/build-info-go/utils" "github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/mvn" "github.com/jfrog/jfrog-cli-core/v2/artifactory/utils" "github.com/jfrog/jfrog-cli-core/v2/common/commands" @@ -13,7 +14,6 @@ import ( "github.com/jfrog/jfrog-cli/utils/tests" cliproxy "github.com/jfrog/jfrog-cli/utils/tests/proxy/server" "github.com/jfrog/jfrog-cli/utils/tests/proxy/server/certificate" - "github.com/jfrog/jfrog-client-go/utils/io/fileutils" "github.com/jfrog/jfrog-client-go/utils/log" clientTestUtils "github.com/jfrog/jfrog-client-go/utils/tests" "github.com/stretchr/testify/assert" @@ -178,7 +178,7 @@ func createMultiMavenProject(t *testing.T) string { return "" } destPath = filepath.Join(destPath, tests.Temp) - assert.NoError(t, fileutils.CopyDir(projectDir, destPath, true, nil)) + assert.NoError(t, biutils.CopyDir(projectDir, destPath, true, nil)) return destPath } diff --git a/npm_test.go b/npm_test.go index 6cc36806e..1a5e4a683 100644 --- a/npm_test.go +++ b/npm_test.go @@ -11,7 +11,8 @@ import ( "github.com/jfrog/jfrog-cli-core/v2/artifactory/utils/yarn" - biutils "github.com/jfrog/build-info-go/build/utils" + buildutils "github.com/jfrog/build-info-go/build/utils" + biutils "github.com/jfrog/build-info-go/utils" "github.com/jfrog/gofrog/version" coretests "github.com/jfrog/jfrog-cli-core/v2/utils/tests" "github.com/jfrog/jfrog-client-go/utils/log" @@ -69,7 +70,7 @@ func testNpm(t *testing.T, isLegacy bool) { wd, err := os.Getwd() assert.NoError(t, err, "Failed to get current dir") defer clientTestUtils.ChangeDirAndAssert(t, wd) - npmVersion, _, err := biutils.GetNpmVersionAndExecPath(log.Logger) + npmVersion, _, err := buildutils.GetNpmVersionAndExecPath(log.Logger) if err != nil { assert.NoError(t, err) return @@ -134,7 +135,7 @@ func testNpm(t *testing.T, isLegacy bool) { } func readModuleId(t *testing.T, wd string, npmVersion *version.Version) string { - packageInfo, err := biutils.ReadPackageInfoFromPackageJson(filepath.Dir(wd), npmVersion) + packageInfo, err := buildutils.ReadPackageInfoFromPackageJson(filepath.Dir(wd), npmVersion) assert.NoError(t, err) return packageInfo.BuildInfoModuleId() } @@ -171,7 +172,7 @@ func TestNpmConditionalUpload(t *testing.T) { assert.NoError(t, err, "Failed to get current dir") searchSpec, err := tests.CreateSpec(tests.SearchAllNpm) assert.NoError(t, err) - npmVersion, _, err := biutils.GetNpmVersionAndExecPath(log.Logger) + npmVersion, _, err := buildutils.GetNpmVersionAndExecPath(log.Logger) assert.NoError(t, err) npmProjectPath := initNpmProjectTest(t) clientTestUtils.ChangeDirAndAssert(t, npmProjectPath) @@ -350,7 +351,7 @@ func TestNpmPublishDetailedSummary(t *testing.T) { assert.NoError(t, err, "Failed to get current dir") defer clientTestUtils.ChangeDirAndAssert(t, wd) - npmVersion, _, err := biutils.GetNpmVersionAndExecPath(log.Logger) + npmVersion, _, err := buildutils.GetNpmVersionAndExecPath(log.Logger) if err != nil { assert.NoError(t, err) return @@ -460,7 +461,7 @@ func TestYarn(t *testing.T) { testDataSource := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "yarn") testDataTarget := filepath.Join(tempDirPath, tests.Out, "yarn") - assert.NoError(t, fileutils.CopyDir(testDataSource, testDataTarget, true, nil)) + assert.NoError(t, biutils.CopyDir(testDataSource, testDataTarget, true, nil)) yarnProjectPath := filepath.Join(testDataTarget, "yarnproject") assert.NoError(t, createConfigFileForTest([]string{yarnProjectPath}, tests.NpmRemoteRepo, "", t, utils.Yarn, false)) diff --git a/nuget_test.go b/nuget_test.go index b77f106b5..1f5f498b1 100644 --- a/nuget_test.go +++ b/nuget_test.go @@ -4,6 +4,7 @@ import ( "encoding/xml" dotnetUtils "github.com/jfrog/build-info-go/build/utils/dotnet" buildInfo "github.com/jfrog/build-info-go/entities" + biutils "github.com/jfrog/build-info-go/utils" "github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/dotnet" "github.com/jfrog/jfrog-cli-core/v2/artifactory/utils" "github.com/jfrog/jfrog-cli-core/v2/utils/config" @@ -93,7 +94,7 @@ func createNugetProject(t *testing.T, projectName string) string { err := fileutils.CreateDirIfNotExist(projectTarget) assert.NoError(t, err) - err = fileutils.CopyDir(projectSrc, projectTarget, true, nil) + err = biutils.CopyDir(projectSrc, projectTarget, true, nil) assert.NoError(t, err) return projectTarget } diff --git a/pip_test.go b/pip_test.go index e466d2d25..f7bcc9a96 100644 --- a/pip_test.go +++ b/pip_test.go @@ -1,6 +1,7 @@ package main import ( + biutils "github.com/jfrog/build-info-go/utils" "github.com/jfrog/jfrog-cli-core/v2/utils/coreutils" coretests "github.com/jfrog/jfrog-cli-core/v2/utils/tests" "github.com/jfrog/jfrog-cli-core/v2/xray/audit/python" @@ -168,7 +169,7 @@ func createPipProject(t *testing.T, outFolder, projectName string) string { assert.NoError(t, err) // Copy pip-installation file. - err = fileutils.CopyDir(projectSrc, projectTarget, true, nil) + err = biutils.CopyDir(projectSrc, projectTarget, true, nil) assert.NoError(t, err) // Copy pip-config file. diff --git a/pipenv_test.go b/pipenv_test.go index 0200eb0cb..f5b7b9bc6 100644 --- a/pipenv_test.go +++ b/pipenv_test.go @@ -1,6 +1,7 @@ package main import ( + biutils "github.com/jfrog/build-info-go/utils" "os" "path/filepath" "strconv" @@ -112,7 +113,7 @@ func createPipenvProject(t *testing.T, outFolder, projectName string) string { assert.NoError(t, err) // Copy pipenv-installation file. - err = fileutils.CopyDir(projectSrc, projectTarget, true, nil) + err = biutils.CopyDir(projectSrc, projectTarget, true, nil) assert.NoError(t, err) // Copy pipenv-config file. diff --git a/plugins/commands/uninstall_test.go b/plugins/commands/uninstall_test.go index 4aa5b975d..dfee60776 100644 --- a/plugins/commands/uninstall_test.go +++ b/plugins/commands/uninstall_test.go @@ -1,6 +1,7 @@ package commands import ( + biutils "github.com/jfrog/build-info-go/utils" "github.com/jfrog/jfrog-cli-core/v2/utils/coreutils" "github.com/jfrog/jfrog-cli-core/v2/utils/log" "github.com/jfrog/jfrog-cli-core/v2/utils/plugins" @@ -39,7 +40,7 @@ func TestRunUninstallCmd(t *testing.T) { return } pluginName := filepath.Base(pluginMockPath) - err = fileutils.CopyDir(pluginMockPath, filepath.Join(pluginsDir, pluginName), true, nil) + err = biutils.CopyDir(pluginMockPath, filepath.Join(pluginsDir, pluginName), true, nil) if err != nil { assert.NoError(t, err) return diff --git a/plugins_test.go b/plugins_test.go index 83e51eb77..dcbe0e187 100644 --- a/plugins_test.go +++ b/plugins_test.go @@ -1,6 +1,7 @@ package main import ( + biutils "github.com/jfrog/build-info-go/utils" "os" "path" "path/filepath" @@ -254,7 +255,7 @@ func TestPublishInstallCustomServer(t *testing.T) { exists, err := fileutils.IsDirExists(filepath.Join(wd, coreutils.PluginsResourcesDirName), false) assert.NoError(t, err) assert.False(t, exists) - err = fileutils.CopyDir(filepath.Join(wd, "testdata", "plugins", "plugin-mock", coreutils.PluginsResourcesDirName), filepath.Join(wd, coreutils.PluginsResourcesDirName), true, nil) + err = biutils.CopyDir(filepath.Join(wd, "testdata", "plugins", "plugin-mock", coreutils.PluginsResourcesDirName), filepath.Join(wd, coreutils.PluginsResourcesDirName), true, nil) assert.NoError(t, err) // Test with resources directory testPublishAndInstall(t, true) diff --git a/poetry_test.go b/poetry_test.go index 89194e1dc..3188ad34d 100644 --- a/poetry_test.go +++ b/poetry_test.go @@ -1,6 +1,7 @@ package main import ( + biutils "github.com/jfrog/build-info-go/utils" "os" "path/filepath" "strconv" @@ -108,7 +109,7 @@ func createPoetryProject(t *testing.T, outFolder, projectName string) string { assert.NoError(t, err) // Copy poetry project - err = fileutils.CopyDir(projectSrc, projectTarget, true, nil) + err = biutils.CopyDir(projectSrc, projectTarget, true, nil) assert.NoError(t, err) // Copy poetry-config file. diff --git a/testdata/xray/gradle/api/build.gradle b/testdata/xray/gradle/api/build.gradle new file mode 100644 index 000000000..492158b15 --- /dev/null +++ b/testdata/xray/gradle/api/build.gradle @@ -0,0 +1,15 @@ +configurations { + spi +} + +dependencies { + implementation project(':shared') + implementation module("commons-lang:commons-lang:2.4") { + dependency("commons-io:commons-io:1.2") + } + implementation group: 'org.apache.wicket', name: 'wicket', version: '1.3.7' + +} + +// Just a smoke test that using this option does not lead to any exception +compileJava.options.compilerArgs = ['-Xlint:unchecked'] diff --git a/testdata/xray/gradle/api/src/main/java/org/gradle/api/PersonList.java b/testdata/xray/gradle/api/src/main/java/org/gradle/api/PersonList.java new file mode 100644 index 000000000..1d80a16b3 --- /dev/null +++ b/testdata/xray/gradle/api/src/main/java/org/gradle/api/PersonList.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2011 JFrog Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api; + +import org.gradle.apiImpl.Impl; +import org.gradle.shared.Person; + +import java.util.ArrayList; + + +public class PersonList { + private ArrayList persons = new ArrayList(); + + public void doSomethingWithImpl() { + org.apache.commons.lang.builder.ToStringBuilder stringBuilder; + try { + Class.forName("org.apache.commons.io.FileUtils"); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + new Impl().implMethod(); + } + +} diff --git a/testdata/xray/gradle/api/src/main/java/org/gradle/api/package.html b/testdata/xray/gradle/api/src/main/java/org/gradle/api/package.html new file mode 100644 index 000000000..cea998a80 --- /dev/null +++ b/testdata/xray/gradle/api/src/main/java/org/gradle/api/package.html @@ -0,0 +1,19 @@ + + + +

These are the API classes

+ diff --git a/testdata/xray/gradle/api/src/main/java/org/gradle/apiImpl/Impl.java b/testdata/xray/gradle/api/src/main/java/org/gradle/apiImpl/Impl.java new file mode 100644 index 000000000..76cf0cc22 --- /dev/null +++ b/testdata/xray/gradle/api/src/main/java/org/gradle/apiImpl/Impl.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2011 JFrog Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.apiImpl; + + +public class Impl { + + public void implMethod() { + double a = 4.0 * 4; + } + +} diff --git a/testdata/xray/gradle/build.gradle b/testdata/xray/gradle/build.gradle index e1b9e8fd3..1ae1ed814 100644 --- a/testdata/xray/gradle/build.gradle +++ b/testdata/xray/gradle/build.gradle @@ -1,21 +1,33 @@ -apply plugin: 'groovy' -apply plugin: 'idea' +/* + * Copyright (C) 2013 JFrog Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -version = 1.0 -task initProject(description: 'Initialize project directory structure.') { - doLast { - // Default package to be created in each src dir. - def defaultPackage = 'org/jfrog/minimal-project' +buildscript { + repositories { + mavenCentral() + } +} - ['java', 'groovy', 'resources'].each { - // convention.sourceSets contains the directory structure - // for our Groovy project. So we use this structure - // and make a directory for each node. - sourceSets*."${it}".srcDirs*.each { dir -> - def newDir = new File(dir, defaultPackage) - logger.info "Creating directory $newDir" // gradle -i shows this message. - newDir.mkdirs() // Create dir. - } - } +allprojects { + repositories { + mavenCentral() } -} \ No newline at end of file + apply plugin: 'java' + apply plugin: 'maven-publish' + + group = 'org.jfrog.example.gradle' + version = '1.0' + status = 'integration' +} diff --git a/testdata/xray/gradle/gradle/wrapper/gradle-wrapper.jar b/testdata/xray/gradle/gradle/wrapper/gradle-wrapper.jar new file mode 100755 index 000000000..5c2d1cf01 Binary files /dev/null and b/testdata/xray/gradle/gradle/wrapper/gradle-wrapper.jar differ diff --git a/testdata/xray/gradle/gradle/wrapper/gradle-wrapper.properties b/testdata/xray/gradle/gradle/wrapper/gradle-wrapper.properties new file mode 100755 index 000000000..5028f28f8 --- /dev/null +++ b/testdata/xray/gradle/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/testdata/xray/gradle/gradlew b/testdata/xray/gradle/gradlew new file mode 100755 index 000000000..83f2acfdc --- /dev/null +++ b/testdata/xray/gradle/gradlew @@ -0,0 +1,188 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/testdata/xray/gradle/gradlew.bat b/testdata/xray/gradle/gradlew.bat new file mode 100755 index 000000000..9618d8d96 --- /dev/null +++ b/testdata/xray/gradle/gradlew.bat @@ -0,0 +1,100 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/testdata/xray/gradle/services/webservice/build.gradle b/testdata/xray/gradle/services/webservice/build.gradle new file mode 100644 index 000000000..f3ded41f2 --- /dev/null +++ b/testdata/xray/gradle/services/webservice/build.gradle @@ -0,0 +1,8 @@ +apply plugin: 'war' + +dependencies { + implementation project(':shared'), 'commons-collections:commons-collections:3.2@jar', 'commons-io:commons-io:1.2', 'commons-lang:commons-lang:2.4@jar' + implementation group: 'org.apache.wicket', name: 'wicket', version: '1.3.7' + testImplementation group: 'junit', name: 'junit', version: '4.11' + implementation project(':api') +} diff --git a/testdata/xray/gradle/services/webservice/src/main/java/org/gradle/webservice/TestTest.java b/testdata/xray/gradle/services/webservice/src/main/java/org/gradle/webservice/TestTest.java new file mode 100644 index 000000000..4843cca41 --- /dev/null +++ b/testdata/xray/gradle/services/webservice/src/main/java/org/gradle/webservice/TestTest.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2011 JFrog Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.webservice; + +import org.apache.commons.collections.list.GrowthList; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.gradle.api.PersonList; +import org.gradle.shared.Person; + +public class TestTest { + private String name; + + public void method() { + FilenameUtils.separatorsToUnix("my/unix/filename"); + ToStringBuilder.reflectionToString(new Person("name")); + new GrowthList(); + new PersonList().doSomethingWithImpl(); // compile with api-spi, runtime with api + } + +} diff --git a/testdata/xray/gradle/services/webservice/src/test/java/org/gradle/webservice/TestTestTest.java b/testdata/xray/gradle/services/webservice/src/test/java/org/gradle/webservice/TestTestTest.java new file mode 100644 index 000000000..b8e22a4ad --- /dev/null +++ b/testdata/xray/gradle/services/webservice/src/test/java/org/gradle/webservice/TestTestTest.java @@ -0,0 +1,31 @@ +/* + * Copyright 2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.webservice; + +import junit.framework.TestCase; + +/** + * @author Hans Dockter + */ +public class TestTestTest extends TestCase { + public void testClasspath() { + new TestTest().method(); + } + + public void testApiCompileClasspath() { + new org.gradle.api.PersonList(); + } +} diff --git a/testdata/xray/gradle/settings.gradle b/testdata/xray/gradle/settings.gradle index 6cf974940..397a3021a 100644 --- a/testdata/xray/gradle/settings.gradle +++ b/testdata/xray/gradle/settings.gradle @@ -1 +1 @@ -rootProject.name = 'minimal-example' \ No newline at end of file +include "shared", "api", "services:webservice" diff --git a/testdata/xray/gradle/shared/src/main/java/org/gradle/shared/Person.java b/testdata/xray/gradle/shared/src/main/java/org/gradle/shared/Person.java new file mode 100644 index 000000000..d9ed11ee8 --- /dev/null +++ b/testdata/xray/gradle/shared/src/main/java/org/gradle/shared/Person.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2011 JFrog Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.shared; + +import java.io.IOException; +import java.util.Properties; + +public class Person { + private String name; + + public Person(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String readProperty() throws IOException { + Properties properties = new Properties(); + properties.load(getClass().getClassLoader().getResourceAsStream("org/gradle/shared/main.properties")); + return properties.getProperty("main"); + } +} diff --git a/testdata/xray/gradle/shared/src/main/java/org/gradle/shared/package-info.java b/testdata/xray/gradle/shared/src/main/java/org/gradle/shared/package-info.java new file mode 100644 index 000000000..7c5f65caf --- /dev/null +++ b/testdata/xray/gradle/shared/src/main/java/org/gradle/shared/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2011 JFrog Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * These are the shared classes. + */ +package org.gradle.shared; diff --git a/testdata/xray/gradle/shared/src/main/resources/org/gradle/shared/main.properties b/testdata/xray/gradle/shared/src/main/resources/org/gradle/shared/main.properties new file mode 100644 index 000000000..fe6422c8d --- /dev/null +++ b/testdata/xray/gradle/shared/src/main/resources/org/gradle/shared/main.properties @@ -0,0 +1,16 @@ +# +# Copyright (C) 2011 JFrog Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +main=mainValue diff --git a/transfer_test.go b/transfer_test.go index 1ac5ce147..40c735552 100644 --- a/transfer_test.go +++ b/transfer_test.go @@ -2,6 +2,7 @@ package main import ( "encoding/json" + biutils "github.com/jfrog/build-info-go/utils" "os" "path/filepath" "strconv" @@ -397,7 +398,7 @@ func generateSnapshotFiles(t *testing.T) (repoSnapshotDir string) { assert.NoError(t, err) repoState, err := state.GetRepoStateFilepath(tests.RtRepo1, false) assert.NoError(t, err) - assert.NoError(t, fileutils.CopyFile(repoSnapshotDir, repoState)) + assert.NoError(t, biutils.CopyFile(repoSnapshotDir, repoState)) // Create snapshot file at snapshots directory. repoSnapshotFile, err := state.GetRepoSnapshotFilePath(tests.RtRepo1) diff --git a/utils/cliutils/utils_test.go b/utils/cliutils/utils_test.go index c3cef052d..0d257bb5f 100644 --- a/utils/cliutils/utils_test.go +++ b/utils/cliutils/utils_test.go @@ -3,6 +3,7 @@ package cliutils import ( "errors" "fmt" + biutils "github.com/jfrog/build-info-go/utils" configtests "github.com/jfrog/jfrog-cli-core/v2/utils/config/tests" clientTestUtils "github.com/jfrog/jfrog-client-go/utils/tests" "path/filepath" @@ -14,7 +15,6 @@ import ( commandUtils "github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/utils" "github.com/jfrog/jfrog-client-go/utils/io/content" - "github.com/jfrog/jfrog-client-go/utils/io/fileutils" "github.com/jfrog/jfrog-client-go/utils/log" "github.com/stretchr/testify/assert" ) @@ -50,7 +50,7 @@ func TestPrintCommandSummary(t *testing.T) { testdata := filepath.Join(tests.GetTestResourcesPath(), "reader", "printcommandsummary.json") tmpDir, createTempDirCallback := coretests.CreateTempDirWithCallbackAndAssert(t) defer createTempDirCallback() - err := fileutils.CopyFile(tmpDir, testdata) + err := biutils.CopyFile(tmpDir, testdata) assert.NoError(t, err) reader := content.NewContentReader(filepath.Join(tmpDir, "printcommandsummary.json"), content.DefaultKey) diff --git a/xray_test.go b/xray_test.go index 74d64c7c9..fd3ff3150 100644 --- a/xray_test.go +++ b/xray_test.go @@ -5,6 +5,7 @@ import ( "errors" "flag" "fmt" + biutils "github.com/jfrog/build-info-go/utils" "net/http" "net/http/httptest" "os" @@ -152,7 +153,7 @@ func testXrayAuditNpm(t *testing.T, format string) string { defer createTempDirCallback() npmProjectPath := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "xray", "npm") // Copy the npm project from the testdata to a temp dir - assert.NoError(t, fileutils.CopyDir(npmProjectPath, tempDirPath, true, nil)) + assert.NoError(t, biutils.CopyDir(npmProjectPath, tempDirPath, true, nil)) prevWd := changeWD(t, tempDirPath) defer clientTestUtils.ChangeDirAndAssert(t, prevWd) // Run npm install before executing jfrog xr npm-audit @@ -195,7 +196,7 @@ func testXrayAuditYarn(t *testing.T, projectDirName string, yarnCmd func()) { defer createTempDirCallback() yarnProjectPath := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "xray", projectDirName) // Copy the Yarn project from the testdata to a temp directory - assert.NoError(t, fileutils.CopyDir(yarnProjectPath, tempDirPath, true, nil)) + assert.NoError(t, biutils.CopyDir(yarnProjectPath, tempDirPath, true, nil)) prevWd := changeWD(t, tempDirPath) defer clientTestUtils.ChangeDirAndAssert(t, prevWd) // Run yarn install before executing jf audit --yarn. Return error to assert according to test. @@ -232,7 +233,7 @@ func testXrayAuditNuget(t *testing.T, projectName, format string) string { defer createTempDirCallback() projectPath := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "xray", "nuget", projectName) - assert.NoError(t, fileutils.CopyDir(projectPath, tempDirPath, true, nil)) + assert.NoError(t, biutils.CopyDir(projectPath, tempDirPath, true, nil)) prevWd := changeWD(t, tempDirPath) defer clientTestUtils.ChangeDirAndAssert(t, prevWd) // Add dummy descriptor file to check that we run only specific audit @@ -244,12 +245,12 @@ func testXrayAuditNuget(t *testing.T, projectName, format string) string { func TestXrayAuditGradleJson(t *testing.T) { output := testXrayAuditGradle(t, string(utils.Json)) - verifyJsonScanResults(t, output, 0, 0, 0) + verifyJsonScanResults(t, output, 0, 3, 3) } func TestXrayAuditGradleSimpleJson(t *testing.T) { output := testXrayAuditGradle(t, string(utils.SimpleJson)) - verifySimpleJsonScanResults(t, output, 0, 0) + verifySimpleJsonScanResults(t, output, 3, 3) } func testXrayAuditGradle(t *testing.T, format string) string { @@ -258,7 +259,7 @@ func testXrayAuditGradle(t *testing.T, format string) string { defer createTempDirCallback() gradleProjectPath := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "xray", "gradle") // Copy the gradle project from the testdata to a temp dir - assert.NoError(t, fileutils.CopyDir(gradleProjectPath, tempDirPath, true, nil)) + assert.NoError(t, biutils.CopyDir(gradleProjectPath, tempDirPath, true, nil)) prevWd := changeWD(t, tempDirPath) defer clientTestUtils.ChangeDirAndAssert(t, prevWd) // Add dummy descriptor file to check that we run only specific audit @@ -282,7 +283,7 @@ func testXrayAuditMaven(t *testing.T, format string) string { defer createTempDirCallback() mvnProjectPath := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "xray", "maven") // Copy the maven project from the testdata to a temp dir - assert.NoError(t, fileutils.CopyDir(mvnProjectPath, tempDirPath, true, nil)) + assert.NoError(t, biutils.CopyDir(mvnProjectPath, tempDirPath, true, nil)) prevWd := changeWD(t, tempDirPath) defer clientTestUtils.ChangeDirAndAssert(t, prevWd) // Add dummy descriptor file to check that we run only specific audit @@ -307,7 +308,7 @@ func TestXrayAuditDetectTech(t *testing.T) { defer createTempDirCallback() mvnProjectPath := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "xray", "maven") // Copy the maven project from the testdata to a temp dir - assert.NoError(t, fileutils.CopyDir(mvnProjectPath, tempDirPath, true, nil)) + assert.NoError(t, biutils.CopyDir(mvnProjectPath, tempDirPath, true, nil)) prevWd := changeWD(t, tempDirPath) defer clientTestUtils.ChangeDirAndAssert(t, prevWd) // Run generic audit on mvn project with a vulnerable dependency @@ -325,7 +326,7 @@ func TestXrayAuditMultiProjects(t *testing.T) { defer createTempDirCallback() multiProject := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "xray") // Copy the multi project from the testdata to a temp dir - assert.NoError(t, fileutils.CopyDir(multiProject, tempDirPath, true, nil)) + assert.NoError(t, biutils.CopyDir(multiProject, tempDirPath, true, nil)) workingDirsFlag := fmt.Sprintf("--working-dirs=%s, %s ,%s, %s", filepath.Join(tempDirPath, "maven"), filepath.Join(tempDirPath, "nuget", "single"), filepath.Join(tempDirPath, "python", "pip"), filepath.Join(tempDirPath, "jas-test")) @@ -363,7 +364,7 @@ func testXrayAuditPip(t *testing.T, format, requirementsFile string) string { defer createTempDirCallback() pipProjectPath := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "xray", "python", "pip") // Copy the pip project from the testdata to a temp dir - assert.NoError(t, fileutils.CopyDir(pipProjectPath, tempDirPath, true, nil)) + assert.NoError(t, biutils.CopyDir(pipProjectPath, tempDirPath, true, nil)) prevWd := changeWD(t, tempDirPath) defer clientTestUtils.ChangeDirAndAssert(t, prevWd) // Add dummy descriptor file to check that we run only specific audit @@ -392,7 +393,7 @@ func testXrayAuditPipenv(t *testing.T, format string) string { defer createTempDirCallback() pipenvProjectPath := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "xray", "python", "pipenv") // Copy the pipenv project from the testdata to a temp dir - assert.NoError(t, fileutils.CopyDir(pipenvProjectPath, tempDirPath, true, nil)) + assert.NoError(t, biutils.CopyDir(pipenvProjectPath, tempDirPath, true, nil)) prevWd := changeWD(t, tempDirPath) defer clientTestUtils.ChangeDirAndAssert(t, prevWd) // Add dummy descriptor file to check that we run only specific audit @@ -454,7 +455,7 @@ func testXrayAuditPoetry(t *testing.T, format string) string { defer createTempDirCallback() poetryProjectPath := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "xray", "python", "poetry") // Copy the poetry project from the testdata to a temp dir - assert.NoError(t, fileutils.CopyDir(poetryProjectPath, tempDirPath, true, nil)) + assert.NoError(t, biutils.CopyDir(poetryProjectPath, tempDirPath, true, nil)) prevWd := changeWD(t, tempDirPath) defer clientTestUtils.ChangeDirAndAssert(t, prevWd) // Add dummy descriptor file to check that we run only specific audit @@ -683,7 +684,7 @@ func testXrayAuditJas(t *testing.T, format string, project string) string { defer createTempDirCallback() projectDir := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), filepath.Join("xray", project)) // Copy the multi project from the testdata to a temp dir - assert.NoError(t, fileutils.CopyDir(projectDir, tempDirPath, true, nil)) + assert.NoError(t, biutils.CopyDir(projectDir, tempDirPath, true, nil)) // Configure a new server named "default" createJfrogHomeConfig(t, true) defer cleanTestsHomeEnv() @@ -718,7 +719,7 @@ func TestCurationAudit(t *testing.T) { tempDirPath, createTempDirCallback := coretests.CreateTempDirWithCallbackAndAssert(t) defer createTempDirCallback() multiProject := filepath.Join(filepath.FromSlash(tests.GetTestResourcesPath()), "xray") - assert.NoError(t, fileutils.CopyDir(multiProject, tempDirPath, true, nil)) + assert.NoError(t, biutils.CopyDir(multiProject, tempDirPath, true, nil)) rootDir, err := os.Getwd() require.NoError(t, err) defer func() {