Show
Ignore:
Timestamp:
10/20/08 15:07:32 (3 months ago)
Author:
mtld
Message:

Let generate target fail with BuildException? if TargetGeneratorReport? contains errors

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/stable-2008-03-12/pfixcore/ChangeLog

    r3776 r3921  
     12008-10-20  Martin Leidig  <mleidig@schlund.de> 
     2 
     3        Let generate target fail with BuildException if TargetGeneratorReport 
     4        contains errors. 
     5 
     6        * src/de/schlund/pfixcore/util/TargetGeneratorTask.java: throw 
     7        BuildException if TargetGenerator reported errors 
     8        * src/de/schlund/pfixxml/targets/TargetGenerator.java: added 
     9        method to check if TargetGenerator errors occurred 
     10        * src/de/schlund/pfixxml/targets/TargetGenerationReport.java: added 
     11        method to check if TargetGenerator errors were reported 
     12 
    1132008-08-05  Martin Leidig  <mleidig@schlund.de> 
    214 
  • branches/stable-2008-03-12/pfixcore/src/de/schlund/pfixcore/util/TargetGeneratorTask.java

    r2825 r3921  
    9292            } finally { 
    9393                log(TargetGenerator.getReportAsString(), Project.MSG_INFO); 
     94                if(TargetGenerator.errorsReported()) throw new BuildException("TargetGenerator reported errors."); 
    9495            } 
    9596        } else { 
  • branches/stable-2008-03-12/pfixcore/src/de/schlund/pfixxml/targets/TargetGenerationReport.java

    r3367 r3921  
    2424 
    2525public class TargetGenerationReport { 
     26     
    2627    private final HashMap<String, ArrayList<Exception>> hash; 
    27  
     28    private boolean hasError; 
     29     
    2830    public TargetGenerationReport() { 
    2931        this.hash = new HashMap<String, ArrayList<Exception>>(); 
     
    3537            list.add(e); 
    3638            hash.put(project, list); 
     39            hasError = true; 
    3740        } else { 
    3841            hash.get(project).add(e); 
    3942        } 
     43    } 
     44     
     45    public boolean hasError() { 
     46        return hasError; 
    4047    } 
    4148  
  • branches/stable-2008-03-12/pfixcore/src/de/schlund/pfixxml/targets/TargetGenerator.java

    r3418 r3921  
    852852        return report.toString(); 
    853853    } 
     854     
     855    public static boolean errorsReported() { 
     856        return report.hasError(); 
     857    } 
    854858 
    855859    public static void resetGenerationReport() {