[Htmlparser-cvs] htmlparser cvs2cl.pl,NONE,1.1 build.xml,1.28,1.29
Brought to you by:
derrickoswald
From: <der...@us...> - 2003-05-18 09:41:55
|
Update of /cvsroot/htmlparser/htmlparser In directory sc8-pr-cvs1:/tmp/cvs-serv23601/htmlparser Modified Files: build.xml Added Files: cvs2cl.pl Log Message: Provide for automatic changelog generation. A changeLog target was added to the build.xml file. The static version stuff in Parser was reworked to allow picking out the previous integration date. The getVersion() method was made static. The getVersionNumber() method was added to clean up some uglies. --- NEW FILE: cvs2cl.pl --- #!/bin/sh exec perl -w -x $0 ${1+"$@"} # -*- mode: perl; perl-indent-level: 2; -*- #!perl -w ############################################################## ### ### ### cvs2cl.pl: produce ChangeLog(s) from `cvs log` output. ### ### ### ############################################################## ## $Revision: 1.1 $ ## $Date: 2003/05/18 09:41:51 $ ## $Author: derrickoswald $ ## ## (C) 2001,2002,2003 Martyn J. Pearce <fl...@cp...>, under the GNU GPL. ## (C) 1999 Karl Fogel <kf...@re...>, under the GNU GPL. ## ## (Extensively hacked on by Melissa O'Neill <on...@cs...>.) [...2298 lines suppressed...] Anyway, rather than fix this in Text::Wrap, we might as well write a new wrap() which has the following much-needed features: * initial indentation, like current Text::Wrap() * subsequent line indentation, like current Text::Wrap() * user chooses among: force-break long words, leave them alone, or die()? * preserve existing indentation: chopped chunks from an indented line are indented by same (like this line, not counting the asterisk!) * optional list of things to preserve on line starts, default ">" Note that the last two are essentially the same concept, so unify in implementation and give a good interface to controlling them. And how about: Optionally, when encounter a line pre-indented by same as previous line, then strip the newline and refill, but indent by the same. Yeah... Index: build.xml =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/build.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** build.xml 21 Apr 2003 14:17:54 -0000 1.28 --- build.xml 18 May 2003 09:41:50 -0000 1.29 *************** *** 2,11 **** <!-- set global properties for this build --> <property name="src" value="src"/> <property name="build" value="build"/> - <property name="versionString" value="1_3"/> <property name="docs" value="docs"/> <property name="resources" value="resources"/> ! <property name="dist" value="release/htmlparser${versionString}"/> <property name="releaseDir" value="release"/> <property name="finalLoc" value="distribution"/> --- 2,19 ---- <!-- set global properties for this build --> + <!-- + Note: These can be overridden on the command line, as in: + ant -DversionMinor=4 -DversionType=Release\ Build versionSource + --> + <property name="versionMajor" value="1"/> + <property name="versionMinor" value="3"/> + <property name="versionType" value="Integration Build"/> + <property name="versionNumber" value="${versionMajor}.${versionMinor}"/> + <property name="versionQualifier" value="${versionMajor}_${versionMinor}"/> <property name="src" value="src"/> <property name="build" value="build"/> <property name="docs" value="docs"/> <property name="resources" value="resources"/> ! <property name="dist" value="release/htmlparser${versionQualifier}"/> <property name="releaseDir" value="release"/> <property name="finalLoc" value="distribution"/> *************** *** 18,55 **** <echo message="**********************************"/> <tstamp> ! <format property="TODAY" pattern="yyyyMMdd" locale="en"/> ! <format property="TODAY_STRING" pattern="MMM dd, yyyy"/> </tstamp> ! <property name="version" value="1_3_${TODAY}"/> ! <property name="displayVersion" value=""1.3 (Integration Build ${TODAY_STRING})""/> ! <echo message="version=${version}"/> ! <echo message="displayVersion=${displayVersion}"/> ! <!-- set property VERSION_STRING to current display version --> <loadproperties srcFile="${src}/org/htmlparser/Parser.java"> <filterchain> <linecontains> ! <contains value="VERSION_STRING"/> </linecontains> </filterchain> </loadproperties> ! <property name="previousDisplayVersion" value="${VERSION_STRING}"/> ! <echo message="Detected Previous Display Version = ${previousDisplayVersion}"/> <!-- set property previousVersion to current version --> ! <loadfile srcFile="${src}/org/htmlparser/Parser.java" property="previousVersion"> <filterchain> <headfilter lines="1"/> <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"> ! <param name="linebreaks" value=" - A java-based parser for HTML"/> ! </filterreader> ! <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"> ! <param name="linebreaks" value="//Piy"/> </filterreader> <striplinebreaks/> </filterchain> </loadfile> ! <echo message="Detected Previous Version = ${previousVersion}"/> </target> --- 26,62 ---- <echo message="**********************************"/> <tstamp> ! <format property="TODAY" pattern="yyyyMMdd" locale="en"/> ! <format property="TODAY_STRING" pattern="MMM dd, yyyy"/> </tstamp> ! <property name="versionTag" value="${versionQualifier}_${TODAY}"/> ! <echo message="versionTag=${versionTag}"/> ! <!-- retrieve VERSION_XXX properties from Parser.java --> <loadproperties srcFile="${src}/org/htmlparser/Parser.java"> <filterchain> <linecontains> ! <contains value="VERSION_"/> </linecontains> + <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"> + <param name="linebreaks" value=")""/> + </filterreader> </filterchain> </loadproperties> ! <echo message="previous version number = ${VERSION_NUMBER}"/> ! <echo message="previous version type = ${VERSION_TYPE}"/> ! <echo message="previous version date = ${VERSION_DATE}"/> <!-- set property previousVersion to current version --> ! <loadfile srcFile="${src}/org/htmlparser/Parser.java" property="previousTag"> <filterchain> <headfilter lines="1"/> <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"> ! <param name="linebreaks" value="/Piy - A java-based parser for HTML"/> </filterreader> <striplinebreaks/> </filterchain> </loadfile> ! <echo message="previous version tag = ${previousTag}"/> </target> *************** *** 60,72 **** <echo message="**********************************"/> ! <echo message="Replacing version ${previousVersion} with ${version} in all source files"/> ! <replace dir="${src}" value="${version}"> ! <include name="**/*.java"/> ! <replacefilter token="${previousVersion}"/> ! </replace> ! <replace file="${src}/org/htmlparser/Parser.java" token="${previousDisplayVersion}" value="${displayVersion}"/> ! <replace file="${docs}/release.txt" token="${previousDisplayVersion}" value="${displayVersion}"/> </target> ! <target name="compile" description="compile all java files"> <echo message="**********************************"/> --- 67,106 ---- <echo message="**********************************"/> ! <echo message="Replacing version VERSION_NUMBER = "${VERSION_NUMBER}" with VERSION_NUMBER = "${versionNumber}" in ${src}/org/htmlparser/Parser.java"/> ! <replace file="${src}/org/htmlparser/Parser.java" token="VERSION_NUMBER = "${VERSION_NUMBER}"" value="VERSION_NUMBER = "${versionNumber}""/> ! ! <echo message="Replacing version VERSION_TYPE = "${VERSION_TYPE}" with VERSION_TYPE = "${versionType}" in ${src}/org/htmlparser/Parser.java"/> ! <replace file="${src}/org/htmlparser/Parser.java" token="VERSION_TYPE = "${VERSION_TYPE}"" value="VERSION_TYPE = "${versionType}""/> ! ! <echo message="Replacing version VERSION_DATE = "${VERSION_DATE}" with VERSION_DATE = "${TODAY_STRING}" in ${src}/org/htmlparser/Parser.java"/> ! <replace file="${src}/org/htmlparser/Parser.java" token="VERSION_DATE = "${VERSION_DATE}"" value="VERSION_DATE = "${TODAY_STRING}""/> ! ! <echo message="Replacing version "${VERSION_NUMBER} (${VERSION_TYPE} ${VERSION_DATE})" with "${versionNumber} (${versionType} ${TODAY_STRING})" in ${docs}/release.txt"/> ! <replace dir="${docs}" value="${versionNumber} (${versionType} ${TODAY_STRING})"> ! <include name="release.txt"/> ! <replacefilter token="${VERSION_NUMBER} (${VERSION_TYPE} ${VERSION_DATE})"/> ! </replace> ! <echo message="Replacing version tag ${previousTag} with ${versionTag} in all source files"/> ! <replace dir="${src}" value="${versionTag}"> ! <include name="**/*.java"/> ! <replacefilter token="${previousTag}"/> ! </replace> </target> ! ! <target name="changeLog" depends="init" description="create the change log from CVS logs"> ! <!-- ant has a changelog task already, but it outputs XML and doesn't unify dates or spit them out in chronological order --> ! <!-- cvschangelog daysinpast="7" destfile="changelog.xml" / --> ! <!-- so we use cvs2cl instead --> ! <echo message="**********************************"/> ! <echo message="* Creating change log *"/> ! <echo message="**********************************"/> ! <echo message="./cvs2cl.pl --separate-header -l "-d'>${VERSION_DATE}'""/> ! <exec executable="./cvs2cl.pl"> ! <arg value="--separate-header"/> ! <arg value="-l"/> ! <arg value="-d'>${VERSION_DATE}'"/> ! </exec> ! </target> ! <target name="compile" description="compile all java files"> <echo message="**********************************"/> |