This message was deleted.
# plugin-development
s
This message was deleted.
d
Short example to reproduce
Copy code
abstract class MyService
@Inject
constructor(objectFactory: ObjectFactory) : BuildService<BuildServiceParameters.None> {
    private val dep: MyDependency = objectFactory.newInstance(MyDependency::class.java)

    @get:Inject abstract val fileSystemOperations: FileSystemOperations

    fun func() {
        println(fileSystemOperations) // This works
        dep.func() // But this does not
    }
}

abstract class MyDependency {
    @get:Inject abstract val fileSystemOperations: FileSystemOperations

    fun func() {
        println(fileSystemOperations)
    }
}
c
why don't you inject it by constructor to MyDependency?
❤️ 1
c
Pass an instance of MyDependency (instantiated however you’d like) in as a parameter to the build service. e.g.
Copy code
interface GoLangToolchainParams : BuildServiceParameters {
        val cacheService: Property<CacheBuildService>
    }
❤️ 1
(kotlin)
d
normal class is my fall-back, I'm just curious on if it actually possible 🙂 Really mostly just to keep the amount of code down by switching the tasks to use the same logic