This message was deleted.
# community-support
s
This message was deleted.
d
Any idea why this isnt working anyone and how i could make it work?
v
afterEvaluate
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 function
d
Update: It works now, the
afterEvaluate
import auto-imported some garbage, but changing it to the right import (
org.gradle.api.Project.afterEvaluate
) made it work
But, better if I can make it follow the best standards, so you just say to use functions
Copy code
interface 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 🤷? 😄?
v
No, that's not what I meant
Copy code
abstract class MyPluginExtensions {
   @get:Inject
   internal abstract val project: Project

   fun setLibraryName(name: String) {
      ...
   }

   fun setRemoteUrlName(remoteUrlName: String) {
      ...
   }
}
for example
At the
...
you do the actual changes, not in the plugin
d
Okay, let me investigate about this tmrw
thank you 🧛 !
👌 1