ICU-7999 promote version number in api change report

X-SVN-Rev: 28742
This commit is contained in:
Steven R. Loomis 2010-09-30 18:18:07 +00:00
parent 742f501232
commit 3f5a867adf
9 changed files with 395 additions and 7 deletions

3
.gitattributes vendored
View file

@ -575,6 +575,9 @@ tools/release/java/.classpath -text
tools/release/java/.project -text
tools/release/java/Makefile -text
tools/release/java/icu4c.css -text
tools/release/java/src/com/ibm/icu/dev/tools/docs/dumpAllCFunc_xml.xslt -text
tools/release/java/src/com/ibm/icu/dev/tools/docs/dumpAllCppFunc_xml.xslt -text
tools/release/java/src/com/ibm/icu/dev/tools/docs/genreport_xml.xslt -text
tools/trac/IcuCodeTools/icucodetools/__init__.py -text
tools/trac/IcuCodeTools/icucodetools/dcut.py -text
tools/trac/IcuCodeTools/icucodetools/htdocs/css/icuxtn.css -text

3
.gitignore vendored
View file

@ -944,10 +944,11 @@ tools/multi/packages/*.tgz
tools/multi/proj/chello/out
tools/multi/proj/provider/out
tools/multi/tmp
tools/release/java/APIChangeReport.html
tools/release/java/APIChangeReport*
tools/release/java/Makefile.local
tools/release/java/classes
tools/release/java/lib
tools/release/java/src/com/ibm/icu/dev/tools/misc/*.class
tools/trac/IcuCodeTools/*.egg-info
tools/trac/IcuCodeTools/build
tools/trac/IcuCodeTools/icucodetools/*.pyc

View file

@ -54,6 +54,11 @@ $(TARGET): check-vars $(OLD_ICU)/$(XML) $(NEW_ICU)/$(XML)
echo "Remember to run the non-ascii file detector if you get errors."
$(ANT) -Dolddir="$(OLD_ICU)/$(XML)" -Dnewdir="$(NEW_ICU)/$(XML)" $(ANT_TARGET)
# check-vars $(OLD_ICU)/$(XML) $(NEW_ICU)/$(XML)
APIChangeReport.xml:
echo "Remember to run the non-ascii file detector if you get errors."
$(ANT) -Dolddir="$(OLD_ICU)/$(XML)" -Dnewdir="$(NEW_ICU)/$(XML)" $(ANT_TARGET)_xml
%/source/doc/xml: %/source/Doxyfile
# don't care what GENERATE_XML is set to previously - set it to yes.
@echo running doxyugen ..

View file

@ -1,7 +1,7 @@
<!--
/*
*******************************************************************************
* Copyright (C) 2006-2009, International Business Machines Corporation and *
* Copyright (C) 2006-2010, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
* This is the ant build file for ICU tools.
@ -40,11 +40,10 @@
<target name="apireport" depends="tools">
<java classname="com.ibm.icu.dev.tools.docs.StableAPI" fork="yes" failonerror="true">
<!--
<!--
<arg value = "-DELETEME-newver"/>
<arg value = "4.2"/>
<arg value = "4.6"/>
-->
<arg value = "--olddir"/>
<arg value = "${olddir}"/>
@ -70,6 +69,53 @@
<arg value = "--resultfile"/>
<arg value = "${basedir}/APIChangeReport.html"/>
<classpath>
<pathelement location="${build.dir}"/>
<pathelement path="${java.class.path}/"/>
<pathelement location="${lib.dir}/xalan.jar"/>
<pathelement location="${lib.dir}/xercesImpl.jar"/>
<pathelement path="."/>
</classpath>
</java>
</target>
<target name="apireport_xml" depends="tools">
<java classname="com.ibm.icu.dev.tools.docs.StableAPI" fork="yes" failonerror="true">
<!--
<arg value = "-DELETEME-newver"/>
<arg value = "4.4.1"/>
-->
<!--
<arg value = "-DELETEME-newver"/>
<arg value = "4.6"/>
-->
<arg value = "--olddir"/>
<arg value = "${olddir}"/>
<!--
!! Only need these if you must override. Remove the DELETEME
<arg value = "-DELETEME-newver"/>
<arg value = "${newver}"/>
-->
<arg value = "--newdir"/>
<arg value = "${newdir}"/>
<arg value = "--cppxslt"/>
<arg value = "${basedir}/src/com/ibm/icu/dev/tools/docs/dumpAllCppFunc_xml.xslt"/>
<arg value = "--cxslt"/>
<arg value = "${basedir}/src/com/ibm/icu/dev/tools/docs/dumpAllCFunc_xml.xslt"/>
<arg value = "--reportxslt"/>
<arg value = "${basedir}/src/com/ibm/icu/dev/tools/docs/genReport_xml.xslt"/>
<arg value = "--resultfile"/>
<arg value = "${basedir}/APIChangeReport.xml"/>
<classpath>
<pathelement location="${build.dir}"/>
<pathelement path="${java.class.path}/"/>

View file

@ -90,6 +90,8 @@ public class StableAPI {
private File reportXsl;
private File resultFile;
private String milestoneOf = "";
final private static String nul = "None";
public static void main(String[] args) throws TransformerException, ParserConfigurationException, SAXException, IOException, XPathExpressionException {
@ -250,6 +252,16 @@ public class StableAPI {
String initStr = initVal.getNodeValue().trim().replaceAll("\"","");
result = ICU_SPACE_PREFIX+initStr;
System.err.println("Detected "+whichVer + " version: " + result);
if(whichVer.equals("new") && result.startsWith("ICU ")) {
String vers[] = result.substring(4).split("\\.");
int maj = Integer.parseInt(vers[0]);
int min = Integer.parseInt(vers[1]);
if((min%2)==1) {
milestoneOf = " ("+result+")";
result = "ICU "+(maj)+"."+(min+1);
System.err.println(" .. " + milestoneOf + " is a milestone towards " + result);
}
}
}
}
@ -269,12 +281,20 @@ public class StableAPI {
if(!result.equals(prevVer)) {
System.err.println("Note: Detected " + result + " version but we'll use your requested --"+whichVer+"ver "+prevVer);
result = prevVer;
if(!milestoneOf.isEmpty()&&whichVer.equals("new")) {
System.err.println(" .. ignoring milestone indicator " + milestoneOf);
milestoneOf = "";
}
} else {
System.err.println("Note: You don't need to use '--"+whichVer+"ver "+result+"' anymore - we detected it correctly.");
}
} else {
System.err.println("Note: Didn't detect version so we'll use your requested --"+whichVer+"ver "+prevVer);
result = prevVer;
if(!milestoneOf.isEmpty()&&whichVer.equals("new")) {
System.err.println(" .. ignoring milestone indicator " + milestoneOf);
milestoneOf = "";
}
}
}
@ -579,6 +599,7 @@ public class StableAPI {
// report.setParameter("rightStatus", rightStatus);
report.setParameter("ourYear", new Integer(new java.util.GregorianCalendar().get(java.util.Calendar.YEAR)));
report.setParameter("rightVer", rightVer);
report.setParameter("rightMilestone", milestoneOf);
report.setParameter("dateTime", new GregorianCalendar().getTime());
report.setParameter("nul", nul);

View file

@ -0,0 +1,36 @@
<!--
/*
*******************************************************************************
* Copyright (C) 2009-2010, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
* This is an XSLT build file for ICU tools.
*/
-->
<!--
List all C functions generated from the 'index.xml'
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="docFolder" />
<xsl:template match="/">
<list>
<xsl:variable name="files_node" select="/doxygenindex/compound[@kind='file']/@refid" />
<xsl:for-each select="$files_node">
<xsl:variable name="file" select="concat($docFolder, '/', . , '.xml')" />
<xsl:variable name="funcs_node" select="document($file)/doxygen/compounddef/sectiondef/memberdef[@prot='public'][@kind='function']" />
<xsl:for-each select="$funcs_node">
<cppfunc>
<xsl:copy-of select="@id" />
<xsl:attribute name="status"><xsl:value-of select="detaileddescription/para/xrefsect/xreftitle/text()"/></xsl:attribute>
<xsl:attribute name="version"><xsl:value-of select="detaileddescription/para/xrefsect/xrefdescription/para/text()"/></xsl:attribute>
<xsl:attribute name="prototype"><xsl:value-of select="concat(definition/text(), argsstring/text())" /></xsl:attribute>
<xsl:copy-of select="location/@file" />
</cppfunc>
</xsl:for-each>
</xsl:for-each>
</list>
</xsl:template>
</xsl:stylesheet>

