Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove prefix dots in debricked custom files #137

Merged
merged 12 commits into from
Oct 27, 2023
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ coverage.html
node_modules
debricked
dist/
/.debricked-go-dependencies.txt
/.gomod.debricked.lock
/debricked-go-dependencies.txt
/gomod.debricked.lock
/.env
test/resolve/testdata/pip/requirements.txt.venv/
test/resolve/testdata/pip/.requirements.txt.debricked.lock
test/resolve/testdata/pip/requirements.txt.debricked.lock
internal/cmd/scan/testdata/npm/yarn.lock
internal/resolution/pm/gradle/.gradle-init-script.debricked.groovy
internal/resolution/pm/gradle/gradle-init-script.debricked.groovy
test/resolve/testdata/npm/yarn.lock
test/resolve/testdata/nuget/packages.lock.json
test/resolve/testdata/nuget/obj
.debricked.fingerprints.wfp
debricked.fingerprints.wfp
2 changes: 1 addition & 1 deletion internal/fingerprint/fingerprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var EXCLUDED_FILES = []string{
}

const (
OutputFileNameFingerprints = ".debricked.fingerprints.wfp"
OutputFileNameFingerprints = "debricked.fingerprints.wfp"
)

func isExcludedFile(filename string) bool {
Expand Down
2 changes: 1 addition & 1 deletion internal/resolution/pm/gomod/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

const (
fileName = ".gomod.debricked.lock"
fileName = "gomod.debricked.lock"
)

type Job struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/resolution/pm/gradle/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (

const (
initGradle = "gradle"
multiProjectFilename = ".debricked.multiprojects.txt"
gradleInitScriptFileName = ".gradle-init-script.debricked.groovy"
multiProjectFilename = "debricked.multiprojects.txt"
gradleInitScriptFileName = "gradle-init-script.debricked.groovy"
ProgHaj marked this conversation as resolved.
Show resolved Hide resolved
)

//go:embed gradle-init/gradle-init-script.groovy
Expand Down
2 changes: 1 addition & 1 deletion internal/resolution/pm/maven/cmd_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (_ CmdFactory) MakeDependencyTreeCmd(workingDirectory string) (*exec.Cmd, e
Args: []string{
"mvn",
"dependency:tree",
"-DoutputFile=.maven.debricked.lock",
"-DoutputFile=" + lockFileExtension,
"-DoutputType=tgf",
"--fail-at-end",
},
Expand Down
2 changes: 1 addition & 1 deletion internal/resolution/pm/maven/cmd_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func TestMakeDependencyTreeCmd(t *testing.T) {
args := cmd.Args
assert.Contains(t, args, "mvn")
assert.Contains(t, args, "dependency:tree")
assert.Contains(t, args, "-DoutputFile=.maven.debricked.lock")
assert.Contains(t, args, "-DoutputFile=maven.debricked.lock")
assert.Contains(t, args, "-DoutputType=tgf")
assert.Contains(t, args, "--fail-at-end")
}
4 changes: 4 additions & 0 deletions internal/resolution/pm/maven/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
"github.com/debricked/cli/internal/resolution/job"
)

const (
lockFileExtension = "maven.debricked.lock"
)

type Job struct {
job.BaseJob
cmdFactory ICmdFactory
Expand Down
7 changes: 5 additions & 2 deletions internal/resolution/pm/nuget/cmd_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import (
"strings"
)

const packagesConfigLockfile = "packages.config.nuget.debricked.lock"
const nugetLockfile = "packages.lock.json"

type ICmdFactory interface {
MakeInstallCmd(command string, file string) (*exec.Cmd, error)
GetTempoCsproj() string
Expand Down Expand Up @@ -77,14 +80,14 @@ func (cmdf *CmdFactory) MakeInstallCmd(command string, file string) (*exec.Cmd,
return nil, err
}

fileLockName := "packages.lock.json"
fileLockName := nugetLockfile
if packageConfig.MatchString(file) {
file, err = cmdf.convertPackagesConfigToCsproj(file, command)
cmdf.tempoCsproj = file
if err != nil {
return nil, err
}
fileLockName = ".packages.config.nuget.debricked.lock"
fileLockName = packagesConfigLockfile
}

fileDir := filepath.Dir(file)
Expand Down
2 changes: 1 addition & 1 deletion internal/resolution/pm/nuget/cmd_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestMakeInstallCmdPackagsConfig(t *testing.T) {
assert.Contains(t, args, "restore")
assert.Contains(t, args, "--use-lock-file")
assert.Contains(t, args, "--lock-file-path")
assert.Contains(t, args, ".packages.config.nuget.debricked.lock")
assert.Contains(t, args, "packages.config.nuget.debricked.lock")

// Cleanup: Remove the created .csproj file
if err := os.Remove("testdata/valid/packages.config.nuget.debricked.csproj.temp"); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/resolution/pm/pip/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

const (
lockFileExtension = ".pip.debricked.lock"
lockFileExtension = "pip.debricked.lock"
pip = "pip"
lockFileDelimiter = "***"
)
Expand Down