| <?xml version="1.0" encoding="UTF-8"?> |
| |
| <!-- |
| 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. |
| --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- maven Buildfile --> |
| <!-- --> |
| <!-- $Id$ --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| |
| <project |
| xmlns:j="jelly:core" |
| xmlns:u="jelly:util" |
| xmlns:maven="jelly:maven" |
| default="jar:jar"> |
| |
| <!-- ================================================================== --> |
| <!-- C O M P I L E P R E - G O A L --> |
| <!-- ================================================================== --> |
| <!-- Before compiling the Turbine Source Code, it is necessary to --> |
| <!-- generate the Torque Peers. This preGoal runs the prepare-sources --> |
| <!-- target. --> |
| <!-- ================================================================== --> |
| <preGoal name="java:compile"> |
| <attainGoal name="prepare-sources"/> |
| |
| <!-- Hack for Maven bug when compiling with a clean target. --> |
| <j:if test="${sourcesPresent != 'true'}"> |
| <j:set var="sourcesPresent" value="true"/> |
| <path id="maven.compile.src.set" location="target/src"/> |
| </j:if> |
| |
| </preGoal> |
| |
| <!-- ================================================================== --> |
| <!-- C O M P I L E P O S T - G O A L --> |
| <!-- ================================================================== --> |
| <!-- executed before the building of the jar, it copies all the various --> |
| <!-- resource files into the jar build directory --> |
| <!-- ================================================================== --> |
| <postGoal name="java:compile"> |
| <copy |
| file="${maven.src.dir}/dtd/intake.dtd" |
| todir="${maven.build.dest}/org/apache/turbine/services/intake/transform" |
| /> |
| <copy |
| file="${maven.src.dir}/macros/TurbineMacros.vm" |
| todir="${maven.build.dest}/macros" |
| /> |
| </postGoal> |
| |
| <!-- ================================================================== --> |
| <!-- T O R Q U E - I N I T P R E - G O A L --> |
| <!-- ================================================================== --> |
| <!-- The schema files for the Torque peers must be prepared and some --> |
| <!-- variables added. This must be done before doing any torque work --> |
| <!-- ================================================================== --> |
| <preGoal name="torque:init"> |
| <attainGoal name="copy-om"/> |
| </preGoal> |
| |
| <!-- ================================================================== --> |
| <!-- P R E P A R E S O U R C E S --> |
| <!-- ================================================================== --> |
| <!-- This target builds the torque peers needed to compile the Turbine --> |
| <!-- distribution. If you don't want to build the whole code with --> |
| <!-- maven but use an IDE (e.g. Eclipse), you can run this target and --> |
| <!-- use target/src as your source directory. --> |
| <!-- ================================================================== --> |
| <goal name="prepare-sources" description="Copy Turbine and Torque generated sources to target/src"> |
| <copy todir="target/src"> |
| <fileset dir="src/java"/> |
| </copy> |
| |
| <attainGoal name="generate-om"/> |
| </goal> |
| |
| |
| <!-- ================================================================== --> |
| <!-- T O R Q U E G E N E R A T I O N G O A L --> |
| <!-- ================================================================== --> |
| <!-- Generates only the java classes for the peers of the scheduler and --> |
| <!-- the torque security service --> |
| <!-- ================================================================== --> |
| <goal name="generate-om" description="Generate Torque peer classes in target/src" |
| prereqs="scheduler-om, torque-security-om"/> |
| |
| |
| <!-- ================================================== --> |
| <!-- Prepare all Sources for Torque --> |
| <!-- ================================================== --> |
| <goal name="copy-om" description="Copy all schema files to target/xml and replace database related variables" |
| prereqs="copy-scheduler-om ,copy-torque-security-om, copy-id-table-om"/> |
| |
| <!-- ================================================== --> |
| <!-- Prepare Scheduler Sources for Torque --> |
| <!-- ================================================== --> |
| <goal name="copy-scheduler-om" description="Copy scheduler schema files to target/xml and replace database related variables"> |
| <filter token="DATABASE_DEFAULT" value="${scheduler.database.name}"/> |
| <filter token="EXTRA_USER_COLUMNS" value="${scheduler.extra.user.columns}"/> |
| <copy |
| file="src/schema/scheduler-schema.xml" |
| tofile="${torque.schema.dir}/scheduler-schema.xml" |
| filtering="yes"/> |
| </goal> |
| |
| <!-- ================================================== --> |
| <!-- Prepare Torque Security Service Sources for Torque --> |
| <!-- ================================================== --> |
| <goal name="copy-torque-security-om" description="Copy torque security service schema files to target/xml and replace database related variables"> |
| <filter token="DATABASE_DEFAULT" value="${torque.security.database.name}"/> |
| <copy |
| file="src/schema/torque-security-schema.xml" |
| tofile="${torque.schema.dir}/torque-security-schema.xml" |
| filtering="yes"/> |
| </goal> |
| |
| <!-- ================================================== --> |
| <!-- Prepare ID Table (for idBroker) Sources for Torque --> |
| <!-- ================================================== --> |
| <goal name="copy-id-table-om" description="Copy id-table schema files to target/xml and replace database related variables"> |
| <filter token="DATABASE_DEFAULT" value="${scheduler.database.name}"/> |
| <copy |
| file="src/schema/id-table-schema.xml" |
| tofile="${torque.schema.dir}/scheduler-idtable-schema.xml" |
| filtering="yes"/> |
| <filter token="DATABASE_DEFAULT" value="${torque.security.database.name}"/> |
| <copy |
| file="src/schema/id-table-schema.xml" |
| tofile="${torque.schema.dir}/torque-security-idtable-schema.xml" |
| filtering="yes"/> |
| </goal> |
| |
| <!-- ================================================== --> |
| <!-- Build Peers for the Scheduler --> |
| <!-- ================================================== --> |
| <goal name="scheduler-om" description="generate Torque peers for the scheduler" |
| prereqs="copy-scheduler-om"> |
| |
| <j:set var="torque.project" value="scheduler"/> |
| <j:set var="torque.schema.om.includes" value="scheduler-schema.xml"/> |
| <j:set var="torque.targetPackage" value="${scheduler.package}"/> |
| <attainGoal name="torque:om"/> |
| <j:set var="outputDirectory" value="" /> |
| |
| </goal> |
| |
| <!-- ================================================== --> |
| <!-- Build Peers for Torque Security --> |
| <!-- ================================================== --> |
| <goal name="torque-security-om" description="generate Torque peers for the torque security service" |
| prereqs="copy-torque-security-om"> |
| |
| <j:set var="torque.project" value="torque-security"/> |
| <j:set var="torque.schema.om.includes" value="torque-security-schema.xml"/> |
| <j:set var="torque.targetPackage" value="${torque.security.package}"/> |
| <attainGoal name="torque:om"/> |
| <j:set var="outputDirectory" value="" /> |
| |
| </goal> |
| |
| <!-- ================================================== --> |
| <!-- Build SQL files --> |
| <!-- ================================================== --> |
| <goal name="sql" description="generate Torque SQL"> |
| <echo>Building SQL files for ${torque.database}</echo> |
| <attainGoal name="torque:sql"/> |
| <attainGoal name="torque:id-table-init-sql"/> |
| <j:set var="outputDirectory" value="" /> |
| </goal> |
| |
| <!-- ================================================================== --> |
| <!-- D I S T : B U I L D _ S R C P R E G O A L --> |
| <!-- ================================================================== --> |
| <preGoal name="dist:build-src"> |
| <copy todir="${maven.dist.src.assembly.dir}/conf"> |
| <fileset dir="${basedir}/conf"> |
| <include name="test/*"/> |
| <include name="checkstyle-license.txt"/> |
| <include name="turbine-checkstyle.xml"/> |
| <include name="test/turbine-resources/**/*"/> |
| </fileset> |
| </copy> |
| |
| <copy todir="${maven.dist.src.assembly.dir}/xdocs"> |
| <fileset dir="xdocs"/> |
| </copy> |
| |
| <copy todir="${maven.dist.src.assembly.dir}"> |
| <fileset dir="${basedir}"> |
| <include name="pom.xml"/> |
| <include name="project.xml"/> |
| <include name="project.properties"/> |
| <include name="NOTICE"/> |
| <include name="LICENSE.txt"/> |
| </fileset> |
| </copy> |
| </preGoal> |
| |
| <!-- ================================================================== --> |
| <!-- D I S T : B U I L D _ B I N P R E G O A L --> |
| <!-- ================================================================== --> |
| <!-- copies jars, sample configuration ... to the --> |
| <!-- ${maven.dist.bin.assembly.dir} to include them in the binary dists --> |
| <!-- ================================================================== --> |
| <preGoal name="dist:build-bin"> |
| <attainGoal name="copy-dist-libs"/> |
| |
| <!-- copy the contents of the conf directory --> |
| <!-- to the right place --> |
| <copy todir="${maven.dist.bin.assembly.dir}/conf" failonerror="false"> |
| <fileset dir="conf"> |
| <include name="componentConfiguration.xml" /> |
| <include name="roleConfiguration.xml" /> |
| <include name="Log4j.properties" /> |
| <include name="TurbineResources.properties" /> |
| </fileset> |
| </copy> |
| |
| <copy todir="${maven.dist.bin.assembly.dir}" failonerror="false"> |
| <fileset file='${basedir}/NOTICE'/> |
| <fileset file='${basedir}/LICENSE.txt'/> |
| </copy> |
| |
| <u:tokenize var="databaseList" delim="," trim="true">db2,hypersonic,interbase,mysql,oracle,postgresql,sybase</u:tokenize> |
| <j:forEach var="torque.database" items="${databaseList}"> |
| <attainGoal name="sql"/> |
| <j:set var="outputDirectory" value="" /> |
| <copy todir="${maven.dist.bin.assembly.dir}/sql/${torque.database}" > |
| <fileset dir="${torque.sql.dir}"> |
| <include name="*.sql"/> |
| </fileset> |
| </copy> |
| </j:forEach> |
| </preGoal> |
| |
| <goal name="copy-dist-libs"> |
| <!-- include listed dependencies --> |
| <j:forEach var="dep" items="${pom.dependencies}"> |
| <j:if test="${dep.getProperty('dist.bundle') != null && dep.getProperty('dist.bundle').equalsIgnoreCase('true')}"> |
| <copy todir="${maven.dist.bin.assembly.dir}/lib" |
| file="${maven.repo.local}/${dep.getArtifactDirectory()}/jars/${dep.getArtifact()}"/> |
| </j:if> |
| </j:forEach> |
| </goal> |
| |
| </project> |