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

Gradle: Allow setting custom sourceset #4316

Open
stashymane opened this issue Sep 26, 2024 · 0 comments
Open

Gradle: Allow setting custom sourceset #4316

stashymane opened this issue Sep 26, 2024 · 0 comments

Comments

@stashymane
Copy link

Environment:

  • Jib version: 3.4.3
  • Build tool: Gradle 8.7

Description of the issue:
Currently, the main sourceset is hardcoded into the gradle plugin. With the default Java plugin this works well, however running anything else makes using Jib difficult.
My use-case is Kotlin Multiplatform - it does generate a JVM target, however it does not create a main sourceset. This results in Jib throwing an exception:

org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':server'.
Caused by: org.gradle.api.UnknownDomainObjectException: SourceSet with name 'main' not found.
	at com.google.cloud.tools.jib.gradle.JibPlugin.lambda$apply$9(JibPlugin.java:189)

Having to manually set up the main sourceset as a "mirror" is error-prone and cumbersome. A very simple choice of sourceset in the Jib configuration would solve most issues.

This exact issue was already mentioned in #1778, and even though the issue was closed, only the configuration was allowed to be configurable. The sourceset still isn't.

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

No branches or pull requests

2 participants