diff -r 044383f39525 -r be27ed110b50 buildframework/helium/tools/relnotes/relnotes.ant.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/buildframework/helium/tools/relnotes/relnotes.ant.xml Wed Oct 28 14:39:48 2009 +0000 @@ -0,0 +1,339 @@ + + + + + Generates a release note by modifying a template (that you can edit yourself) with + values from the build and Synergy. + + * Modifies a RTF template with values from build + * Adds table of errors and warnings + * Generates list of baselines, projects and tasks used + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +import ant +import rtfutils +rn = rtfutils.RTFUtils(ant.get_property(r'${releasenotes.output}')) +rn.rtftable(ant.get_property(r'${temp.build.dir}/variant_@{product.name}.csv'), ant.get_property(r'${releasenotes.temp.output}'), ant.get_property(r'Type@{product.name}VariantTableHere')) + + + + + + + + + + + + + + + + +import ant +import rtfutils +rn = rtfutils.RTFUtils(ant.get_property(r'${releasenotes.output}')) +rn.rtftable(ant.get_property(r'${releasenotes.temp.errors}'), ant.get_property(r'${releasenotes.temp.output}'), 'TypeErrorTableSummaryHere') + + + + + + + + +import ant +import rtfutils +rn = rtfutils.RTFUtils(ant.get_property(r'${releasenotes.output}')) +rn.rtfimage(ant.get_property(r'${releasenotes.logo}'), ant.get_property(r'${releasenotes.temp.output}'), 'AddProductImageHere') + + + + + + + + + +import nokia.nokiaccm +import traceback +import ant +import logging +logging.disable(logging.INFO) +session = None +try: + database = ant.get_property(r'${ccm.database}') + username = ant.get_property(r'${ccm.user.login}') + password = ant.get_property(r'${ccm.user.password}') + engine = ant.get_property(r'${ccm.engine.host}') + dbpath = ant.get_property(r'${ccm.database.path}') + if database != None: + session = nokia.nokiaccm.open_session(username, password, database=database) + else: + session = nokia.nokiaccm.open_session(username, password, engine, dbpath) + + cmproject = session.create(ant.get_property(r'${ccm.toplevel.project}')) + print cmproject.baseline + session.close() +except Exception, ex: + print 'Caught exception: ' + str(ex) + traceback.print_exc() + + + + + + +import amara +import ant + +bomfile = open(r"${build.log.dir}/${build.id}_BOM.xml") +bom = amara.parse(bomfile) + +for p in bom.bom.content.project: + if (str(p.name).startswith(ant.get_property(r'${project.startswith}'))): + print str(p.name) +bomfile.close() + + + + + + + + + +import amara +import nokia.nokiaccm +import ant + +class BOMToFile(object): + """ + Read BOM and output in text + """ + def __init__(self, session, project_name, project, output_dir): + self.project_name = project_name + self.project = project + self.output_dir = output_dir + self.session = session + + def writeprojects(self): + fileout = file(self.output_dir + '/' + self.project_name + '_projects.txt', 'w') + + i = 1 + for project in self.project.baseline: + fileout.write(str(i) + ") " + str(project) + "\n") + + i += 1 + fileout.close() + + def writebaselines(self): + fileout = file(self.output_dir + '/' + self.project_name + '_baselines.txt', 'w') + + i = 1 + for project in self.project.baseline: + fileout.write(str(i) + ") " + str(project) + "\n") + + cmproject = self.session.create(str(project)) + + try: + baseline = str(cmproject.baseline).strip() + if baseline == "None": + fileout.write(str(i) + ") " + str(project) + "\n") + else: + fileout.write(str(i) + ") " + baseline + "\n") + i += 1 + except Exception, ex: + print ex + fileout.close() + + def writetasks(self): + if self.project.xml_properties.has_key("task"): + fileout = file(self.output_dir + '/' + self.project_name + '_tasks.txt', 'w') + + i = 1 + for task in self.project.task: + fileout.write(str(i) + ") Task " + str(task) + "\n") + i += 1 + fileout.close() + +bomfile = open(r"${build.log.dir}/${build.id}_BOM.xml") +bom = amara.parse(bomfile) +database = ant.get_property(r'${ccm.database}') +username = ant.get_property(r'${ccm.user.login}') +password = ant.get_property(r'${ccm.user.password}') +engine = ant.get_property(r'${ccm.engine.host}') +dbpath = ant.get_property(r'${ccm.database.path}') +if database != None: + session = nokia.nokiaccm.open_session(username, password, database=database) +else: + session = nokia.nokiaccm.open_session(username, password, engine, dbpath) + +for p in bom.bom.content.project: + if p.name == ant.get_property(r'${ccm.toplevel.project}'): + btof = BOMToFile(session, 'MC', p, ant.get_property(r'${releasenotes.output.dir}')) + + btof.writeprojects() + btof.writebaselines() + + btof.writetasks() + + if (str(p.name).startswith('IBUSAL')): + btof = BOMToFile(session, 'IBUSAL', p, ant.get_property(r'${releasenotes.output.dir}')) + + btof.writeprojects() + + btof.writetasks() + +session.close() +bomfile.close() + + + + + + + + + + + + + + + + +import ccm +#check for ccm session leaks +assert (len(ccm.running_sessions()) == 0) + + + + + + + + + + + + + + +import ant +import rtfutils +rn = rtfutils.RTFUtils(ant.get_property(r'${releasenotes.output}')) +rn.rtfconvert(ant.get_property(r'${releasenotes.temp.props}'), ant.get_property(r'${releasenotes.temp.props2}')) + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file