void BuildAsset ( AssetProcessor processor, string[] args, AssetSource assetFile, ref BuildResult buildResult )
{
try {
// Is up-to-date?
if (!context.Options.ForceRebuild) {
if (!Wildcard.Match(assetFile.KeyPath, context.Options.CleanPattern, true)) {
if (assetFile.IsUpToDate) {
buildResult.UpToDate ++;
return;
}
}
}
var keyPath = assetFile.KeyPath;
if (keyPath.Length > 40) {
keyPath = "..." + keyPath.Substring( keyPath.Length - 40 + 3 );
}
Log.Message("{0,-40} {1,-5} {3}", keyPath, Path.GetExtension(keyPath), string.Join(" ", args), assetFile.Hash );
// Apply attribute :
var parser = new CommandLineParser( processor );
parser.Configuration.OptionLeadingChar = '/';
parser.Configuration.ThrowExceptionOnShowError = true;
parser.ParseCommandLine( args );
//
// Build :
//
processor.Process( assetFile, context );
buildResult.Succeded ++;
} catch ( Exception e ) {
Log.Error( "{0} : {1}", assetFile.KeyPath, e.Message );
buildResult.Failed ++;
}
}