diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2010-06-14 12:35:51 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2010-06-14 12:35:51 +0000 |
| commit | ad34dd26cdd0aacbe4850712d4ff41a4c8229a81 (patch) | |
| tree | 4732922af62a6bc5cb17f43470297f643d064ef5 /java/module.xml | |
| parent | c14e5d4b2a3bdcd45e4af44c3a641ad391873f4e (diff) | |
| download | qpid-python-ad34dd26cdd0aacbe4850712d4ff41a4c8229a81.tar.gz | |
QPID-2625 : Moved Logging generation to moudule.xml to allow plugins to utilise the same functionality.
To enable generation for your plugin just add :
<target name="precompile" depends="gen_logging"/>
to your build.xml
Logging is now defined in a X_logmessage.properties file. Where X is used to make the XMessages.java class.
Also updated all existing usages to remove the 3 digit prefix that wasn't adding any info.
Updated ConfigStore and Transaction Log to use named properties rather than numeric values.
If we are going to continue with <3 alpha>-<4 numeric> ids for messages then we'll need to have some registry to prevent
clases. Perhaps it is simpler to relax this and require a plugin creator to provide a unique identifier for their messages.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@954432 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/module.xml')
| -rw-r--r-- | java/module.xml | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/java/module.xml b/java/module.xml index 0aa4a8f109..f89a1a21ae 100644 --- a/java/module.xml +++ b/java/module.xml @@ -666,4 +666,77 @@ qpid.name=${project.name} </echo> </target> + <!-- Additions to perform LogMessage generation + To activate for your plugin add the following to your plugin build.xml + + <target name="precompile" depends="gen_logging"/> + + --> + + <property name="gentools.home" location="${project.root}/../gentools" /> + <property name="generated.dir" location="${module.precompiled}" /> + <property name="velocity.compile.dir" value="${build.scratch}/broker/velocity"/> + <property name="velocity.timestamp" location="${generated.dir}/velocity.timestamp" /> + + <target name="compile_velocity" > + <mkdir dir="${velocity.compile.dir}" /> + <!-- Compile LogMessages Velocity Generator --> + <javac source="${java.source}" target="${java.target}" + destdir="${velocity.compile.dir}" debug="on" includeantruntime="false" + deprecation="${javac.deprecation}" + srcdir="${project.root}/broker/src/velocity/java" > + <classpath> + <pathelement path="${gentools.home}/lib/velocity-1.4.jar" /> + </classpath> + <compilerarg line="${javac.compiler.args}"/> + </javac> + </target> + + + <target name="check_velocity_deps"> + <uptodate property="velocity.notRequired" targetfile="${velocity.timestamp}"> + <srcfiles dir="${module.src}" includes="**/*_logmessages.properties" /> + <srcfiles dir="${project.root}/broker/src/velocity/" includes="**/*.java **/*.vm" /> + </uptodate> + </target> + + + <target name="gen_logging" depends="compile_velocity,check_velocity_deps" unless="velocity.notRequired"> + <mkdir dir="${generated.dir}"/> + + <path id="logmessages.path"> + <fileset dir="${module.src}"> + <include name="**/*_logmessages.properties"/> + </fileset> + </path> + + <pathconvert property="logmessages" + refid="logmessages.path" + pathsep=" "/> + + <echo message="logmessages is ${logmessages}"/> + + <java classname="org.apache.qpid.server.logging.GenerateLogMessages" fork="true" dir="${gentools.home}/src" failonerror="true"> + <arg line="${logmessages}"/> + <arg value="-j"/> + <arg value="-o"/> + <arg value="${generated.dir}"/> + <arg value="-t"/> + <arg value="${project.root}/broker/src/velocity/templates/org/apache/qpid/server/logging/messages"/> + <arg value="-s"/> + <arg value="${module.src}"/> + + + <classpath> + <pathelement path="${module.src}"/> + <pathelement path="${velocity.compile.dir}" /> + <fileset dir="${project.root}/lib"> + <include name="**/*.jar"/> + </fileset> + <pathelement path="${gentools.home}/lib/velocity-1.4.jar" /> + </classpath> + </java> + <touch file="${velocity.timestamp}" /> + </target> + </project> |
