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

Discover Gradle builds by looking for setting.gradle(.kts) #1618

Merged
merged 3 commits into from
Oct 24, 2024

Conversation

jjohannes
Copy link
Contributor

@jjohannes jjohannes commented Oct 14, 2024

When the option gradle.nestedProjects: true is set, the build roots are currently discovered by looking for the wrapper scripts. These however are completely optional for a build.

But there is one thing each Gradle build definitely needs to have: A settings.gradle or setting.gradle.kts file.
Gradle itself searches for these files to accept a folder as a Gradle build/project.

This change proposes to check for these files instead of the gradlw scripts.

A good project to test this with is
https://github.com/microsoft/build-server-for-gradle which contains a lot of Gradle builds in the testProjects folder.

When the option 'gradle.nestedProjects: true' is set, the build
roots are currently discovered by looking for the wrapper scripts.
These however are completely optional for a build.

But there is one thing each Gradle build definitely needs to have:
A 'settings.gradle' or 'setting.gradle.kts' file.
Gradle itself searches for these files to accept a folder as a
Gradle build/project.

This change proposes to check for these files instead of the gradlw
scripts.

A good project to test this with is
https://github.com/microsoft/build-server-for-gradle
which contains a lot of Gradle build in the 'testProjects' folder.

Signed-off-by: Jendrik Johannes <[email protected]>
@jdneo jdneo added this to the 3.16.5 milestone Oct 16, 2024
@jdneo jdneo added the enhancement New feature or request label Oct 16, 2024
@jdneo
Copy link
Member

jdneo commented Oct 16, 2024

Ops, some tests failed. Let me check what's happening

@jdneo jdneo force-pushed the discover-gradle-builds-by-settings branch from 70c9b8b to d599e1c Compare October 24, 2024 05:02
@jdneo jdneo force-pushed the discover-gradle-builds-by-settings branch from d599e1c to 9157777 Compare October 24, 2024 08:53
Copy link
Member

@jdneo jdneo left a comment

Choose a reason for hiding this comment

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

Turns out some mock code needs to be updated.

The change looks good to me.

@jdneo jdneo merged commit 4104198 into microsoft:develop Oct 24, 2024
8 checks passed
@jdneo
Copy link
Member

jdneo commented Oct 24, 2024

Thank you @jjohannes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants