}
}
// test resource files
if( proceed ) {
RootBuildResource rbr = new RootBuildResource();
String[] generatedFiles = meta.getList( Property.jostraca_GeneratedFiles, Standard.COMMA );
int numGF = generatedFiles.length;
// this assumes that we actually want to generate files, not just compile the template
// however, the CodeBuilder should ensure that no unnecessary compilation is done in any case
// this logic will probably cause unnecessary reparsing of the template, but it's good to err
// on the side of regenerating to avoid false negatives
if( 0 == numGF ) {
iUserMessageHandler.debug( "Not uptodate:", "no files generated previously." );
uptodate = false;
}
// there were previously generated files, so we can test the resources against them for uptodateness
else {
String[] tm_resourceFiles = meta.getList( Property.jostraca_FileBuildResources, Standard.COMMA );
int num_tmRF = tm_resourceFiles.length;
File[] cmd_resourceFiles = parseResourceFiles( tmps.get( Property.main_CodeWriterOptions ),
tmps.get( Property.main_WorkFolder ) );
int num_cmdRF = cmd_resourceFiles.length;
// check against template
for( int gfI = 0; gfI < numGF; gfI++ ) {
FileBuildResource fbr = new FileBuildResource( new File( tp.getTemplatePath() ),
new File( generatedFiles[gfI] ) );
rbr.add( fbr );
}
// check against template resources
for( int rfI = 0; rfI < num_tmRF; rfI++ ) {
for( int gfI = 0; gfI < numGF; gfI++ ) {
FileBuildResource fbr = new FileBuildResource( new File( tm_resourceFiles[rfI] ),
new File( generatedFiles[gfI] ) );
rbr.add( fbr );
}
}
// check against cmd resources
for( int rfI = 0; rfI < num_cmdRF; rfI++ ) {
for( int gfI = 0; gfI < numGF; gfI++ ) {
FileBuildResource fbr = new FileBuildResource( cmd_resourceFiles[rfI],
new File( generatedFiles[gfI] ) );
rbr.add( fbr );
}
}
uptodate = rbr.uptodate();
proceed = false;
if( uptodate ) {
iUserMessageHandler.debug( "Uptodate:", rbr.toString() );
}
else {
iUserMessageHandler.debug( "Not uptodate:", rbr.toString() );
}
}
}
}