问题
Like many others I am trying to convert a Maven project to gradle and am having problems with aspects. I have tried using gradle-aspectj - https://github.com/eveoh/gradle-aspectj - and right out of the box it weaves main and test sources. But I am trying to run IntegrationTests as a separate SourceSet.
The code for gradle-aspectj at https://github.com/eveoh/gradle-aspectj/blob/master/src/main/groovy/aspectj/AspectJPlugin.groovy loops over the project.sourceSets
so why doesn't it pick up the one for integration tests?
I have seen that most users use antTasks-iajc
to define other SourceSets. This isn't trivial (see Integration test + aspectJ + gradle). The gradle-aspectj plugin is fairly painless to setup and configure - couldn't the addition of other sourceSets be incorporated into gradle-aspectj?
来源:https://stackoverflow.com/questions/38680678/why-gradle-aspectj-doesnt-pick-up-integrationtest-sourceset