更新时间:2022-06-12 22:59:11
仍然令人困惑的是,该过滤器不适用于module-info.java,但是从编译器插件的来源看,我想这就是这样的方式:
Still it's intersting that filter doesn't work for module-info.java, but looking the source of compiler plugin I guess that's just the way it is:
protected void preparePaths( Set<File> sourceFiles )
{
//assert compilePath != null;
File moduleDescriptorPath = null;
boolean hasModuleDescriptor = false;
for ( File sourceFile : sourceFiles )
{
if ( "module-info.java".equals( sourceFile.getName() ) )
{
moduleDescriptorPath = sourceFile;
hasModuleDescriptor = true;
break;
}
}