Slackbot
06/28/2022, 8:18 AMJendrik Johannes
06/28/2022, 10:07 AMaddProvider()
instead of add()
can help you. Then you can determine the version lazily (i.e. late) in the configuration phase.
@melix wrote a detailed post about this topic:
https://melix.github.io/blog/2022/03/gradle-conditional-dependencies.htmlMichaĆ Klimczak
06/28/2022, 11:14 AMaddProvider
/
add("kspCommonMainMetadata", provider { "com.example:${version}" })
etc, but I don't think that's the problem. When this gradle plugin is used in a project, things like version
, project.ersion
/ rootProject.version
don't apply to the plugin, but rather to the project that applies it. Is there anything that holds the plugin version?MichaĆ Klimczak
06/28/2022, 12:14 PMJendrik Johannes
06/28/2022, 12:58 PMMichaĆ Klimczak
06/28/2022, 1:01 PMJendrik Johannes
06/28/2022, 1:06 PMafterEvaluate
because it is just more straight forward to use for some cases.