From: <tho...@us...> - 2011-07-05 13:00:09
|
Revision: 4835 http://bigdata.svn.sourceforge.net/bigdata/?rev=4835&view=rev Author: thompsonbry Date: 2011-07-05 13:00:03 +0000 (Tue, 05 Jul 2011) Log Message: ----------- Added a BuildInfo class which is generated by ant when the code base is compiled. See https://sourceforge.net/apps/trac/bigdata/ticket/347 Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/build.xml branches/TERMS_REFACTOR_BRANCH/bigdata/src/resources/logging/log4j-dev.properties branches/TERMS_REFACTOR_BRANCH/build.xml Property Changed: ---------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/ branches/TERMS_REFACTOR_BRANCH/bigdata/src/java/com/bigdata/ Property changes on: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata ___________________________________________________________________ Added: svn:ignore + BuildInfo.java Modified: branches/QUADS_QUERY_BRANCH/build.xml =================================================================== --- branches/QUADS_QUERY_BRANCH/build.xml 2011-07-03 22:46:15 UTC (rev 4834) +++ branches/QUADS_QUERY_BRANCH/build.xml 2011-07-05 13:00:03 UTC (rev 4835) @@ -94,7 +94,7 @@ <target name="prepare"> <!-- setup ${version} for regular or snapshot. --> <tstamp> - <format property="today" pattern="ddMMyy" locale="en,US" /> + <format property="today" pattern="yyyyMMdd" locale="en,US" /> <format property="osgiDate" pattern="yyyyMMdd" locale="en,US" /> </tstamp> <condition property="version" value="bigdata-${build.ver}-${today}" else="bigdata-${build.ver}"> @@ -112,10 +112,49 @@ <mkdir dir="${build.dir}/lib" /> </target> + <target name="buildinfo" + description="Generate a BuildInfo.java file with metadata about this build."> + <property name="buildinfo.file" + value="${bigdata.dir}\bigdata\src\java\com\bigdata\BuildInfo.java"/> + <loadfile property="svn.revision" srcFile="./.svn/entries"> + <filterchain> + <headfilter lines="1" skip="3"/> + <striplinebreaks/> + </filterchain> + </loadfile> + <loadfile property="svn.url" srcFile="./.svn/entries"> + <filterchain> + <headfilter lines="1" skip="4"/> + <striplinebreaks/> + </filterchain> + </loadfile> + <tstamp> + <format property="TODAY" pattern="yyyy/MM/dd HH:mm:ss z" locale="en,US" /> + </tstamp> + <property environment="env" /> + <echo file="${buildinfo.file}"> +package com.bigdata; +public class BuildInfo { + public static final String buildVersion="${build.ver}"; + public static final String buildVersionOSGI="${build.ver.osgi}"; + public static final String svnRevision="${svn.revision}"; + public static final String svnURL="${svn.url}"; + public static final String buildTimestamp="${TODAY}"; + public static final String buildUser="${user.name}"; + public static final String buildHost="${env.COMPUTERNAME}"; + public static final String osArch="${os.arch}"; + public static final String osName="${os.name}"; + public static final String osVersion="${os.version}"; +} +</echo> + <loadfile property="buildinfo" srcFile="${buildinfo.file}"/> + <echo message="${buildinfo}"/> + </target> + <!-- Note: javac error results often if verbose is disabled. --> <!-- I was able to perform a build with 1.6.0_07. --> <!-- I set the target to 1.5 to support deployment on non-1.6 JVMs. --> - <target name="compile" depends="prepare"> + <target name="compile" depends="prepare, buildinfo"> <mkdir dir="${build.dir}" /> <javac destdir="${build.dir}/classes" classpathref="build.classpath" debug="${javac.debug}" debuglevel="${javac.debuglevel}" verbose="${javac.verbose}" encoding="${javac.encoding}"> <!-- note: must also specify -bootclasspath and -extdirs when cross-compiling --> Property changes on: branches/TERMS_REFACTOR_BRANCH/bigdata/src/java/com/bigdata ___________________________________________________________________ Added: svn:ignore + BuildInfo.java Modified: branches/TERMS_REFACTOR_BRANCH/bigdata/src/resources/logging/log4j-dev.properties =================================================================== --- branches/TERMS_REFACTOR_BRANCH/bigdata/src/resources/logging/log4j-dev.properties 2011-07-03 22:46:15 UTC (rev 4834) +++ branches/TERMS_REFACTOR_BRANCH/bigdata/src/resources/logging/log4j-dev.properties 2011-07-05 13:00:03 UTC (rev 4835) @@ -12,6 +12,8 @@ log4j.logger.com.bigdata.btree=WARN +log4j.logger.com.bigdata.htree=DEBUG + #log4j.logger.com.bigdata.rdf.sail.webapp=ALL log4j.logger.com.bigdata.search=ALL #log4j.logger.com.bigdata.rdf.lexicon.RDFFullTextIndexTupleSerializer=ALL Modified: branches/TERMS_REFACTOR_BRANCH/build.xml =================================================================== --- branches/TERMS_REFACTOR_BRANCH/build.xml 2011-07-03 22:46:15 UTC (rev 4834) +++ branches/TERMS_REFACTOR_BRANCH/build.xml 2011-07-05 13:00:03 UTC (rev 4835) @@ -112,6 +112,45 @@ <mkdir dir="${build.dir}/lib" /> </target> + <target name="buildinfo" + description="Generate a BuildInfo.java file with metadata about this build."> + <property name="buildinfo.file" + value="${bigdata.dir}\bigdata\src\java\com\bigdata\BuildInfo.java"/> + <loadfile property="svn.revision" srcFile="./.svn/entries"> + <filterchain> + <headfilter lines="1" skip="3"/> + <striplinebreaks/> + </filterchain> + </loadfile> + <loadfile property="svn.url" srcFile="./.svn/entries"> + <filterchain> + <headfilter lines="1" skip="4"/> + <striplinebreaks/> + </filterchain> + </loadfile> + <tstamp> + <format property="TODAY" pattern="yyyy/MM/dd HH:mm:ss z" locale="en,US" /> + </tstamp> + <property environment="env" /> + <echo file="${buildinfo.file}"> +package com.bigdata; +public class BuildInfo { + public static final String buildVersion="${build.ver}"; + public static final String buildVersionOSGI="${build.ver.osgi}"; + public static final String svnRevision="${svn.revision}"; + public static final String svnURL="${svn.url}"; + public static final String buildTimestamp="${TODAY}"; + public static final String buildUser="${user.name}"; + public static final String buildHost="${env.COMPUTERNAME}"; + public static final String osArch="${os.arch}"; + public static final String osName="${os.name}"; + public static final String osVersion="${os.version}"; +} +</echo> + <loadfile property="buildinfo" srcFile="${buildinfo.file}"/> + <echo message="${buildinfo}"/> + </target> + <!-- Note: javac error results often if verbose is disabled. --> <!-- I was able to perform a build with 1.6.0_07. --> <!-- I set the target to 1.5 to support deployment on non-1.6 JVMs. --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |