diff options
| author | Robert Gemmell <robbie@apache.org> | 2013-09-23 23:24:18 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2013-09-23 23:24:18 +0000 |
| commit | 436a3013e6b78ed7c494c815a1c78f9653d96e7d (patch) | |
| tree | 7771074bdb4ad63a4e357b99186b8637b3ece77f /qpid/java/broker | |
| parent | bcac01bf1fb05179badd1eacc13276a2ebeda9ec (diff) | |
| download | qpid-python-436a3013e6b78ed7c494c815a1c78f9653d96e7d.tar.gz | |
QPID-5158: extract the generation process for the common and broker modules into dedicated build files
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1525730 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker')
| -rw-r--r-- | qpid/java/broker/build-generate-sources.xml | 97 | ||||
| -rw-r--r-- | qpid/java/broker/build.xml | 4 |
2 files changed, 99 insertions, 2 deletions
diff --git a/qpid/java/broker/build-generate-sources.xml b/qpid/java/broker/build-generate-sources.xml new file mode 100644 index 0000000000..2e46a43210 --- /dev/null +++ b/qpid/java/broker/build-generate-sources.xml @@ -0,0 +1,97 @@ +<!-- + - + - Licensed to the Apache Software Foundation (ASF) under one + - or more contributor license agreements. See the NOTICE file + - distributed with this work for additional information + - regarding copyright ownership. The ASF licenses this file + - to you under the Apache License, Version 2.0 (the + - "License"); you may not use this file except in compliance + - with the License. You may obtain a copy of the License at + - + - http://www.apache.org/licenses/LICENSE-2.0 + - + - Unless required by applicable law or agreed to in writing, + - software distributed under the License is distributed on an + - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + - KIND, either express or implied. See the License for the + - specific language governing permissions and limitations + - under the License. + - + --> +<project name="QpidBrokerGenerateSources" default="generate-logmessages"> + + <!-- Additions to perform LogMessage generation. To enable for a given + module using the Ant build, add the following to the build.xml: + + <import file="${project.root}/broker/build-generate-sources.xml"/> + + <target name="precompile" depends="generate-logmessages"/> --> + + <dirname property="QpidBrokerGenerateSources.basedir" file="${ant.file.QpidBrokerGenerateSources}"/> + + <property name="gentools.classes" location="${build.scratch}/common/gentools" /> + <property name="generated-logmessages-dir" location="${module.precompiled}" /> + <property name="velocity.classes" value="${build.scratch}/broker/velocity"/> + <property name="velocity.timestamp" location="${generated-logmessages-dir}/velocity.timestamp" /> + <property name="velocity.src.dir" value="${QpidBrokerGenerateSources.basedir}/src/velocity/java"/> + <property name="velocity.template.dir" value="${QpidBrokerGenerateSources.basedir}/src/velocity/templates/org/apache/qpid/server/logging/messages"/> + + <path id="source.generation.classpathref"> + <pathelement path="${project.root}/${velocity.jar}" /> + <pathelement path="${project.root}/${velocity-dep.jar}" /> + </path> + + <target name="compile-logmessages-generator" > + <mkdir dir="${velocity.classes}" /> + <!-- Compile LogMessages Velocity Generator --> + <javac source="1.5" target="1.5" + destdir="${velocity.classes}" debug="on" includeantruntime="false" + srcdir="${velocity.src.dir}" > + <classpath> + <path refid="source.generation.classpathref"/> + </classpath> + </javac> + </target> + + <target name="check-logmessages-generation-required"> + <uptodate property="logmessages-generation-not-required" targetfile="${velocity.timestamp}"> + <srcfiles dir="${module.src}" includes="**/*_logmessages.properties" /> + <srcfiles dir="${velocity.src.dir}" includes="**/*.java **/*.vm" /> + </uptodate> + </target> + + <target name="generate-logmessages" depends="compile-logmessages-generator,check-logmessages-generation-required" unless="logmessages-generation-not-required"> + <mkdir dir="${generated-logmessages-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.classes}" failonerror="true"> + <arg line="'${logmessages}'"/> + <arg value="-j"/> + <arg value="-o"/> + <arg value="${generated-logmessages-dir}"/> + <arg value="-t"/> + <arg value="${velocity.template.dir}"/> + <arg value="-s"/> + <arg value="${module.src}"/> + + <classpath> + <pathelement path="${module.src}"/> + <pathelement path="${velocity.classes}" /> + <path refid="source.generation.classpathref"/> + </classpath> + </java> + <touch file="${velocity.timestamp}" /> + </target> + +</project> diff --git a/qpid/java/broker/build.xml b/qpid/java/broker/build.xml index da51e4ffa5..50b637e5c3 100644 --- a/qpid/java/broker/build.xml +++ b/qpid/java/broker/build.xml @@ -31,9 +31,9 @@ <import file="../module.xml"/> - <property name="output.dir" value="${module.precompiled}/org/apache/qpid/server/filter/jms/selector"/> + <import file="${project.root}/broker/build-generate-sources.xml"/> - <target name="precompile" depends="gen_logging"/> + <target name="precompile" depends="generate-logmessages"/> <target name="copy-etc-release" if="module.etc.exists" description="copy etc directory if it exists to build tree"> <copy todir="${module.release}/etc" failonerror="false" flatten="true"> |
