This message was deleted.
# plugin-development
s
This message was deleted.
c
The best option would be to look at perhaps a system property or environment variable to control this, as plugins are not parameterized.
s
Thanks for the quick answer. We do this already:
Copy code
val path = System.getProperty("user.dir")
val versionsPath = if (path.endsWith("test")) "../someFile" else "someFile"
But this looks a bit strange.. 🙈 😄
c
could do
Copy code
System.getProperty("plugin.config.file")
v
You can also use a Gradle property, no need for a system property.
c
can you get a Gradle property in a Settings plugin?
v
Of course, why not?
settings.hasProperty
/
settings.getProperty
or
val foo by settings
should also work I think
c
gotcha. had erroneously assumed those required a project. thanks for the info!
v
It does not have some of the sugar
project
has like
findProperty
, but generally Gradle properties work perfectly fine.
s
Isn't applying done before evaluated the whole settings file? 🤔
v
So?
Same as for build scripts
s
get Property returns null? 🤔
v
If it does, it is probably not set
s
OK. Thanks. Give it a try tomorrow
👌 1