Slackbot
12/15/2023, 4:37 PMDjuro Radusinovic
12/15/2023, 6:04 PMVampire
12/17/2023, 10:24 PMafterEvaluate is always bad. It's main effect is, to introduce ordering problems, timing problems, and race conditions. It is discouraged and should be avoided wherever possible.
There are multiple ways to solve your issue, for example replace the two properties on the extension with a function with parameters and do the configuration in that functionDjuro Radusinovic
12/18/2023, 2:23 PMafterEvaluate import auto-imported some garbage, but changing it to the right import (org.gradle.api.Project.afterEvaluate) made it workDjuro Radusinovic
12/18/2023, 2:26 PMinterface MyPluginExtensions {
val getLibraryName: () -> String
val getRemoteUrlName: () -> String
}
Is this what you ment? I can try that but don't see that this would work since then the function won't be available 🤷? 😄?Vampire
12/18/2023, 2:37 PMVampire
12/18/2023, 2:39 PMabstract class MyPluginExtensions {
@get:Inject
internal abstract val project: Project
fun setLibraryName(name: String) {
...
}
fun setRemoteUrlName(remoteUrlName: String) {
...
}
}
for exampleVampire
12/18/2023, 2:39 PM... you do the actual changes, not in the pluginDjuro Radusinovic
12/18/2023, 4:01 PMDjuro Radusinovic
12/18/2023, 4:01 PM