Skip to content

Conversation

@nitinp19
Copy link
Contributor

Challenge- Currently we don't support run native any gradle commands. We have our own custom command "artifactoryPublish" to publish the build info for the gradle.

Implementation- We are using the flexpack which will help us to collect the build info for the gradle run-native command

@nitinp19 nitinp19 added the safe to test Approve running integration tests on a pull request label Dec 11, 2025
@nitinp19 nitinp19 requested a review from fluxxBot December 11, 2025 11:34
@nitinp19 nitinp19 added new feature Automatically generated release notes safe to test Approve running integration tests on a pull request and removed safe to test Approve running integration tests on a pull request labels Dec 12, 2025
@nitinp19 nitinp19 added safe to test Approve running integration tests on a pull request and removed safe to test Approve running integration tests on a pull request labels Dec 12, 2025
}

// FlexPack native mode for Gradle (bypasses config file requirements)
if nativeMode && !configExists {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already a function exists for this in build-info-go

}

configFilePath, err := getProjectConfigPathOrThrow(project.Gradle, "gradle", "gradle-config")
nativeMode := os.Getenv("JFROG_RUN_NATIVE") == "true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 638 to 661
// FlexPack native mode for Gradle (bypasses config file requirements)
if nativeMode && !configExists {
log.Debug("Routing to Gradle FlexPack implementation")
if c.NArg() < 1 {
return cliutils.WrongNumberOfArgumentsHandler(c)
}
args := cliutils.ExtractCommand(c)
filteredGradleArgs, buildConfiguration, err := build.ExtractBuildDetailsFromArgs(args)
if err != nil {
return err
}

// Create Gradle command with FlexPack (no config file needed)
gradleCmd := gradle.NewGradleCommand().SetConfiguration(buildConfiguration).SetTasks(filteredGradleArgs).SetConfigPath("")
return commands.Exec(gradleCmd)
}

// If config file is missing and not in native mode, return the standard missing-config error.
if !configExists {
if configFilePath, err = getProjectConfigPathOrThrow(project.Gradle, "gradle", "gradle-config"); err != nil {
return err
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we improve this entire conditional logic?

@github-actions
Copy link
Contributor

👍 Frogbot scanned this pull request and did not find any new security issues.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature Automatically generated release notes safe to test Approve running integration tests on a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants