With the deprecation of <https://docs.gradle.org/c...
# community-support
a
With the deprecation of StartParameter.getSettingsFile() is there an alternative for a plugin author to know what the correct settings.gradle or settings.gradle.kts file name was when the build is executed? The reason for knowing this is simply to provide accurate message to the end user about configuration required in settings.gradle as a means of validating certain properties of the project were set correctly.
v
Where do you produce that error message? In a settings plugin?
a
yea, that is my intent. For now I simply resolved the issue by just putting a generic
settings.gradle or settings.gradle.kts
string in the message. Works, just not precise for my taste.
v
Hm, I thought there was an API to get the settings script file name, but I don't find it. Maybe you could open a feature request to add that to
Settings
. You could check which file exists and use that in the message, assuming that in almost all cases you will not find both.
a
Yea, I figured now that these are deprecated in 9.0 the choices will be only two well known filenames. The only API in existence was StartParamerer.getSettingsFile() which as I said is scheduled for removal in 9.0
👌 1
e
Copy code
(settings as org.gradle.api.internal.SettingsInternal).settingsScript.fileName
isn't deprecated (as it wasn't public to begin with 😉)
a
Interesting option but I prefer not to make such internal class usages. Thanks though.
👌 1
v
That's basically what I meant you could post as feature request, that this is moved to
Settings
🙂
🙌 1