Changeset 4685 for 2013


Ignore:
Timestamp:
2013-07-25 16:35:17 (10 years ago)
Author:
tojukarp
Message:

Updated build scripts

Location:
2013/30
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 2013/30/build_games.py

    r4506 r4685  
    2424personal_dirs = [d for d in os.listdir(".") if isdir(d) and d not in ("lib", basename(output_dir), ".svn")] 
    2525projects_that_did_not_build = [] 
     26users_that_did_not_build = [] 
    2627msbuild = "msbuild" 
    2728 
     
    6667    for d in personal_dirs: 
    6768        path = abspath(d) 
    68         time = datetime(2000, 1, 1) 
     69        time = datetime(2000, 1, 1) 
    6970        if should_write_results and exists(join(path, ".svn")): 
    7071            call("svn update " + path, shell=True) 
    7172            outputs = Popen("svn info " + path, stdout=PIPE).communicate() 
    7273            time = parse_last_changed_date(outputs[0]) 
    73         build_games_in_personal_dir(path, time) 
     74            try: 
     75                build_games_in_personal_dir(path, time) 
     76            except Exception, e: 
     77                print 
     78                print "NOT SUCCESSFUL FOR USER ", d, ": ", e 
     79                users_that_did_not_build.append(d) 
    7480 
    7581 
     
    111117                print "NOTE: There is more than one project file in", root 
    112118 
    113             project_name = splitext(basename(projects[0]))[0] 
    114             author = basename(personal_dir) 
     119            try: 
     120                project_name = splitext(basename(projects[0]))[0] 
     121                author = basename(personal_dir) 
    115122 
    116             success = build(projects[0]) 
     123                success = build(projects[0]) 
    117124 
    118             if should_write_results: 
    119                 write_result(author, project_name, success, last_changed_date) 
     125                if should_write_results: 
     126                    write_result(author, project_name, success, last_changed_date) 
    120127 
    121             if success: 
    122                 dst_dir = join(output_dir, author) 
    123                 copy_game(project_name, root, dst_dir) 
    124                 print author + ": " + project_name 
    125             else: 
     128                if success: 
     129                    dst_dir = join(output_dir, author) 
     130                    copy_game(project_name, root, dst_dir) 
     131                    print author + ": " + project_name 
     132                else: 
     133                    projects_that_did_not_build.append(projects[0]) 
     134            except Exception, e: 
     135                print 
     136                print "PROJECT CAUSED EXCEPTION:", project_name, " :", e 
    126137                projects_that_did_not_build.append(projects[0]) 
    127138 
     
    165176        return 1 
    166177 
     178    print 'Build failed for users (%d):' % len(users_that_did_not_build) 
     179    for p in users_that_did_not_build: 
     180        print p 
     181 
    167182    print 
    168     print 'Projects that did not build (%d):' % len(projects_that_did_not_build) 
     183    print 'Build failed for projects (%d):' % len(projects_that_did_not_build) 
    169184    for p in projects_that_did_not_build: 
    170185        print p 
  • 2013/30/write_report.py

    r4506 r4685  
    9797 
    9898def write_results(): 
     99    results = [] 
     100 
    99101    for d in os.listdir("build"): 
    100102        with open(join("build", d), "r") as f: 
     
    104106            result = lines[2].strip() 
    105107            time_of_update = lines[3].strip() 
    106  
    107108            if hide_pong_games and re.search("pong", name, flags=re.IGNORECASE): 
    108109                continue 
    109110 
    110111            success = (result == "success") 
     112            rtuple = (author, name, result, time_of_update, success) 
     113            results.append(rtuple) 
    111114 
    112             style = "success" 
    113             if not success: 
    114                 style = "fail" 
    115             tr = addElement(table, "tr") 
    116             tr.setAttribute("class", style) 
    117             addTextElement(tr, "td", author) 
    118             addTextElement(tr, "td", name) 
    119             timeElement = addTextElement(tr, "td", time_of_update) 
    120             timeElement.setAttribute("class", "datetime") 
     115    results.sort() 
    121116 
     117    for r in results: 
     118        style = "success" 
     119        if not r[4]: 
     120            style = "fail" 
     121        tr = addElement(table, "tr") 
     122        tr.setAttribute("class", style) 
     123        addTextElement(tr, "td", r[0]) 
     124        addTextElement(tr, "td", r[1]) 
     125        timeElement = addTextElement(tr, "td", r[3]) 
     126        timeElement.setAttribute("class", "datetime") 
    122127 
    123128def write_report(): 
Note: See TracChangeset for help on using the changeset viewer.