HHH-13071 Use SourceSetOutput.getClassesDirs to prevent deprecation warnings during build when using the gradle plugin

This commit is contained in:
Henning Rohlfs 2018-11-01 12:46:12 +01:00 committed by Guillaume Smet
parent 71af989f60
commit aa441ddb12
1 changed files with 14 additions and 12 deletions

View File

@ -122,13 +122,14 @@ public class HibernatePlugin implements Plugin<Project> {
final Enhancer enhancer = Environment.getBytecodeProvider().getEnhancer( enhancementContext );
final FileTree fileTree = project.fileTree( sourceSet.getOutput().getClassesDir() );
for ( File classesDir: sourceSet.getOutput().getClassesDirs() ) {
final FileTree fileTree = project.fileTree( classesDir );
for ( File file : fileTree ) {
if ( !file.getName().endsWith( ".class" ) ) {
continue;
}
final byte[] enhancedBytecode = doEnhancement( sourceSet.getOutput().getClassesDir(), file, enhancer );
final byte[] enhancedBytecode = doEnhancement( classesDir, file, enhancer );
if ( enhancedBytecode != null ) {
writeOutEnhancedClass( enhancedBytecode, file );
logger.info( "Successfully enhanced class [" + file + "]" );
@ -139,6 +140,7 @@ public class HibernatePlugin implements Plugin<Project> {
}
}
}
}
);
}
}