View file

@ -0,0 +1,36 @@
<!--
/*
*******************************************************************************
* Copyright (C) 2009-2010, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
* This is an XSLT file.
*/
-->
<!--
List all cpp public functions generated from the 'index.xml'
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="docFolder" />
<xsl:template match="/">
<list>
<xsl:variable name="files_node" select="/doxygenindex/compound[@kind='class']/@refid" />
<xsl:for-each select="$files_node">
<xsl:variable name="file" select="concat($docFolder, '/', . , '.xml')" />
<xsl:variable name="funcs_node" select="document($file)/doxygen/compounddef/sectiondef/memberdef[@prot='public'][@kind='function']" />
<xsl:for-each select="$funcs_node">
<cppfunc>
<xsl:copy-of select="@id" />
<xsl:attribute name="status"><xsl:value-of select="detaileddescription/para/xrefsect/xreftitle/text()"/></xsl:attribute>
<xsl:attribute name="version"><xsl:value-of select="detaileddescription/para/xrefsect/xrefdescription/para/text()"/></xsl:attribute>
<xsl:attribute name="prototype"><xsl:value-of select="concat(definition/text(), argsstring/text())" /></xsl:attribute>
<xsl:copy-of select="location/@file" />
</cppfunc>
</xsl:for-each>
</xsl:for-each>
</list>
</xsl:template>
</xsl:stylesheet>

