Is there any callback in kotlin gradle plugin that I can hook into to get the multiplatform targets a project defines?
Context: in a plugin I need to register some tasks, one per target. so, I'm querying the targets like this when applying the plugin:
project.extensions.getByType(KotlinMultiplatformExtension::class.java).targets
but the problem is only common/metadata target is available at this point and other targets are populated later on. I can get targets I want if I queried the targets in
afterEvaluate{ ... }
but I know that this a bad solution, so I'm asking if there is a better way. for example, Android gradle plugin provide something similar with
onVariants{ ... }
callback that one can hook into and read variants available for that android project.