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

Handle Gradle system properties with spaces #2357

Merged
merged 22 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
92b2b89
Update dependencies
omerzi Dec 13, 2023
9a42b8c
Merge remote-tracking branch 'upstream/dev' into handle-gradle-system…
omerzi Dec 13, 2023
4bffd64
Update tests
omerzi Dec 13, 2023
813f940
Update tests
omerzi Dec 13, 2023
00b7b62
Update tests
omerzi Dec 13, 2023
7170bc3
Update core
omerzi Dec 17, 2023
a2cc64a
Merge branch 'dev' into fix-gradle-tasks-split
omerzi Dec 17, 2023
8c47cae
Merge branch 'dev' into fix-gradle-tasks-split
omerzi Dec 17, 2023
339b11f
Merge remote-tracking branch 'upstream/dev' into handle-gradle-system…
omerzi Dec 17, 2023
b738954
Merge branch 'dev' into fix-gradle-tasks-split
omerzi Dec 17, 2023
cdece2b
Merge branch 'dev' into fix-gradle-tasks-split
omerzi Dec 17, 2023
321774b
Merge remote-tracking branch 'origin/handle-gradle-system-props' into…
omerzi Dec 17, 2023
a940ac4
Merge remote-tracking branch 'origin/handle-gradle-system-props' into…
omerzi Dec 17, 2023
197ba37
Merge remote-tracking branch 'origin/handle-gradle-system-props' into…
omerzi Dec 17, 2023
415f44f
Merge remote-tracking branch 'origin/handle-gradle-system-props' into…
omerzi Dec 17, 2023
c2c9ae1
Merge remote-tracking branch 'origin/handle-gradle-system-props' into…
omerzi Dec 17, 2023
5a998d3
Merge remote-tracking branch 'origin/handle-gradle-system-props' into…
omerzi Dec 17, 2023
84a54fb
Merge branch 'dev' into fix-gradle-tasks-split
omerzi Dec 20, 2023
2a1033c
Merge branch 'dev' into fix-gradle-tasks-split
omerzi Dec 20, 2023
cd8f0d1
Merge remote-tracking branch 'upstream/dev' into handle-gradle-system…
omerzi Dec 20, 2023
fa9a10e
Merge branch 'dev' into fix-gradle-tasks-split
omerzi Dec 20, 2023
b439f40
Merge remote-tracking branch 'origin/handle-gradle-system-props' into…
omerzi Dec 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildtools/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ func GradleCmd(c *cli.Context) (err error) {
return err
}
printDeploymentView := log.IsStdErrTerminal()
gradleCmd := gradle.NewGradleCommand().SetConfiguration(buildConfiguration).SetTasks(strings.Join(filteredGradleArgs, " ")).SetConfigPath(configFilePath).SetThreads(threads).SetDetailedSummary(detailedSummary || printDeploymentView).SetXrayScan(xrayScan).SetScanOutputFormat(scanOutputFormat)
gradleCmd := gradle.NewGradleCommand().SetConfiguration(buildConfiguration).SetTasks(filteredGradleArgs).SetConfigPath(configFilePath).SetThreads(threads).SetDetailedSummary(detailedSummary || printDeploymentView).SetXrayScan(xrayScan).SetScanOutputFormat(scanOutputFormat)
err = commands.Exec(gradleCmd)
result := gradleCmd.Result()
defer cliutils.CleanupResult(result, &err)
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20231130093251-25c79868c10c
replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20231220111402-c8c1e14358a8

// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20231218161600-36dbad03f5c2
replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20231220105505-e62769dde9da

// replace github.com/jfrog/gofrog => github.com/jfrog/gofrog v1.3.2-0.20231130091721-6d742be8bc7a
replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20231220102935-c8776c613ad8

// replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20231126134442-14887b84b87a
// replace github.com/jfrog/gofrog => github.com/jfrog/gofrog v1.3.2-0.20231130091721-6d742be8bc7a
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,16 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jedib0t/go-pretty/v6 v6.4.0 h1:YlI/2zYDrweA4MThiYMKtGRfT+2qZOO65ulej8GTcVI=
github.com/jedib0t/go-pretty/v6 v6.4.0/go.mod h1:MgmISkTWDSFu0xOqiZ0mKNntMQ2mDgOcwOkwBEkMDJI=
github.com/jfrog/build-info-go v1.9.17 h1:sUA6V3P8i+awYlK7dkwm4l6IuLE2W964F5Pb18x95HA=
github.com/jfrog/build-info-go v1.9.17/go.mod h1:/5VZXH2Ud0IK3cOFwPykjwPOaEcHhzzbjnRiou+YKpM=
github.com/jfrog/build-info-go v1.8.9-0.20231220102935-c8776c613ad8 h1:eAMet7vShbCBSL4QCia/F7pvtPHUGPqVqpvv3Y0cOkw=
github.com/jfrog/build-info-go v1.8.9-0.20231220102935-c8776c613ad8/go.mod h1:/5VZXH2Ud0IK3cOFwPykjwPOaEcHhzzbjnRiou+YKpM=
github.com/jfrog/gofrog v1.3.2 h1:TktKP+PdZdxjkYZxWWIq4DkTGSYtr9Slsy+egZpEhUY=
github.com/jfrog/gofrog v1.3.2/go.mod h1:AQo5Fq0G9nDEF6icH7MYQK0iohR4HuEAXl8jaxRuT6Q=
github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYLipdsOFMY=
github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w=
github.com/jfrog/jfrog-cli-core/v2 v2.47.6 h1:k8elejLkXA+4SCExynlMElYDFtMUb0TSWc7CFkpFVMc=
github.com/jfrog/jfrog-cli-core/v2 v2.47.6/go.mod h1:p/hr1BkO3BVSVOMkAL599FAQaBK7O+HPHHvcdwm+jKs=
github.com/jfrog/jfrog-client-go v1.35.2 h1:JtGqf7KK+wcx/Pf5b0MUrkvMc+tCtIi0cB5TxFjQxnk=
github.com/jfrog/jfrog-client-go v1.35.2/go.mod h1:p80RAyfQQ78M2r5LUw1uUTA8yxTmTNoPy7eJ4IzOge0=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20231220111402-c8c1e14358a8 h1:pcF3UC/sST+jGtsio3UdK0+1bOOGRIZr0hc2owWhfJ0=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20231220111402-c8c1e14358a8/go.mod h1:5fV8ru7uMkW+V6xvWdUhAQC3dBHL2IrFZgC9crEZIus=
github.com/jfrog/jfrog-client-go v1.28.1-0.20231220105505-e62769dde9da h1:t56rae4Ut2XDvubtxTbrjUk4neWvu+KcwlDlJ5BYBMc=
github.com/jfrog/jfrog-client-go v1.28.1-0.20231220105505-e62769dde9da/go.mod h1:0NN5REuCDly9u0FtZxmb1wcOBr1cVR/gPazyZSO8Zs0=
github.com/jszwec/csvutil v1.8.0 h1:G7vS2LGdpZZDH1HmHeNbxOaJ/ZnJlpwGFvOkTkJzzNk=
github.com/jszwec/csvutil v1.8.0/go.mod h1:/E4ONrmGkwmWsk9ae9jpXnv9QT8pLHEPcCirMFhxG9I=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
Expand Down
14 changes: 7 additions & 7 deletions gradle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestGradleBuildConditionalUpload(t *testing.T) {
oldHomeDir := changeWD(t, filepath.Dir(buildGradlePath))
defer clientTestUtils.ChangeDirAndAssert(t, oldHomeDir)
execFunc := func() error {
return runJfrogCliWithoutAssertion("gradle", "clean artifactoryPublish", "-b"+buildGradlePath, "--scan")
return runJfrogCliWithoutAssertion("gradle", "clean", "artifactoryPublish", "-b"+buildGradlePath, "--scan")
}
testConditionalUpload(t, execFunc, searchSpec, tests.GetGradleDeployedArtifacts()...)
cleanGradleTest(t)
Expand All @@ -61,7 +61,7 @@ func TestGradleWithDeploymentView(t *testing.T) {
defer clientTestUtils.ChangeDirAndAssert(t, oldHomeDir)
assertPrintedDeploymentViewFunc, cleanupFunc := initDeploymentViewTest(t)
defer cleanupFunc()
assert.NoError(t, runJfrogCliWithoutAssertion("gradle", "clean artifactoryPublish", "-b"+buildGradlePath))
assert.NoError(t, runJfrogCliWithoutAssertion("gradle", "clean", "artifactoryPublish", "-b"+buildGradlePath))
assertPrintedDeploymentViewFunc()
cleanGradleTest(t)
}
Expand All @@ -76,7 +76,7 @@ func TestGradleBuildWithServerID(t *testing.T) {
buildNumber := "1"
// Windows compatibility
buildGradlePath = strings.ReplaceAll(buildGradlePath, `\`, "/")
runJfrogCli(t, "gradle", "clean artifactoryPublish", "-b"+buildGradlePath, "--build-name="+tests.GradleBuildName, "--build-number="+buildNumber)
runJfrogCli(t, "gradle", "clean", "artifactoryPublish", "-b"+buildGradlePath, "--build-name="+tests.GradleBuildName, "--build-number="+buildNumber)
clientTestUtils.ChangeDirAndAssert(t, oldHomeDir)
// Validate
searchSpec, err := tests.CreateSpec(tests.SearchAllGradle)
Expand Down Expand Up @@ -111,8 +111,8 @@ func TestGradleBuildWithServerIDAndDetailedSummary(t *testing.T) {
buildGradlePath = strings.ReplaceAll(buildGradlePath, `\`, "/")

// Test gradle with detailed summary without buildinfo props.
filteredGradleArgs := []string{"clean artifactoryPublish", "-b" + buildGradlePath}
gradleCmd := gradle.NewGradleCommand().SetConfiguration(new(utils.BuildConfiguration)).SetTasks(strings.Join(filteredGradleArgs, " ")).SetConfigPath(filepath.Join(destPath, "gradle.yaml")).SetDetailedSummary(true)
filteredGradleArgs := []string{"clean", "artifactoryPublish", "-b" + buildGradlePath}
gradleCmd := gradle.NewGradleCommand().SetConfiguration(new(utils.BuildConfiguration)).SetTasks(filteredGradleArgs).SetConfigPath(filepath.Join(destPath, "gradle.yaml")).SetDetailedSummary(true)
assert.NoError(t, commands.Exec(gradleCmd))
// Validate sha256
assert.NotNil(t, gradleCmd.Result())
Expand All @@ -121,7 +121,7 @@ func TestGradleBuildWithServerIDAndDetailedSummary(t *testing.T) {
}

// Test gradle with detailed summary + buildinfo.
gradleCmd = gradle.NewGradleCommand().SetConfiguration(utils.NewBuildConfiguration(tests.GradleBuildName, buildNumber, "", "")).SetTasks(strings.Join(filteredGradleArgs, " ")).SetConfigPath(filepath.Join(destPath, "gradle.yaml")).SetDetailedSummary(true)
gradleCmd = gradle.NewGradleCommand().SetConfiguration(utils.NewBuildConfiguration(tests.GradleBuildName, buildNumber, "", "")).SetTasks(filteredGradleArgs).SetConfigPath(filepath.Join(destPath, "gradle.yaml")).SetDetailedSummary(true)
assert.NoError(t, commands.Exec(gradleCmd))
// Validate sha256
tests.VerifySha256DetailedSummaryFromResult(t, gradleCmd.Result())
Expand Down Expand Up @@ -160,7 +160,7 @@ func TestGradleBuildWithServerIDWithUsesPlugin(t *testing.T) {
oldHomeDir := changeWD(t, filepath.Dir(buildGradlePath))
buildName := tests.GradleBuildName
buildNumber := "1"
runJfrogCli(t, "gradle", "clean artifactoryPublish -b "+buildGradlePath, "--build-name="+buildName, "--build-number="+buildNumber)
runJfrogCli(t, "gradle", "clean", "artifactoryPublish", "-b"+buildGradlePath, "--build-name="+buildName, "--build-number="+buildNumber)
changeWD(t, oldHomeDir)
// Validate
searchSpec, err := tests.CreateSpec(tests.SearchAllGradle)
Expand Down
Loading