| <?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. |
| --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- plugin.jelly for M.E.T.A. --> |
| <!-- --> |
| <!-- $Id: plugin.jelly,v 1.4 2003/11/13 11:02:54 henning Exp $ --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| |
| <project |
| xmlns:j="jelly:core" |
| xmlns:u="jelly:util" |
| xmlns:ant="jelly:ant" |
| xmlns:maven="jelly:maven" |
| xmlns:define="jelly:define" |
| xmlns:meta="http://turbine.apache.org/meta/taglib" |
| > |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- Public goals for general use --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- turbine:setup --> |
| <!-- --> |
| <!-- Build a new Turbine application skeleton from the supplied properties. --> |
| <!-- Read in an optional setup.properties file --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:setup" description="Setup a new Turbine web application" |
| prereqs="turbine:init"> |
| |
| <!-- Load the setup file. You can redefine its name with the |
| turbine.setup.properties property |
| --> |
| <j:if test="${context.getVariable('turbine.setup.properties') == null || context.getVariable('turbine.setup.properties') == ''}"> |
| <j:set var="turbine.setup.properties" value="setup.properties"/> |
| </j:if> |
| <u:available file="${turbine.setup.properties}"> |
| <u:properties file="${turbine.setup.properties}" /> |
| </u:available> |
| |
| <attainGoal name="turbine:check-setup-environment"/> |
| |
| <filter token="TURBINE_APP_NAME" value="${turbine.app.name}"/> |
| <filter token="TURBINE_APP_FLAVOR" value="${turbine.app.flavor}"/> |
| <filter token="TURBINE_APP_PACKAGE" value="${turbine.app.package}"/> |
| <filter token="TURBINE_APP_OM_LAYER" value="${turbine.app.om.layer}"/> |
| <filter token="TURBINE_APP_OM_NAME" value="${turbine.app.om.name}"/> |
| <filter token="TURBINE_APP_OM_PACKAGE" value="${turbine.app.om.package}"/> |
| <filter token="TURBINE_APP_OM_SECURITY_NAME" value="${turbine.app.om.security.name}"/> |
| <filter token="TURBINE_APP_OM_SECURITY_PACKAGE" value="${turbine.app.om.security.package}"/> |
| <filter token="TURBINE_APP_SUBDIR" value="${turbine.app.subdir}"/> |
| <filter token="TURBINE_PLUGIN_MODE" value="${turbine.plugin.mode}"/> |
| <filter token="TURBINE_PLUGIN_INPLACE_DIR" value="${turbine.plugin.inplace.dir}"/> |
| <filter token="TURBINE_APP_SETUP_DEMO" value="${turbine.app.setup.demo}"/> |
| <filter token="TURBINE_APP_TORQUE_USE_IDTABLE" value="${turbine.app.torque.use.idtable}" /> |
| |
| <filter token="TURBINE_PLUGIN_BASE_DIR" value="${turbine.plugin.base.dir}"/> |
| <filter token="TURBINE_PLUGIN_SRC_IMAGES" value="${turbine.plugin.src.images}"/> |
| <filter token="TURBINE_PLUGIN_SRC_PAGES" value="${turbine.plugin.src.pages}"/> |
| <filter token="TURBINE_PLUGIN_SRC_RESOURCES" value="${turbine.plugin.src.resources}"/> |
| <filter token="TURBINE_PLUGIN_SRC_SCHEMA" value="${turbine.plugin.src.schema}"/> |
| <filter token="TURBINE_PLUGIN_SRC_SCRIPTS" value="${turbine.plugin.src.scripts}"/> |
| <filter token="TURBINE_PLUGIN_SRC_STYLE" value="${turbine.plugin.src.style}"/> |
| <filter token="TURBINE_PLUGIN_SRC_TEMPLATES" value="${turbine.plugin.src.templates}"/> |
| |
| <filter token="TURBINE_PLUGIN_SRC_CONF" value="${turbine.plugin.src.conf}"/> |
| <filter token="TURBINE_PLUGIN_SRC_JAVA" value="${turbine.plugin.src.java}"/> |
| <filter token="TURBINE_PLUGIN_SRC_COMPILE" value="${turbine.plugin.src.compile}"/> |
| <filter token="TURBINE_PLUGIN_SRC_TEST" value="${turbine.plugin.src.test}"/> |
| <filter token="TURBINE_PLUGIN_SRC_PROPS" value="${turbine.plugin.src.props}"/> |
| |
| <filter token="TURBINE_PLUGIN_TARGET_LIB" value="${turbine.plugin.target.lib}"/> |
| |
| <filter token="TURBINE_PLUGIN_DEPLOY_CONFIG_SKIP" value="${turbine.plugin.deploy.config.skip}"/> |
| <filter token="TURBINE_PLUGIN_IMAGES_CONFIG_SKIP" value="${turbine.plugin.deploy.images.skip}"/> |
| <filter token="TURBINE_PLUGIN_PAGES_CONFIG_SKIP" value="${turbine.plugin.deploy.pages.skip}"/> |
| <filter token="TURBINE_PLUGIN_RESOURCES_CONFIG_SKIP" value="${turbine.plugin.deploy.resources.skip}"/> |
| <filter token="TURBINE_PLUGIN_SCRIPTS_CONFIG_SKIP" value="${turbine.plugin.deploy.scripts.skip}"/> |
| <filter token="TURBINE_PLUGIN_STYLE_CONFIG_SKIP" value="${turbine.plugin.deploy.style.skip}"/> |
| <filter token="TURBINE_PLUGIN_TEMPLATES_CONFIG_SKIP" value="${turbine.plugin.deploy.templates.skip}"/> |
| |
| <filter token="MAVEN_BUILD_DEST" value="${maven.build.dest}"/> |
| |
| <filter token="TORQUE_DATABASE" value="${torque.database}"/> |
| <filter token="TORQUE_DATABASE_DRIVER" value="${torque.database.driver}"/> |
| <filter token="TORQUE_DATABASE_USER" value="${torque.database.user}"/> |
| <filter token="TORQUE_DATABASE_PASSWD" value="${torque.database.password}"/> |
| <filter token="TORQUE_DATABASE_URL" value="${torque.database.buildUrl}"/> |
| <filter token="TORQUE_DATABASE_CREATE_URL" value="${torque.database.createUrl}"/> |
| |
| <filter token="MAVEN_APPSERVER_NAME" value="${maven.appserver.name}"/> |
| <filter token="MAVEN_APPSERVER_HOME" value="${maven.appserver.home}"/> |
| |
| <filter token="MAVEN_WAR_WEBXML" value="${maven.war.webxml}"/> |
| |
| <filter token="NOT_USE_OM_TORQUE" value="#"/> |
| <filter token="USE_OM_TORQUE" value=""/> |
| <filter token="NOT_USE_OM_NONE" value="#"/> |
| <filter token="USE_OM_NONE" value=""/> |
| |
| <j:if test="${turbine.plugin.torque.use}"> |
| <filter token="NOT_USE_OM_TORQUE" value=""/> |
| <filter token="USE_OM_TORQUE" value="#"/> |
| </j:if> |
| |
| <j:if test="${turbine.plugin.none.use}"> |
| <filter token="NOT_USE_OM_NONE" value=""/> |
| <filter token="USE_OM_NONE" value="#"/> |
| </j:if> |
| |
| <u:replace var="appDir" oldChar="." newChar="/" value="${turbine.app.package}"/> |
| |
| <echo>Building Turbine Skeleton for ${turbine.app.name} application |
| Flavor: ${turbine.app.flavor} |
| Mode: ${turbine.plugin.mode} |
| Package: ${turbine.app.package} |
| OM-Layer: ${turbine.app.om.layer} |
| |
| Root Directory: ${turbine.plugin.root.dir} |
| Base Directory: ${turbine.plugin.base.dir} |
| web.xml: ${maven.war.webxml} |
| </echo> |
| |
| <!-- Make directories --> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.conf}"/> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.java}"/> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.schema}"/> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.templates}/layouts"/> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.templates}/macros"/> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.templates}/screens"/> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.templates}/navigations"/> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.test}"/> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.scripts}"/> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.style}"/> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.images}"/> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.pages}"/> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.props}"/> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.resources}"/> |
| |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.java}/${appDir}" /> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.java}/${appDir}/modules/actions" /> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.java}/${appDir}/modules/screens" /> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.java}/${appDir}/modules/layouts" /> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.java}/${appDir}/modules/navigations" /> |
| <mkdir dir="${turbine.plugin.root.dir}/${turbine.plugin.src.java}/${appDir}/modules/pages" /> |
| |
| <!-- ========== Copy build control files into application root ========== --> |
| |
| <meta:copyFlavorDir todir="${turbine.plugin.root.dir}" filtering="true" |
| flavor="${turbine.app.flavor}" |
| frompath="maven" |
| include="**/*"/> |
| |
| <!-- Try to rebuild the setup.properties file. |
| If it already exists, don't clobber it! |
| --> |
| <u:available file="${plugin.resources}/setup"> |
| <ant:copy todir="${turbine.plugin.root.dir}" filtering="true" overwrite="false"> |
| <ant:fileset dir="${plugin.resources}/setup"/> |
| </ant:copy> |
| </u:available> |
| |
| <!-- ========== Copy template files ========== --> |
| |
| <meta:copyFlavorDir todir="${turbine.plugin.root.dir}/${turbine.plugin.src.templates}" filtering="true" |
| flavor="${turbine.app.flavor}" |
| frompath="templates" |
| include="**/*" |
| exclude="**/application*"/> |
| |
| <meta:copyFlavorFile tofile="${turbine.plugin.root.dir}/${turbine.plugin.src.templates}/macros/${turbine.app.name}Macros.vm" filtering="true" |
| flavor="${turbine.app.flavor}" |
| fromfile="templates/macros/applicationMacros.vm" /> |
| |
| <!-- ========== Copy Turbine configuration files ========== --> |
| |
| <meta:copyFlavorDir todir="${turbine.plugin.root.dir}/${turbine.plugin.src.conf}" filtering="true" |
| flavor="${turbine.app.flavor}" |
| frompath="conf" |
| include="**/*" |
| exclude="**/application*"/> |
| |
| <meta:copyFlavorFile tofile="${turbine.plugin.root.dir}/${maven.war.webxml}" filtering="true" |
| flavor="${turbine.app.flavor}" |
| fromfile="conf/application-web.xml" /> |
| |
| <meta:copyFlavorDir todir="${turbine.plugin.root.dir}/${turbine.plugin.src.props}" filtering="true" |
| flavor="${turbine.app.flavor}" |
| frompath="props" |
| include="**/*" /> |
| |
| <meta:copyFlavorFile tofile="${turbine.plugin.root.dir}/${turbine.plugin.src.conf}/${turbine.app.name}.properties" filtering="true" |
| flavor="${turbine.app.flavor}" |
| fromfile="conf/application.properties" /> |
| |
| <meta:copyFlavorFile tofile="${turbine.plugin.root.dir}/${turbine.plugin.src.conf}/${turbine.app.name}-intake.xml" filtering="true" |
| flavor="${turbine.app.flavor}" |
| fromfile="conf/application-intake.xml" /> |
| |
| <!-- ========== Copy other files into application tree ========== --> |
| |
| <meta:copyFlavorDir todir="${turbine.plugin.root.dir}/${turbine.plugin.src.images}" filtering="false" |
| flavor="${turbine.app.flavor}" |
| frompath="images" |
| include="**/*" /> |
| |
| <meta:copyFlavorDir todir="${turbine.plugin.root.dir}/${turbine.plugin.src.resources}" filtering="true" |
| flavor="${turbine.app.flavor}" |
| frompath="resources" |
| include="**/*" /> |
| |
| <meta:copyFlavorDir todir="${turbine.plugin.root.dir}/${turbine.plugin.src.pages}" filtering="true" |
| flavor="${turbine.app.flavor}" |
| frompath="pages" |
| include="**/*" /> |
| |
| <!-- ========== Copy schema files for Torque ========== --> |
| |
| <meta:copyOmDir todir="${turbine.plugin.root.dir}/${turbine.plugin.src.conf}" filtering="true" |
| omLayer="${turbine.app.om.layer}" |
| frompath="conf" |
| include="**/*" |
| exclude="**/application*"/> |
| |
| <!-- filtering="false" is intentional! The file variables are |
| replaced when the files are copied inside the application. |
| --> |
| |
| <meta:copyOmDir todir="${turbine.plugin.root.dir}/${turbine.plugin.src.schema}" filtering="false" |
| omLayer="${turbine.app.om.layer}" |
| frompath="schema" |
| include="**/*" |
| exclude="**/application*"/> |
| |
| <meta:copyOmFile tofile="${turbine.plugin.root.dir}/${turbine.plugin.src.schema}/${turbine.app.name}-schema.xml" filtering="false" |
| omLayer="${turbine.app.om.layer}" |
| fromfile="schema/application-schema.xml" /> |
| |
| <meta:copyOmFile tofile="${turbine.plugin.root.dir}/${turbine.plugin.src.schema}/${turbine.app.name}-data.dtd" filtering="true" |
| omLayer="${turbine.app.om.layer}" |
| fromfile="schema/application-data.dtd" /> |
| |
| <meta:copyOmFile tofile="${turbine.plugin.root.dir}/${turbine.plugin.src.schema}/${turbine.app.name}-data.xml" filtering="true" |
| omLayer="${turbine.app.om.layer}" |
| fromfile="schema/application-data.xml" /> |
| |
| |
| <j:if test="${context.getVariable('turbine.app.setup.demo') != null && context.getVariable('turbine.app.setup.demo') == 'true'}"> |
| <attainGoal name="turbine:install-demo"/> |
| </j:if> |
| </goal> |
| <!-- ======================================================================== --> |
| <!-- turbine:setup --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- turbine:sql --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:sql" |
| description="Build the SQL files necessary for the application" |
| prereqs="turbine:check-runtime-environment"> |
| |
| <j:if test="${turbine.plugin.torque.use}"> |
| <attainGoal name="turbine:torque-sql" /> |
| </j:if> |
| |
| </goal> |
| <!-- ======================================================================== --> |
| <!-- turbine:sql --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- turbine:webapp --> |
| <!-- --> |
| <!-- While the normal "war:webapp" goal tries to do a reasonably good job --> |
| <!-- to build a web application, this goal knows about all the pecularities --> |
| <!-- when building a turbine webapplication. So you might prefer this goal --> |
| <!-- (which actually uses war:webapp). --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:webapp" |
| prereqs="turbine:war"> |
| <ant:echo> |
| ********************************************************************************* |
| *** *** |
| *** turbine:webapp is deprecated and will be removed. Please use turbine:war! *** |
| *** *** |
| ********************************************************************************* |
| </ant:echo> |
| </goal> |
| |
| <goal name="turbine:war" |
| description="Generate a Turbine based Web application (war)" |
| prereqs="turbine:check-runtime-environment,java:compile, war:webapp"> |
| |
| <j:set var="webapp.build" value="target/${pom.artifactId}"/> |
| <j:set var="webapp.build.lib" value="target/${pom.artifactId}/WEB-INF/lib"/> |
| <j:set var="webapp.build.classes" value="target/${pom.artifactId}/WEB-INF/classes"/> |
| <j:set var="webapp.build.webinf" value="target/${pom.artifactId}/WEB-INF"/> |
| |
| <delete file="${maven.build.dir}/${pom.artifactId}.war" /> |
| |
| <war warfile="${maven.build.dir}/${pom.artifactId}.war" |
| webxml="${maven.war.webxml}"> |
| |
| <!-- we include classes and libs explicitly with the lib and classes tag below. |
| The web.xml file is defined by the webxml attribute above |
| --> |
| |
| <fileset dir="${webapp.build}"> |
| <exclude name="WEB-INF/lib/**"/> |
| <exclude name="WEB-INF/classes/**"/> |
| <exclude name="WEB-INF/web.xml"/> |
| </fileset> |
| |
| <lib dir="${webapp.build.lib}"/> |
| |
| <classes dir="${webapp.build.classes}"> |
| <include name="${maven.war.classes.includes}" /> |
| <exclude name="${maven.war.classes.excludes}" /> |
| </classes> |
| |
| <metainf dir="${basedir}"> |
| <include name="LICENSE.txt"/> |
| </metainf> |
| |
| <manifest> |
| <attribute name="Built-By" value="${user.name}" /> |
| <section name="${pom.package}"> |
| <attribute name="Specification-Title" value="${pom.artifactId}" /> |
| <attribute name="Specification-Version" |
| value="${pom.currentVersion}" /> |
| <attribute name="Specification-Vendor" |
| value="${pom.organization.name}" /> |
| <attribute name="Implementation-Title" |
| value="${pom.package}" /> |
| <attribute name="Implementation-Version" |
| value="${pom.currentVersion}" /> |
| <attribute name="Implementation-Vendor" |
| value="${pom.organization.name}" /> |
| <attribute name="Build-Jdk" |
| value="${java.version}"/> |
| </section> |
| </manifest> |
| </war> |
| |
| </goal> |
| <!-- ======================================================================== --> |
| <!-- turbine:webapp --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- turbine:deploy --> |
| <!-- --> |
| <!-- For Debugging purposes it is nice to be able to copy a Turbine --> |
| <!-- application directly into an existing Web Container. This target --> |
| <!-- allows direct container installation --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:deploy" |
| description="Deploys the Application into a local web container for testing" |
| prereqs="turbine:check-runtime-environment"> |
| |
| <j:if test="${context.getVariable('turbine.plugin.mode').equalsIgnoreCase('inplace')}"> |
| <maven:makeAbsolutePath var="absPath" basedir="${basedir}" path="${turbine.plugin.base.dir}" trim="true" /> |
| <fail> |
| -------------------------------------------------------------------------- |
| | Inplace Mode cannot be deployed | |
| -------------------------------------------------------------------------- |
| |
| An inplace application cannot be deployed. Instead you should modify |
| your web container to serve an application located at |
| |
| ${absPath} |
| |
| -------------------------------------------------------------------------- |
| </fail> |
| </j:if> |
| |
| <echo>Located Application Server at ${maven.appserver.home} (${maven.appserver.name})</echo> |
| |
| <attainGoal name="jar:jar"/> |
| |
| <delete file="${maven.build.dir}/${pom.artifactId}.war" /> |
| |
| <j:set var="turbine.target.dir" scope="parent" |
| value="${maven.appserver.home}/webapps/${pom.artifactId}" /> |
| |
| <echo>Installing to Appserver Directory: ${turbine.target.dir}, Inplace: ${turbine.plugin.mode}</echo> |
| |
| <mkdir dir="${turbine.target.dir}/WEB-INF/lib" /> |
| <mkdir dir="${turbine.target.dir}/WEB-INF/conf" /> |
| <mkdir dir="${turbine.target.dir}/WEB-INF/classes" /> |
| <mkdir dir="${turbine.target.dir}/logs" /> |
| <mkdir dir="${turbine.target.dir}/templates" /> |
| |
| <j:forEach var="dep" items="${pom.dependencies}"> |
| <j:if test="${dep.getProperty('war.bundle') != null && dep.getProperty('war.bundle').equalsIgnoreCase('true')}"> |
| <copy todir="${turbine.target.dir}/WEB-INF/lib" |
| file="${maven.repo.local}/${dep.getArtifactDirectory()}/jars/${dep.getArtifact()}"/> |
| </j:if> |
| </j:forEach> |
| |
| <copy todir="${turbine.target.dir}/WEB-INF/classes" filtering="no"> |
| <fileset dir="${pom.build.SourceDirectory}"> |
| <exclude name="**/*.java"/> |
| <exclude name="report.${torque.project}.om.generation"/> |
| </fileset> |
| </copy> |
| |
| <copy todir="${turbine.target.dir}/WEB-INF/classes"> |
| <fileset dir="${maven.build.dest}"/> |
| </copy> |
| |
| <copy file="${maven.war.webxml}" |
| tofile="${turbine.target.dir}/WEB-INF/web.xml"/> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.deploy.config.skip') == null || !context.getVariable('turbine.plugin.deploy.config.skip').equalsIgnoreCase('true')}"> |
| <copy todir="${turbine.target.dir}/WEB-INF/conf" flatten="true" includeEmptyDirs="no"> |
| <fileset dir="${turbine.plugin.src.conf}"> |
| <exclude name="${pom.artifactId}-web.xml"/> |
| <exclude name="commons-logging.properties"/> |
| </fileset> |
| </copy> |
| </j:when> |
| <j:otherwise> |
| <echo>Skipping configuration because turbine.plugin.deploy.config.skip is true</echo> |
| </j:otherwise> |
| </j:choose> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.deploy.images.skip') == null || !context.getVariable('turbine.plugin.deploy.images.skip').equalsIgnoreCase('true')}"> |
| <u:available file="${turbine.plugin.src.images}"> |
| <copy todir="${turbine.target.dir}/images"> |
| <fileset dir="${turbine.plugin.src.images}"/> |
| </copy> |
| </u:available> |
| </j:when> |
| <j:otherwise> |
| <echo>Skipping configuration because turbine.plugin.deploy.images.skip is true</echo> |
| </j:otherwise> |
| </j:choose> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.deploy.pages.skip') == null || !context.getVariable('turbine.plugin.deploy.pages.skip').equalsIgnoreCase('true')}"> |
| <u:available file="${turbine.plugin.src.pages}"> |
| <copy todir="${turbine.target.dir}"> |
| <fileset dir="${turbine.plugin.src.pages}"/> |
| </copy> |
| </u:available> |
| </j:when> |
| <j:otherwise> |
| <echo>Skipping configuration because turbine.plugin.deploy.pages.skip is true</echo> |
| </j:otherwise> |
| </j:choose> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.deploy.resources.skip') == null || !context.getVariable('turbine.plugin.deploy.resources.skip').equalsIgnoreCase('true')}"> |
| <u:available file="${turbine.plugin.src.resources}"> |
| <copy todir="${turbine.target.dir}/resources"> |
| <fileset dir="${turbine.plugin.src.resources}"/> |
| </copy> |
| </u:available> |
| </j:when> |
| <j:otherwise> |
| <echo>Skipping configuration because turbine.plugin.deploy.resources.skip is true</echo> |
| </j:otherwise> |
| </j:choose> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.deploy.scripts.skip') == null || !context.getVariable('turbine.plugin.deploy.scripts.skip').equalsIgnoreCase('true')}"> |
| <u:available file="${turbine.plugin.src.scripts}"> |
| <copy todir="${turbine.target.dir}/scripts"> |
| <fileset dir="${turbine.plugin.src.scripts}"/> |
| </copy> |
| </u:available> |
| </j:when> |
| <j:otherwise> |
| <echo>Skipping configuration because turbine.plugin.deploy.scripts.skip is true</echo> |
| </j:otherwise> |
| </j:choose> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.deploy.style.skip') == null || !context.getVariable('turbine.plugin.deploy.style.skip').equalsIgnoreCase('true')}"> |
| <u:available file="${turbine.plugin.src.style}"> |
| <copy todir="${turbine.target.dir}/style"> |
| <fileset dir="${turbine.plugin.src.style}"/> |
| </copy> |
| </u:available> |
| </j:when> |
| <j:otherwise> |
| <echo>Skipping configuration because turbine.plugin.deploy.style.skip is true</echo> |
| </j:otherwise> |
| </j:choose> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.deploy.templates.skip') == null || !context.getVariable('turbine.plugin.deploy.templates.skip').equalsIgnoreCase('true')}"> |
| <u:available file="${turbine.plugin.src.templates}"> |
| <copy todir="${turbine.target.dir}/templates"> |
| <fileset dir="${turbine.plugin.src.templates}"/> |
| </copy> |
| </u:available> |
| </j:when> |
| <j:otherwise> |
| <echo>Skipping configuration because turbine.plugin.deploy.templates.skip is true</echo> |
| </j:otherwise> |
| </j:choose> |
| |
| </goal> |
| <!-- ======================================================================== --> |
| <!-- turbine:deploy --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- turbine:install-libs --> |
| <!-- --> |
| <!-- When running as inplace application, it is necessary to copy the needed --> |
| <!-- artifacts from the POM inplace (WEB-INF/lib) for the application --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:install-libs" |
| description="updates the libraries for an inplace application" |
| prereqs="turbine:check-runtime-environment"> |
| |
| <j:if test="${context.getVariable('turbine.plugin.target.lib') != null && context.getVariable('turbine.plugin.target.lib') != ''}"> |
| <j:forEach var="dep" items="${pom.dependencies}"> |
| <j:if test="${dep.getProperty('war.bundle') != null && dep.getProperty('war.bundle').equalsIgnoreCase('true')}"> |
| <copy todir="${turbine.plugin.target.lib}" |
| file="${maven.repo.local}/${dep.getArtifactDirectory()}/jars/${dep.getArtifact()}"/> |
| </j:if> |
| </j:forEach> |
| </j:if> |
| </goal> |
| <!-- ======================================================================== --> |
| <!-- turbine:install-libs --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- Callback goals for use from the application maven.xml file. These goals --> |
| <!-- are normally called when maven processes another target and plug the --> |
| <!-- Turbine build system into other plugins. --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- clean:clean --> |
| <!-- --> |
| <!-- Cleanup inplace generated artifacts. --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:clean-clean"> |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.mode').equalsIgnoreCase('inplace')}"> |
| <ant:delete includeEmptyDirs="yes"> |
| <fileset dir="${turbine.plugin.target.lib}"> |
| <include name="**/*"/> |
| <exclude name="."/> |
| </fileset> |
| </ant:delete> |
| <ant:delete includeEmptyDirs="yes"> |
| <fileset dir="${maven.build.dest}"> |
| <include name="**/*"/> |
| <exclude name="."/> |
| <exclude name="**/*.properties"/> |
| </fileset> |
| </ant:delete> |
| </j:when> |
| </j:choose> |
| </goal> |
| <!-- ======================================================================== --> |
| <!-- clean --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- java:compile --> |
| <!-- --> |
| <!-- This moves the source tree around and calls the torque:om goal if --> |
| <!-- nececssary to merge all the source files before compilation. --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:java-compile" |
| prereqs="turbine:check-runtime-environment"> |
| |
| <j:if test="${turbine.plugin.torque.use}"> |
| <attainGoal name="turbine:torque-om-check"/> |
| </j:if> |
| |
| <path id="maven.compile.src.set"> |
| <pathelement location="${pom.build.SourceDirectory}"/> |
| </path> |
| |
| <j:if test="${!context.getVariable('turbine.plugin.mode').equalsIgnoreCase('inplace')}"> |
| <copy todir="${pom.build.SourceDirectory}" filtering="no"> |
| <fileset dir="${turbine.plugin.src.java}"/> |
| </copy> |
| </j:if> |
| |
| <j:if test="${turbine.plugin.torque.use}"> |
| <j:if test="${turbineInternalOmUpToDate != 'true'}"> |
| <echo>Building OM Source files from Schema...</echo> |
| <attainGoal name="torque:om"/> |
| </j:if> |
| </j:if> |
| |
| <property name="sourcesPresent" value="true"/> |
| </goal> |
| <!-- ======================================================================== --> |
| <!-- java:compile --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- torque:init --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:torque-init" prereqs="turbine:torque-copy-om"/> |
| <!-- ======================================================================== --> |
| <!-- torque:init --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- torque:insert-sql --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:torque-insert-sql" prereqs="turbine:sql"/> |
| <!-- ======================================================================== --> |
| <!-- torque:insert-sql --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- torque:datasql --> |
| <!-- --> |
| <!-- Before running datasql, copy the data files from the source --> |
| <!-- into the build tree --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:torque-datasql"> |
| <copy filtering="no" |
| todir="${torque.schema.dir}"> |
| <fileset dir="${turbine.plugin.src.schema}"> |
| <patternset includes = "*-data.xml"/> |
| <patternset includes = "*-data.dtd"/> |
| </fileset> |
| </copy> |
| </goal> |
| <!-- ======================================================================== --> |
| <!-- torque:datasql --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- torque:datadtd --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:torque-datadtd" prereqs="turbine:torque-copy-om"/> |
| <!-- ======================================================================== --> |
| <!-- torque:datadtd --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- war:webapp --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:war-webapp"> |
| <j:set var="webapp.build" value="target/${pom.artifactId}"/> |
| <j:set var="webapp.build.lib" value="target/${pom.artifactId}/WEB-INF/lib"/> |
| <j:set var="webapp.build.classes" value="target/${pom.artifactId}/WEB-INF/classes"/> |
| <j:set var="webapp.build.webinf" value="target/${pom.artifactId}/WEB-INF"/> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.deploy.config.skip') == null || !context.getVariable('turbine.plugin.deploy.config.skip').equalsIgnoreCase('true')}"> |
| <copy todir="${webapp.build.webinf}/conf" flatten="true" includeEmptyDirs="no"> |
| <fileset dir="${turbine.plugin.src.conf}"> |
| <exclude name="**/${pom.artifactId}-web.xml"/> |
| <exclude name="commons-logging.properties"/> |
| </fileset> |
| </copy> |
| </j:when> |
| <j:otherwise> |
| <echo>Skipping configuration because turbine.plugin.deploy.config.skip is true</echo> |
| </j:otherwise> |
| </j:choose> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.deploy.images.skip') == null || !context.getVariable('turbine.plugin.deploy.images.skip').equalsIgnoreCase('true')}"> |
| <u:available file="${turbine.plugin.src.images}"> |
| <mkdir dir="${webapp.build}/images"/> |
| <copy todir="${webapp.build}/images" includeEmptyDirs="no"> |
| <fileset dir="${turbine.plugin.src.images}"/> |
| </copy> |
| </u:available> |
| </j:when> |
| <j:otherwise> |
| <echo>Skipping configuration because turbine.plugin.deploy.images.skip is true</echo> |
| </j:otherwise> |
| </j:choose> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.deploy.pages.skip') == null || !context.getVariable('turbine.plugin.deploy.pages.skip').equalsIgnoreCase('true')}"> |
| <u:available file="${turbine.plugin.src.pages}"> |
| <copy todir="${webapp.build}" includeEmptyDirs="no"> |
| <fileset dir="${turbine.plugin.src.pages}"/> |
| </copy> |
| </u:available> |
| </j:when> |
| <j:otherwise> |
| <echo>Skipping configuration because turbine.plugin.deploy.pages.skip is true</echo> |
| </j:otherwise> |
| </j:choose> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.deploy.resources.skip') == null || !context.getVariable('turbine.plugin.deploy.resources.skip').equalsIgnoreCase('true')}"> |
| <u:available file="${turbine.plugin.src.resources}"> |
| <mkdir dir="${webapp.build}/resources"/> |
| <copy todir="${webapp.build}/resources" includeEmptyDirs="no"> |
| <fileset dir="${turbine.plugin.src.resources}"/> |
| </copy> |
| </u:available> |
| </j:when> |
| <j:otherwise> |
| <echo>Skipping configuration because turbine.plugin.deploy.resources.skip is true</echo> |
| </j:otherwise> |
| </j:choose> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.deploy.scripts.skip') == null || !context.getVariable('turbine.plugin.deploy.scripts.skip').equalsIgnoreCase('true')}"> |
| <u:available file="${turbine.plugin.src.scripts}"> |
| <mkdir dir="${webapp.build}/scripts"/> |
| <copy todir="${webapp.build}/scripts" includeEmptyDirs="no"> |
| <fileset dir="${turbine.plugin.src.scripts}"/> |
| </copy> |
| </u:available> |
| </j:when> |
| <j:otherwise> |
| <echo>Skipping configuration because turbine.plugin.deploy.scripts.skip is true</echo> |
| </j:otherwise> |
| </j:choose> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.deploy.style.skip') == null || !context.getVariable('turbine.plugin.deploy.style.skip').equalsIgnoreCase('true')}"> |
| <u:available file="${turbine.plugin.src.style}"> |
| <mkdir dir="${webapp.build}/style"/> |
| <copy todir="${webapp.build}/style" includeEmptyDirs="no"> |
| <fileset dir="${turbine.plugin.src.style}"/> |
| </copy> |
| </u:available> |
| </j:when> |
| <j:otherwise> |
| <echo>Skipping configuration because turbine.plugin.deploy.style.skip is true</echo> |
| </j:otherwise> |
| </j:choose> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.plugin.deploy.templates.skip') == null || !context.getVariable('turbine.plugin.deploy.templates.skip').equalsIgnoreCase('true')}"> |
| <u:available file="${turbine.plugin.src.templates}"> |
| <mkdir dir="${webapp.build}/templates"/> |
| <copy todir="${webapp.build}/templates" includeEmptyDirs="no"> |
| <fileset dir="${turbine.plugin.src.templates}"/> |
| </copy> |
| </u:available> |
| </j:when> |
| <j:otherwise> |
| <echo>Skipping configuration because turbine.plugin.deploy.templates.skip is true</echo> |
| </j:otherwise> |
| </j:choose> |
| |
| </goal> |
| <!-- ======================================================================== --> |
| <!-- war:webapp --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- Private goals --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- turbine:init --> |
| <!-- --> |
| <!-- Setup the Plugin. Create necessary taglibs, load configuration --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:init"> |
| <define:taglib uri="http://turbine.apache.org/meta/taglib"> |
| <define:tag name="requiredPropertyMissing"> |
| <fail> |
| -------------------------------------------------------------------------- |
| | Plugin Configuration Error | |
| -------------------------------------------------------------------------- |
| |
| A required property is missing a value. |
| |
| Property name: ${propname} |
| |
| Errors must be corrected before using this plugin. |
| |
| -------------------------------------------------------------------------- |
| </fail> |
| </define:tag> |
| |
| <define:tag name="copyFlavorFile"> |
| |
| <u:available file="${plugin.resources}/flavor/common/${fromfile}"> |
| <ant:copy tofile="${tofile}" filtering="${filtering}" overwrite="true" |
| file="${plugin.resources}/flavor/common/${fromfile}"/> |
| </u:available> |
| |
| <u:available file="${plugin.resources}/flavor/${flavor}/${fromfile}"> |
| <ant:copy tofile="${tofile}" filtering="${filtering}" overwrite="true" |
| file="${plugin.resources}/flavor/${flavor}/${fromfile}"/> |
| </u:available> |
| |
| </define:tag> |
| |
| <define:tag name="copyFlavorDir"> |
| |
| <u:available file="${plugin.resources}/flavor/common/${frompath}"> |
| <ant:copy todir="${todir}" filtering="${filtering}" overwrite="true" > |
| <ant:fileset dir="${plugin.resources}/flavor/common/${frompath}"> |
| <include name="${include}"/> |
| <exclude name="${exclude}"/> |
| </ant:fileset> |
| </ant:copy> |
| </u:available> |
| |
| <u:available file="${plugin.resources}/flavor/${flavor}/${frompath}"> |
| <ant:copy todir="${todir}" filtering="${filtering}" overwrite="true" > |
| <ant:fileset dir="${plugin.resources}/flavor/${flavor}/${frompath}"> |
| <include name="${include}"/> |
| <exclude name="${exclude}"/> |
| </ant:fileset> |
| </ant:copy> |
| </u:available> |
| |
| </define:tag> |
| |
| <define:tag name="copyOmFile"> |
| |
| <u:available file="${plugin.resources}/om-layer/${omLayer}/${fromfile}"> |
| <ant:copy tofile="${tofile}" filtering="${filtering}" overwrite="true" |
| file="${plugin.resources}/om-layer/${omLayer}/${fromfile}"/> |
| </u:available> |
| |
| </define:tag> |
| |
| <define:tag name="copyOmDir"> |
| |
| <u:available file="${plugin.resources}/om-layer/${omLayer}/${frompath}"> |
| <ant:copy todir="${todir}" filtering="${filtering}" overwrite="true" > |
| <ant:fileset dir="${plugin.resources}/om-layer/${omLayer}/${frompath}"> |
| <include name="${include}"/> |
| <exclude name="${exclude}"/> |
| </ant:fileset> |
| </ant:copy> |
| </u:available> |
| |
| </define:tag> |
| |
| <!-- Can you actually believe _this_ maven stupidity? Obviously property |
| files loaded by the core are subject to some magic that changes the |
| embedded variables to their values. |
| |
| Emulate this by some heavy maven magic. Gee, is there actually _any_ |
| documentation on this? |
| --> |
| <define:tag name="evalProperty"> |
| <j:invokeStatic var="_result" method="decomposeExpression" |
| className="org.apache.maven.jelly.JellyUtils"> |
| <j:arg type="java.lang.String" value="${value}" /> |
| <j:arg type="org.apache.commons.jelly.JellyContext" value="${context}"/> |
| </j:invokeStatic> |
| <j:set var="_propname" value="${name}"/> |
| <j:set var="${_propname}" scope="parent">${_result}</j:set> |
| </define:tag> |
| |
| <define:tag name="copyTurbineDemoDir"> |
| |
| <u:available file="${plugin.resources}/demo/${frompath}"> |
| <ant:copy todir="${todir}" filtering="${filtering}" overwrite="true" > |
| <ant:fileset dir="${plugin.resources}/demo/${frompath}"> |
| <include name="${include}"/> |
| <exclude name="${exclude}"/> |
| </ant:fileset> |
| </ant:copy> |
| </u:available> |
| |
| </define:tag> |
| |
| </define:taglib> |
| </goal> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- turbine:check-environment --> |
| <!-- --> |
| <!-- Check runtime and setup environment to be correctly configured --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:check-runtime-environment" |
| prereqs="turbine:init"> |
| |
| <j:set var="pluginMode" value="${turbine.plugin.mode}"/> |
| |
| <j:set var="turbine.plugin.torque.use" value="${context.getVariable('turbine.app.om.layer') != null && context.getVariable('turbine.app.om.layer').equalsIgnoreCase('torque')}" /> |
| <j:set var="turbine.plugin.none.use" value="${context.getVariable('turbine.app.om.layer') != null && context.getVariable('turbine.app.om.layer').equalsIgnoreCase('none')}" /> |
| |
| <j:set var="turbine.plugin.om.torque.idtable" value="${context.getVariable('turbine.app.torque.use.idtable') == null || context.getVariable('turbine.app.torque.use.idtable').equalsIgnoreCase('true')}" /> |
| |
| |
| <j:if test="${context.getVariable('maven.appserver.name') == null || context.getVariable('maven.appserver.name') == ''}"> |
| <meta:requiredPropertyMissing propname="maven.appserver.name" /> |
| </j:if> |
| |
| <j:if test="${turbine.plugin.torque.use}"> |
| <j:if test="${context.getVariable('torque.database') == null || context.getVariable('torque.database') == ''}"> |
| <meta:requiredPropertyMissing propname="torque.database" /> |
| </j:if> |
| </j:if> |
| |
| <j:choose> |
| <j:when test="${pluginMode.equalsIgnoreCase('normal')}"> |
| <j:if test="${context.getVariable('maven.appserver.home') == null || context.getVariable('maven.appserver.home') == ''}"> |
| <meta:requiredPropertyMissing propname="maven.appserver.home" /> |
| </j:if> |
| </j:when> |
| <j:when test="${pluginMode.equalsIgnoreCase('inplace')}"> |
| <j:if test="${context.getVariable('turbine.plugin.inplace.dir') == null || context.getVariable('turbine.plugin.inplace.dir') == ''}"> |
| <j:set var="turbine.plugin.inplace.dir" value="." /> |
| </j:if> |
| </j:when> |
| </j:choose> |
| </goal> |
| |
| <goal name="turbine:check-setup-environment" |
| prereqs="turbine:check-runtime-environment"> |
| <j:if test="${context.getVariable('turbine.app.name') == null || context.getVariable('turbine.app.name') == ''}"> |
| <meta:requiredPropertyMissing propname="turbine.app.name" /> |
| </j:if> |
| |
| <ant:condition property="flavorExists"> |
| <or> |
| <ant:available type="dir" file="${plugin.resources}/flavor/${turbine.app.flavor}/maven" /> |
| </or> |
| </ant:condition> |
| |
| <j:if test="${flavorExists != 'true'}"> |
| <fail> |
| -------------------------------------------------------------------------- |
| | Flavor not found Error | |
| -------------------------------------------------------------------------- |
| |
| The requested flavor (${turbine.app.flavor}) was not found in the |
| current version (${plugin.currentVersion}) of M.E.T.A. |
| |
| -------------------------------------------------------------------------- |
| </fail> |
| </j:if> |
| |
| <ant:condition property="omLayerExists"> |
| <or> |
| <ant:available type="dir" file="${plugin.resources}/om-layer/${turbine.app.om.layer}/conf" /> |
| </or> |
| </ant:condition> |
| |
| <j:if test="${omLayerExists != 'true'}"> |
| <fail> |
| -------------------------------------------------------------------------- |
| | OM layer not found Error | |
| -------------------------------------------------------------------------- |
| |
| The requested OM layer (${turbine.app.om.layer}) was not found in the |
| current version (${plugin.currentVersion}) of M.E.T.A. |
| |
| -------------------------------------------------------------------------- |
| </fail> |
| </j:if> |
| |
| <j:set var="pluginMode" value="${turbine.plugin.mode}" /> |
| <j:set var="pluginProperties" value="${plugin.resources}/mode/${pluginMode}.properties"/> |
| <j:choose> |
| <j:when test="${pluginMode.equalsIgnoreCase('normal')}"> |
| <j:set var="webXmlName" value="${turbine.app.name}-web.xml" /> |
| </j:when> |
| <j:when test="${pluginMode.equalsIgnoreCase('inplace')}"> |
| <j:set var="webXmlName" value="web.xml" /> |
| </j:when> |
| <j:otherwise> |
| <fail> |
| -------------------------------------------------------------------------- |
| | Mode not found Error | |
| -------------------------------------------------------------------------- |
| |
| The requested mode (${turbine.plugin.mode}) was not found in the |
| current version (${plugin.currentVersion}) of M.E.T.A. |
| |
| -------------------------------------------------------------------------- |
| </fail> |
| </j:otherwise> |
| </j:choose> |
| |
| <!-- |
| Location of the base files (maven.xml, project.properties) is turbine.app.root.dir. |
| This is valid only for the turbine:setup; when running the runtime targets, this is |
| always the current ('.') directory |
| |
| Location of the file tree is turbine.app.base.dir, relative to turbine.app.root.dir |
| --> |
| |
| <j:choose> |
| <j:when test="${context.getVariable('turbine.app.subdir').equalsIgnoreCase('false')}"> |
| <ant:property name="turbine.plugin.root.dir" value="."/> |
| </j:when> |
| <j:otherwise> |
| <ant:property name="turbine.plugin.root.dir" value="${turbine.app.name}"/> |
| </j:otherwise> |
| </j:choose> |
| |
| <j:choose> |
| <j:when test="${pluginMode.equalsIgnoreCase('inplace')}"> |
| <ant:property name="turbine.plugin.base.dir" value="${turbine.plugin.inplace.dir}"/> |
| </j:when> |
| <j:otherwise> |
| <ant:property name="turbine.plugin.base.dir" value="."/> |
| </j:otherwise> |
| </j:choose> |
| |
| <u:available file="${pluginProperties}"> |
| <u:properties file="${pluginProperties}" var="_properties"/> |
| <j:forEach var="_property" items="${_properties.keys()}"> |
| <j:set var="_propname" value="${_property}"/> |
| <j:set var="_propval" value="${context.getVariable(_propname)}"/> |
| |
| <j:if test="${_propval == null || _propname == 'maven.build.dest'}"> |
| <meta:evalProperty name="${_propname}" value="${_properties.getProperty(_property)}" /> |
| </j:if> |
| </j:forEach> |
| </u:available> |
| |
| <j:set var="maven.war.webxml" value="${turbine.plugin.webxml.dir}/${webXmlName}" /> |
| </goal> |
| <!-- ======================================================================== --> |
| <!-- turbine:check-environment --> |
| <!-- ======================================================================== --> |
| |
| <!-- ================================================================== --> |
| <!-- --> |
| <!-- turbine:torque-copy-om --> |
| <!-- --> |
| <!-- Prepare the XML files for building the OM peer classes --> |
| <!-- --> |
| <!-- ================================================================== --> |
| <goal name="turbine:torque-copy-om" |
| prereqs="turbine:torque-copy-security-om, turbine:torque-copy-app-om, turbine:torque-copy-data-dtd"> |
| |
| <j:if test="${turbine.plugin.om.torque.idtable}"> |
| <attainGoal name="turbine:torque-copy-id-table-om" /> |
| </j:if> |
| </goal> |
| |
| <!-- ================================================================== --> |
| <!-- --> |
| <!-- turbine:copy-security-om --> |
| <!-- --> |
| <!-- Set up the Turbine Security Service Tables --> |
| <!-- --> |
| <!-- ================================================================== --> |
| <goal name="turbine:torque-copy-security-om"> |
| <j:if test="${turbineInternalSecurityUpToDate != 'true'}"> |
| <filter token="DATABASE_DEFAULT" value="${turbine.app.om.security.name}"/> |
| <filter token="DATABASE_PACKAGE" value="${turbine.app.om.security.package}"/> |
| <copy filtering="yes" overwrite="yes" |
| file="${turbine.plugin.src.schema}/turbine-security-schema.xml" |
| tofile="${torque.schema.dir}/turbine-security-schema.xml"/> |
| <j:set var="turbineInternalSecurityUpToDate" value="true" /> |
| </j:if> |
| </goal> |
| |
| <!-- ================================================================== --> |
| <!-- --> |
| <!-- turbine:copy-app-om --> |
| <!-- --> |
| <!-- Set up the application specific database tables --> |
| <!-- --> |
| <!-- ================================================================== --> |
| <goal name="turbine:torque-copy-app-om"> |
| <j:if test="${turbineInternalAppUpToDate != 'true'}"> |
| <filter token="DATABASE_DEFAULT" value="${turbine.app.om.name}"/> |
| <filter token="DATABASE_PACKAGE" value="${turbine.app.om.package}"/> |
| <copy filtering="yes" overwrite="yes" |
| file="${turbine.plugin.src.schema}/${turbine.app.name}-schema.xml" |
| tofile="${torque.schema.dir}/${turbine.app.name}-schema.xml"/> |
| <j:set var="turbineInternalAppUpToDate" value="true" /> |
| </j:if> |
| </goal> |
| |
| <!-- ================================================================== --> |
| <!-- --> |
| <!-- turbine:copy-id-table-om --> |
| <!-- --> |
| <!-- Set up the Torque ID Broker Table --> |
| <!-- --> |
| <!-- ================================================================== --> |
| <goal name="turbine:torque-copy-id-table-om"> |
| <j:if test="${turbineInternalIdTableUpToDate != 'true'}"> |
| <filter token="DATABASE_DEFAULT" value="${turbine.app.om.name}"/> |
| <filter token="DATABASE_PACKAGE" value="${turbine.app.om.package}"/> |
| <copy filtering="yes" overwrite="yes" |
| file="${turbine.plugin.src.schema}/id-table-schema.xml" |
| tofile="${torque.schema.dir}/${turbine.app.name}-id-table-schema.xml"/> |
| |
| <!-- If we have different data source for Application and Security, we must |
| also set up two ID Table XML files |
| --> |
| <j:set var="securityOmName" value="${turbine.app.om.security.name}"/> |
| <j:set var="omName" value="${turbine.app.om.name}"/> |
| <j:if test="${!omName.equals(securityOmName)}"> |
| <filter token="DATABASE_DEFAULT" value="${turbine.app.om.security.name}"/> |
| <filter token="DATABASE_PACKAGE" value="${turbine.app.om.security.package}"/> |
| <copy filtering="yes" overwrite="yes" |
| file="${turbine.plugin.src.schema}/id-table-schema.xml" |
| tofile="${torque.schema.dir}/security-id-table-schema.xml"/> |
| </j:if> |
| <j:set var="turbineInternalIdTableUpToDate" value="true" /> |
| </j:if> |
| </goal> |
| |
| <!-- ================================================================== --> |
| <!-- --> |
| <!-- turbine:copy-data-dtd --> |
| <!-- --> |
| <!-- Set up the Torque ID Broker Table --> |
| <!-- --> |
| <!-- ================================================================== --> |
| <goal name="turbine:torque-copy-data-dtd"> |
| <j:if test="${turbineInternalDataDTDUpToDate != 'true'}"> |
| <copy overwrite="true" |
| todir="${torque.schema.dir}"> |
| <fileset dir="${turbine.plugin.src.schema}"> |
| <patternset includes = "*-data.dtd"/> |
| </fileset> |
| </copy> |
| <j:set var="turbineInternalDataDTDUpToDate" value="true" /> |
| </j:if> |
| </goal> |
| <!-- ================================================================== --> |
| <!-- turbine:copy-data-dtd --> |
| <!-- ================================================================== --> |
| |
| <!-- ================================================================== --> |
| <!-- turbine:om-check --> |
| <!-- --> |
| <!-- Lifted from the torque plugin. We cannot use torque:om-check --> |
| <!-- directly because this would call torque:init which in turn then --> |
| <!-- calls the preGoal above which copies the schema files to the --> |
| <!-- target/xml directory and the test would be false all the time. --> |
| <!-- --> |
| <!-- If we set overwrite to "no" so that the files are kept then --> |
| <!-- changes in the schema files would not be propagated unless the --> |
| <!-- target/xml directory is cleaned out manually. So we prefer to --> |
| <!-- keep our own test target around. --> |
| <!-- --> |
| <!-- ================================================================== --> |
| <goal name="turbine:torque-om-check"> |
| <j:choose> |
| <j:when test="${torque.runOnlyOnSchemaChange}"> |
| <uptodate |
| property="turbineInternalOmUpToDate" |
| targetfile="${torque.java.dir}/report.${torque.project}.om.generation"> |
| <srcfiles dir="${turbine.plugin.src.schema}" includes="**/*-schema.xml" /> |
| </uptodate> |
| </j:when> |
| <j:otherwise> |
| <j:set var="turbineInternalOmUpToDate" value="false"/> |
| </j:otherwise> |
| </j:choose> |
| |
| </goal> |
| <!-- ================================================================== --> |
| <!-- turbine:om-check --> |
| <!-- ================================================================== --> |
| |
| |
| <!-- ================================================================== --> |
| <!-- turbine:security-datasql --> |
| <!-- --> |
| <!-- Insert Data file for the Torque based security objects. --> |
| <!-- --> |
| <!-- ================================================================== --> |
| <goal name="turbine:torque-security-datasql" |
| prereqs="torque:init"> |
| |
| <torque-data-sql |
| contextProperties="${torque.contextProperties}" |
| controlTemplate="${torque.template.dataSql}" |
| dataDTD="${torque.schema.dir}/turbine-security-data.dtd" |
| dataXmlFile="${torque.schema.dir}/turbine-security-data.xml" |
| outputDirectory="${torque.sql.dir}" |
| outputFile="turbine-security-data.sql" |
| sqldbmap="${torque.sql.dir}/sqldb.map" |
| targetDatabase="${torque.database}" |
| templatePath="${torque.templatePath}" |
| useClasspath="${torque.useClasspath}" |
| xmlFile="${torque.schema.dir}/turbine-security-schema.xml" |
| /> |
| </goal> |
| <!-- ================================================================== --> |
| <!-- turbine:security-datasql --> |
| <!-- ================================================================== --> |
| |
| <!-- ================================================================== --> |
| <!-- turbine:security-datadtd --> |
| <!-- --> |
| <!-- Generate a DTD for the Torque based Turbine security objects. --> |
| <!-- --> |
| <!-- ================================================================== --> |
| <goal name="turbine:torque-security-datadtd" |
| prereqs="torque:init"> |
| |
| <torque-data-model |
| contextProperties="${torque.contextProperties}" |
| controlTemplate="${torque.template.dataDtd}" |
| outputDirectory="${torque.output.dir}" |
| outputFile="report.turbine-security.datadtd.generation" |
| templatePath="${torque.templatePath}" |
| useClasspath="${torque.useClasspath}" |
| xmlFile="${torque.schema.dir}/turbine-security-schema.xml" |
| /> |
| </goal> |
| <!-- ================================================================== --> |
| <!-- turbine:security-datadtd --> |
| <!-- ================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- turbine:install-demo --> |
| <!-- --> |
| <!-- Put the demo pages into a newly created application. Should be called --> |
| <!-- only from turbine:setup! --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:install-demo"> |
| |
| <meta:copyTurbineDemoDir todir="${turbine.plugin.root.dir}/${turbine.plugin.src.templates}" |
| filtering="true" |
| frompath="templates" |
| include="**/*"/> |
| |
| <meta:copyTurbineDemoDir todir="${turbine.plugin.root.dir}/${turbine.plugin.src.images}" |
| filtering="false" |
| frompath="images" |
| include="**/*"/> |
| |
| <meta:copyTurbineDemoDir todir="${turbine.plugin.root.dir}/${turbine.plugin.src.resources}" |
| filtering="true" |
| frompath="resources" |
| include="**/*"/> |
| |
| <meta:copyTurbineDemoDir todir="${turbine.plugin.root.dir}/${turbine.plugin.src.style}" |
| filtering="true" |
| frompath="style" |
| include="**/*"/> |
| |
| <meta:copyTurbineDemoDir todir="${turbine.plugin.root.dir}/${turbine.plugin.src.pages}" |
| filtering="true" |
| frompath="pages" |
| include="**/*"/> |
| </goal> |
| |
| <!-- ======================================================================== --> |
| <!-- turbine:install-demo --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- turbine:setup-torque --> |
| <!-- --> |
| <!-- Install Torque schema files into the new application --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:setup-torque"> |
| |
| </goal> |
| <!-- ======================================================================== --> |
| <!-- turbine:setup-torque --> |
| <!-- ======================================================================== --> |
| |
| <!-- ======================================================================== --> |
| <!-- --> |
| <!-- turbine:torque-sql --> |
| <!-- --> |
| <!-- Generate SQL files when Torque is selected as OM Layer --> |
| <!-- --> |
| <!-- ======================================================================== --> |
| <goal name="turbine:torque-sql"> |
| |
| <attainGoal name="torque:sql"/> |
| |
| <j:if test="${turbine.plugin.om.torque.idtable}"> |
| <attainGoal name="torque:id-table-init-sql"/> |
| </j:if> |
| |
| <u:available file="${turbine.plugin.src.schema}/${turbine.app.name}-data.xml"> |
| <attainGoal name="torque:datasql"/> |
| </u:available> |
| |
| <u:available file="${turbine.plugin.src.schema}/turbine-security-data.xml"> |
| <attainGoal name="turbine:torque-security-datasql"/> |
| </u:available> |
| |
| </goal> |
| <!-- ======================================================================== --> |
| <!-- turbine:setup-torque --> |
| <!-- ======================================================================== --> |
| </project> |