private boolean scanAndGenerateAsync( File sourceRoot, JavaDocBuilder builder )
        throws Exception
    {
        Scanner scanner = buildContext.newScanner( sourceRoot );
        scanner.setIncludes( new String[] { servicePattern } );
        scanner.scan();
        String[] sources = scanner.getIncludedFiles();
        if ( sources.length == 0 )
        {
            return false;
        }
        boolean fileGenerated = false;
        for ( String source : sources )
        {
            File sourceFile = new File( sourceRoot, source );
            File targetFile = getTargetFile( source );
            if ( !force && buildContext.isUptodate( targetFile, sourceFile ) )
            {
                getLog().debug( targetFile.getAbsolutePath() + " is up to date. Generation skipped" );
                // up to date, but still need to report generated-sources directory as sourceRoot
                fileGenerated = true;
                continue;
            }

            String className = getTopLevelClassName( source );
            JavaClass clazz = builder.getClassByName( className );
            if ( isEligibleForGeneration( clazz ) )
            {
                getLog().debug( "Generating async interface for service " + className );
                targetFile.getParentFile().mkdirs();
                generateAsync( clazz, targetFile );
                fileGenerated = true;
            }
        }
        return fileGenerated;
    }
private boolean scanAndGenerateAsync ( File sourceRoot , JavaDocBuilder builder ) throws Exception { Scanner scanner = buildContext . newScanner ( sourceRoot ) ; scanner . setIncludes ( new String [ ] { servicePattern } ) ; scanner . scan ( ) ; String [ ] sources = scanner . getIncludedFiles ( ) ; if ( sources . length == 0 ) { return false ; } boolean fileGenerated = false ; for ( String source : sources ) { File sourceFile = new File ( sourceRoot , source ) ; File targetFile = getTargetFile ( source ) ; if ( ! force && buildContext . isUptodate ( targetFile , sourceFile ) ) { getLog ( ) . debug ( targetFile . getAbsolutePath ( ) + " is up to date. Generation skipped" ) ; fileGenerated = true ; continue ; } String className = getTopLevelClassName ( source ) ; JavaClass clazz = builder . getClassByName ( className ) ; if ( isEligibleForGeneration ( clazz ) ) { getLog ( ) . debug ( "Generating async interface for service " + className ) ; targetFile . getParentFile ( ) . mkdirs ( ) ; generateAsync ( clazz , targetFile ) ; fileGenerated = true ; } } return fileGenerated ; }
@param sourceRoot the base directory to scan for RPC services
@return true if some file have been generated
@throws Exception generation failure