-
Notifications
You must be signed in to change notification settings - Fork 277
Supporting Run native behavior for Gradle #3267
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
Conversation
buildtools/cli.go
Outdated
| } | ||
|
|
||
| // FlexPack native mode for Gradle (bypasses config file requirements) | ||
| if nativeMode && !configExists { |
There was a problem hiding this comment.
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
buildtools/cli.go
Outdated
| } | ||
|
|
||
| configFilePath, err := getProjectConfigPathOrThrow(project.Gradle, "gradle", "gradle-config") | ||
| nativeMode := os.Getenv("JFROG_RUN_NATIVE") == "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildtools/cli.go
Outdated
| // 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 | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
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?

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