View file

@ -15,6 +15,7 @@
<xsl:param name="leftVer" />
<xsl:param name="rightVer" />
<xsl:param name="dateTime" />
<xsl:param name="rightMilestone" />
<xsl:param name="nul" />
<xsl:param name="ourYear" />
@ -26,7 +27,7 @@
</xsl:comment>
<html>
<head>
<title>ICU4C API Comparison: <xsl:value-of select="$leftVer"/> with <xsl:value-of select="$rightVer" /> </title>
<title>ICU4C API Comparison: <xsl:value-of select="$leftVer"/> with <xsl:value-of select="$rightVer" /><xsl:value-of select="$rightMilestone" /> </title>
<link rel="stylesheet" href="icu4c.css" type="text/css" />
</head>
@ -34,7 +35,7 @@
<a name="_top"></a>
<h1>ICU4C API Comparison: <xsl:value-of select="$leftVer"/> with <xsl:value-of select="$rightVer" /> </h1>
<h1>ICU4C API Comparison: <xsl:value-of select="$leftVer"/> with <xsl:value-of select="$rightVer" /><xsl:value-of select="$rightMilestone" /> </h1>
<ul>
<li><a href="#removed">Removed from <xsl:value-of select="$leftVer"/></a></li>
<li><a href="#deprecated">Deprecated or Obsoleted in <xsl:value-of select="$rightVer" /></a></li>

View file

