Skip to content

Configurable Gradle SourceSet #4396

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nathanfallet
Copy link

@nathanfallet nathanfallet commented Jul 1, 2025

Fixes #4316

This introduces a new configuration option sourceSetName that just sets the name of the source set that should be used.
This is required to make the Gradle Jib plugin compatible with the Kotlin Multiplatform Plugin.
See https://youtrack.jetbrains.com/issue/KTOR-8464 for more about it.

The PR is inspired by #3034 which is a very similar change.
If this looks good, I can add integration tests the same way #3125 did.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @nathanfallet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the Jib Gradle plugin by introducing a configurable sourceSet option. This crucial addition allows the plugin to properly integrate with projects using the Kotlin Multiplatform Plugin, which often uses non-standard source set names, thereby resolving a known compatibility issue and improving the plugin's flexibility.

Highlights

  • New Configuration Option: Introduced a new sourceSet configuration option in the Jib Gradle plugin, allowing users to specify the name of the Gradle SourceSet to be used for building images. This property defaults to main.
  • Kotlin Multiplatform Compatibility: This change directly addresses compatibility issues with the Kotlin Multiplatform Plugin by making the SourceSet configurable, which was previously hardcoded to 'main'. This enables Jib to correctly identify and package sources from multiplatform projects.
  • Core Logic Updates: Modified internal Jib Gradle tasks (BuildDockerTask, BuildImageTask, BuildTarTask, SyncMapTask, FilesTaskV2) and the GradleProjectProperties utility class to accept and utilize the newly configurable sourceSet name, replacing the previously hardcoded 'main' source set references.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a configurable Gradle sourceSet to enhance compatibility with plugins like the Kotlin Multiplatform Plugin. The changes are well-contained, but the new sourceSetName property is missing support for system property overrides.

nathanfallet and others added 2 commits July 1, 2025 16:11
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gradle: Allow setting custom sourceset
1 participant