I'm working on developing a gradle plugin for Android Studio.Here is my problem How can I get Android Studio main SourceSet with Gradle API?
I want to do some copy stuff with java source directory. Before asking this question, I found something useful but not work.
SourceSet main = project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME)
I get this error message
Caused by: org.gradle.api.UnknownDomainObjectException: SourceSet with name 'main' not found.