@ -0,0 +1,239 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
*******************************************************************************
* Copyright (C) 2008-2010, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
* This is the XSLT for the API Report, XML style
*/
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
<xsl:param name="leftStatus" />
<xsl:param name="rightStatus" />
-->
<xsl:param name="leftVer" />
<xsl:param name="rightVer" />
<xsl:param name="dateTime" />
<xsl:param name="nul" />
<xsl:param name="ourYear" />
<xsl:template match="/">
<xsl:comment>
Copyright (C) <xsl:value-of select="$ourYear" />, International Business Machines Corporation, All Rights Reserved.
</xsl:comment>
<changeReport>
<identity>
<xsl:attribute name="left">
<xsl:value-of select="$leftVer"/>
</xsl:attribute>
<xsl:attribute name="right">
<xsl:value-of select="$rightVer" />
</xsl:attribute>
<xsl:attribute name="generated-date">
<xsl:value-of select="$dateTime" />
</xsl:attribute>
</identity>
<!-- <link rel="stylesheet" href="icu4c.css" type="text/css" /> -->
<functions name="removed">
<xsl:call-template name="genTable">
<xsl:with-param name="nodes" select="/list/func[@rightStatus=$nul]"/>
</xsl:call-template>
</functions>
<functions name="deprecated">
<xsl:call-template name="genTable">
<xsl:with-param name="nodes" select="/list/func[(@rightStatus='Deprecated' and @leftStatus!='Deprecated') or (@rightStatus='Obsolete' and @leftStatus!='Obsolete')]"/>
</xsl:call-template>
</functions>
<functions name="changed">
<xsl:call-template name="genTable">
<xsl:with-param name="nodes" select="/list/func[(@leftStatus != $nul) and (@rightStatus != $nul) and ( (@leftStatus != @rightStatus) or (@leftVersion != @rightVersion) )]"/>
</xsl:call-template>
</functions>
<functions name="promoted">
<xsl:call-template name="genTable">
<xsl:with-param name="nodes" select="/list/func[@leftStatus != 'Stable' and @rightStatus = 'Stable']"/>
</xsl:call-template>
</functions>
<functions name="added">
<xsl:call-template name="genTable">
<xsl:with-param name="nodes" select="/list/func[@leftStatus=$nul]"/>
</xsl:call-template>
</functions>
<functions name="draft">
<xsl:call-template name="infoTable">
<xsl:with-param name="nodes" select="/list/func[@rightStatus = 'Draft' and @rightVersion != $rightVer]"/>
</xsl:call-template>
</functions>
</changeReport>
</xsl:template>
<xsl:template name="genTable">
<xsl:param name="nodes" />
<table class='genTable' BORDER="1">
<THEAD>
<tr>
<th> <xsl:value-of select="'File'" /> </th>
<th> <xsl:value-of select="'API'" /> </th>
<th> <xsl:value-of select="$leftVer" /> </th>
<th> <xsl:value-of select="$rightVer" /> </th>
</tr>
</THEAD>
<xsl:for-each select="$nodes">
<xsl:sort select="@file" />
<tr>
<xsl:attribute name="class">
<xsl:value-of select="'row'"/>
<xsl:value-of select="(position() mod 2)"/>
<!--
<xsl:choose>
<xsl:when test="(position() mod 2) = 0"><xsl:value-of select="row0" /></xsl:when>
<xsl:otherwise><xsl:value-of select="row1" /></xsl:otherwise>
</xsl:choose>
-->
</xsl:attribute>
<td class='file'> <xsl:value-of select="@file" /> </td>
<td class='proto'> <xsl:value-of select="@prototype" /> </td>
<td>
<xsl:attribute name="class">
<xsl:if test ="@leftStatus = 'Stable'">
<xsl:value-of select="'stabchange'" />
</xsl:if>
</xsl:attribute>
<xsl:if test = "@leftStatus = 'Draft' and @rightStatus = 'Stable' and @leftVersion = @rightVersion">
<xsl:attribute name="colspan">
2
</xsl:attribute>
<xsl:attribute name="align">
center
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@leftStatus" /><xsl:if test = "@leftStatus = 'Draft' and @rightStatus = 'Stable' and @leftVersion = @rightVersion">&gt;Stable</xsl:if>
<br/> <xsl:value-of select="@leftVersion" />
</td>
<xsl:if test = "@leftStatus != 'Draft' or @rightStatus != 'Stable' or @leftVersion != @rightVersion">
<td> <xsl:value-of select="@rightStatus" />
<br/>
<span>
<xsl:attribute name="class">
<xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != ''">
<xsl:value-of select="'verchange'" />
</xsl:if>
</xsl:attribute>
<span>
<xsl:value-of select="@rightVersion" />
</span>
<xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != '' and @rightStatus = 'Stable'">
<br/><b title='A stable API changed version.' class='bigwarn'>(changed)</b>
</xsl:if>
<xsl:if test ="@rightStatus = 'Draft' and @rightVersion != $rightVer">
<br/><b title='A draft API has the wrong version.' class='bigwarn'>(should be <xsl:value-of select="$rightVer"/>)</b>
</xsl:if>
<xsl:if test="@leftStatus = 'None' and @rightVersion = ''">
<br/><b title='A new API was introduced that was not tagged.' class='bigwarn'>(untagged)</b>
</xsl:if>
</span>
</td>
</xsl:if>
</tr>
</xsl:for-each>
</table>
</xsl:template>
<xsl:template name="infoTable">
<xsl:param name="nodes" />
<table class='genTable' BORDER="1">
<THEAD>
<tr>
<th> <xsl:value-of select="'File'" /> </th>
<th> <xsl:value-of select="'API'" /> </th>
<th> <xsl:value-of select="$leftVer" /> </th>
<th> <xsl:value-of select="$rightVer" /> </th>
</tr>
</THEAD>
<xsl:for-each select="$nodes">
<xsl:sort select="@file" />
<tr>
<xsl:attribute name="class">
<xsl:value-of select="'row'"/>
<xsl:value-of select="(position() mod 2)"/>
<!--
<xsl:choose>
<xsl:when test="(position() mod 2) = 0"><xsl:value-of select="row0" /></xsl:when>
<xsl:otherwise><xsl:value-of select="row1" /></xsl:otherwise>
</xsl:choose>
-->
</xsl:attribute>
<td class='file'> <xsl:value-of select="@file" /> </td>
<td class='proto'> <xsl:value-of select="@prototype" /> </td>
<td>
<xsl:attribute name="class">
<xsl:if test ="@leftStatus = 'Stable'">
<xsl:value-of select="'stabchange'" />
</xsl:if>
</xsl:attribute>
<xsl:if test = "@leftStatus = @rightStatus and @leftVersion = @rightVersion">
<xsl:attribute name="colspan">
2
</xsl:attribute>
<xsl:attribute name="align">
center
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@leftStatus" />
<br/> <xsl:value-of select="@leftVersion" />
</td>
<xsl:if test = "@leftStatus != @rightStatus or @leftVersion != @rightVersion">
<td> <xsl:value-of select="@rightStatus" />
<br/>
<span>
<xsl:attribute name="class">
<xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != ''">
<xsl:value-of select="'verchange'" />
</xsl:if>
</xsl:attribute>
<span>
<xsl:value-of select="@rightVersion" />
</span>
<!--
<xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != '' and @rightStatus = 'Stable'">
<br/><b title='A stable API changed version.' class='bigwarn'>(changed)</b>
</xsl:if>
<xsl:if test ="@rightStatus = 'Draft' and @rightVersion != $rightVer">
<br/><b title='A draft API has the wrong version.' class='bigwarn'>(should be <xsl:value-of select="$rightVer"/>)</b>
</xsl:if>
<xsl:if test="@leftStatus = 'None' and @rightVersion = ''">
<br/><b title='A new API was introduced that was not tagged.' class='bigwarn'>(untagged)</b>
</xsl:if>
-->
</span>
</td>
</xsl:if>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>