Is it possible to add programmatically a custom plugin configuration to a Project object created by ProjectBuilder?

I would like to test some logic in my plugin and therefor I need to pass some configuration to a project created with ProjectBuilder (to simulate a configuration closure normally crated in a build.gradle file - to be used after apply(plugin: MyPlugin). Is it possible?

Marcin

Hey Marcin,

Did you try and it didn’t work? The ProjectBuilder creates stub instances of Gradle’s project for the purpose of unit testing. Those instances support typical configuration stuff. E.g. you can add configurations, properties, apply plugins, etc.

Cheers!