public boolean inputFileTreeChanged()

in src/main/java/org/apache/maven/shared/incremental/IncrementalBuildHelper.java [220:254]


    public boolean inputFileTreeChanged( DirectoryScanner dirScanner )
        throws MojoExecutionException
    {
        File mojoConfigFile = new File( getMojoStatusDirectory(), INPUT_FILES_LST_FILENAME );

        String[] oldInputFiles = new String[0];

        if ( mojoConfigFile.exists() )
        {
            try
            {
                oldInputFiles = FileUtils.fileReadArray( mojoConfigFile );
            }
            catch ( IOException e )
            {
                throw new MojoExecutionException( "Error reading old mojo status " + mojoConfigFile, e );
            }
        }

        dirScanner.scan();

        try
        {
            // store away the list of input files
            FileUtils.fileWriteArray( mojoConfigFile, dirScanner.getIncludedFiles() );
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException( "Error while storing new mojo status" + mojoConfigFile, e );
        }

        DirectoryScanResult dsr = dirScanner.diffIncludedFiles( oldInputFiles );

        return ( dsr.getFilesAdded().length > 0 || dsr.getFilesRemoved().length > 0 );
    }