}
private void checkForChangesEvery( long ms ) throws FileNotFoundException,
CoffeeScriptCompileException, IOException
{
FileSetChangeMonitor hamlFiles = new FileSetChangeMonitor(
hamlSourceDir, HAML_PATTERN );
FileSetChangeMonitor coffeeFiles = new FileSetChangeMonitor(
coffeeSourceDir, COFFEE_PATTERN );
FileSetChangeMonitor resourceFiles = new FileSetChangeMonitor(
resourceSourceDir, ANY_PATTERN );
try
{
while ( true )
{
Thread.sleep( ms );
for ( String file : hamlFiles.getModifiedFilesSinceLastTimeIAsked() )
{
try {
compileHamlFile( file);
System.out.println("[" + file + "]: Compiled");
} catch(Exception e) {
getLog().error( "[" + file + "]: " + e.getMessage() );
}
}
for ( String file : coffeeFiles.getModifiedFilesSinceLastTimeIAsked() )
{
try
{
compileCoffeescriptFile( file );
System.out.println("[" + file + "]: Compiled");
}
catch ( Exception e )
{
getLog().error( "[" + file + "]: " + e.getMessage() );
}
}
for ( String file : resourceFiles.getModifiedFilesSinceLastTimeIAsked() )
{
try
{
File source = new File(resourceSourceDir, file);
File target = new File(resourceOutputDir, file);