[Yanel-commits] rev 47465 - in public/yanel/trunk/src/build: .
targets targets/webapp
michi at wyona.com
michi at wyona.com
Sat Feb 6 21:53:36 CET 2010
Author: michi
Date: 2010-02-06 21:53:35 +0100 (Sat, 06 Feb 2010)
New Revision: 47465
Modified:
public/yanel/trunk/src/build/build.xml
public/yanel/trunk/src/build/targets/config.xml
public/yanel/trunk/src/build/targets/webapp/cluster.xml
public/yanel/trunk/src/build/targets/webapp/webapp.xml
Log:
build slightly refactored
Modified: public/yanel/trunk/src/build/build.xml
===================================================================
--- public/yanel/trunk/src/build/build.xml 2010-02-06 14:47:51 UTC (rev 47464)
+++ public/yanel/trunk/src/build/build.xml 2010-02-06 20:53:35 UTC (rev 47465)
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<project name="yanel-main" default="deploy"
+<project name="yanel-main" default="deploy-to-tomcat"
xmlns:yanel="http://www.wyona.org/yanel/1.0"
xmlns:wyona-tools="http://www.wyona.org/tools/1.0"
xmlns:svnant="antlib:org.tigris.subversion.svnant"
@@ -268,13 +268,13 @@
<property name="answerDeleteLocalConfigDir" value="NO"/>
<antcall target="clean-all"/>
- <property name="answer" value="NO"/> <!-- No further configuration -->
+ <property name="answerContinueConfig" value="NO"/> <!-- No further configuration -->
<property name="answerReconfigureTomcat1" value="no"/> <!-- No SSL -->
<property name="answerAskForCustomTomcatPath" value="NO"/> <!-- No custom Tomcat -->
<antcall target="config"/>
- <property name="answer" value="YES"/> <!-- add endorsed libs -->
- <antcall target="deploy"/>
+ <property name="answerCopyEndorsedJar" value="YES"/> <!-- add endorsed libs -->
+ <antcall target="deploy-to-tomcat"/>
</target>
</project>
Modified: public/yanel/trunk/src/build/targets/config.xml
===================================================================
--- public/yanel/trunk/src/build/targets/config.xml 2010-02-06 14:47:51 UTC (rev 47464)
+++ public/yanel/trunk/src/build/targets/config.xml 2010-02-06 20:53:35 UTC (rev 47465)
@@ -42,10 +42,10 @@
-->
<antcall target="first-time-user-configuration-message"/>
- <input message="Do you want to continue the configuration nevertheless? (yes/NO)" addproperty="answer" defaultvalue="NO"/>
+ <input message="Do you want to continue the configuration nevertheless? (yes/NO)" addproperty="answerContinueConfig" defaultvalue="NO"/>
<condition property="yes.continue">
- <equals arg1="yes" arg2="${answer}"/>
+ <equals arg1="yes" arg2="${answerContinueConfig}"/>
</condition>
<antcall target="configure-local"/>
</target>
Modified: public/yanel/trunk/src/build/targets/webapp/cluster.xml
===================================================================
--- public/yanel/trunk/src/build/targets/webapp/cluster.xml 2010-02-06 14:47:51 UTC (rev 47464)
+++ public/yanel/trunk/src/build/targets/webapp/cluster.xml 2010-02-06 20:53:35 UTC (rev 47465)
@@ -27,23 +27,79 @@
<touch file="${log4j.path}/access-cnode1.log"/>
<antcall target="patch-tomcat-cluster-node-1-ssl-port"/>
-
- <yanel:check-endorsed-jar jarId="stax-api"/>
-
- <yanel:check-endorsed-jar jarId="stax-impl"/>
+
+ <yanel:check-copy-endorsed-jar jarId="stax-api" nodeId="1"/>
+ <yanel:check-copy-endorsed-jar jarId="stax-impl" nodeId="1"/>
</target>
- <macrodef name="check-endorsed-jar" uri="http://www.wyona.org/yanel/1.0">
+ <macrodef name="check-copy-endorsed-jar" uri="http://www.wyona.org/yanel/1.0">
+ <attribute name="jarId" default="stax-api"/>
+ <attribute name="nodeId" default="1"/>
+
+ <sequential>
+ <echo>Check if lib '${tomcat@{nodeId}.home.dir}/common/endorsed/${@{jarId}.artifactId}-${@{jarId}.version}.jar' exists</echo>
+ <condition property="endorsed-lib-at-node-does-not-exist-yet">
+ <not>
+ <available file="${tomcat@{nodeId}.home.dir}/common/endorsed/${@{jarId}.artifactId}-${@{jarId}.version}.jar"/>
+ </not>
+ </condition>
+ <antcall target="ask-to-copy-endorsed-@{jarId}-to-node@{nodeId}"/>
+ </sequential>
+ </macrodef>
+
+ <target name="ask-to-copy-endorsed-stax-api-to-node1" if="endorsed-lib-at-node-does-not-exist-yet">
+ <yanel:ask-to-copy-endorsed-lib-to-node jarId="stax-api" nodeId="1"/>
+ </target>
+
+ <target name="ask-to-copy-endorsed-stax-impl-to-node1" if="endorsed-lib-at-node-does-not-exist-yet">
+ <yanel:ask-to-copy-endorsed-lib-to-node jarId="stax-impl" nodeId="1"/>
+ </target>
+
+ <target name="ask-to-copy-endorsed-stax-api-to-node2" if="endorsed-lib-at-node-does-not-exist-yet">
+ <yanel:ask-to-copy-endorsed-lib-to-node jarId="stax-api" nodeId="2"/>
+ </target>
+
+ <target name="ask-to-copy-endorsed-stax-impl-to-node2" if="endorsed-lib-at-node-does-not-exist-yet">
+ <yanel:ask-to-copy-endorsed-lib-to-node jarId="stax-impl" nodeId="2"/>
+ </target>
+
+ <macrodef name="ask-to-copy-endorsed-lib-to-node" uri="http://www.wyona.org/yanel/1.0">
+ <attribute name="jarId" default="stax-api"/>
+ <attribute name="nodeId" default="1"/>
+ <sequential>
+ <echo>IMPORTANT: Please note that your Tomcat might already contain an endorsed '${@{jarId}.artifactId}-${@{jarId}.version}.jar' library at '${tomcat@{nodeId}.home.dir}/common/endorsed/'. Please make sure to resolve any conflicts!</echo>
+ <input message="Endorsed lib is missing '${@{jarId}.artifactId}-${@{jarId}.version}.jar'. Do you want it to be added? (YES/no):" addproperty="answerCopyEndorsedJar" defaultvalue="YES"/>
+
+ <condition property="do-copy-endorsed-lib-to-node">
+ <equals arg1="YES" arg2="${answerCopyEndorsedJar}"/>
+ </condition>
+ <antcall target="copy-endorsed-@{jarId}-to-node@{nodeId}"/>
+ </sequential>
+ </macrodef>
+
+ <target name="copy-endorsed-stax-api-to-node1" if="do-copy-endorsed-lib-to-node">
+ <yanel:do-copy-endorsed-jar jarId="stax-api" nodeId="1"/>
+ </target>
+
+ <target name="copy-endorsed-stax-impl-to-node1" if="do-copy-endorsed-lib-to-node">
+ <yanel:do-copy-endorsed-jar jarId="stax-impl" nodeId="1"/>
+ </target>
+
+ <target name="copy-endorsed-stax-api-to-node2" if="do-copy-endorsed-lib-to-node">
+ <yanel:do-copy-endorsed-jar jarId="stax-api" nodeId="2"/>
+ </target>
+
+ <target name="copy-endorsed-stax-impl-to-node2" if="do-copy-endorsed-lib-to-node">
+ <yanel:do-copy-endorsed-jar jarId="stax-impl" nodeId="2"/>
+ </target>
+
+ <macrodef name="do-copy-endorsed-jar" uri="http://www.wyona.org/yanel/1.0">
<attribute name="jarId"/>
- <attribute name="serverNode" default="1"/>
- <attribute name="target-dir" default="${tomcat@{serverNode}.home.dir}/common/endorsed"/>
+ <attribute name="nodeId" default="1"/>
+
<sequential>
- <condition property="endorsed-@{jarId}-at-node@{serverNode}-does-not-exist-yet">
- <not>
- <available file="@{target-dir}/${@{jarId}.artifactId}-${@{jarId}.version}.jar"/>
- </not>
- </condition>
- <antcall target="ask-to-copy-endorsed-@{jarId}-to-node@{serverNode}"/>
+ <copy file="${yanel.source.home}/build/webapps/${servlet.context.prefix}/WEB-INF/lib/${@{jarId}.artifactId}-${@{jarId}.version}.jar" todir="${tomcat@{nodeId}.home.dir}/common/endorsed" overwrite="false"/>
+ <echo>INFO: ${@{jarId}.artifactId}-${@{jarId}.version}.jar has been copied!</echo>
</sequential>
</macrodef>
@@ -99,73 +155,10 @@
<antcall target="patch-tomcat-cluster-node-2-ssl-port"/>
- <yanel:check-endorsed-jar jarId="stax-api" serverNode="2"/>
-
- <yanel:check-endorsed-jar jarId="stax-impl" serverNode="2"/>
+ <yanel:check-copy-endorsed-jar jarId="stax-api" nodeId="2"/>
+ <yanel:check-copy-endorsed-jar jarId="stax-impl" nodeId="2"/>
</target>
-
-
- <!--XXX HACK: The following code is still mostly copy-paste, but is much better than before fixing bug 7001! -->
-
- <target name="ask-to-copy-endorsed-stax-api-to-node1" if="endorsed-stax-api-at-node1-does-not-exist-yet">
- <yanel:ask-to-copy-endorsed-jar jarId="stax-api"/>
- </target>
-
- <target name="ask-to-copy-endorsed-stax-api-to-node2" if="endorsed-stax-api-at-node2-does-not-exist-yet">
- <yanel:ask-to-copy-endorsed-jar jarId="stax-api" serverNode="2"/>
- </target>
-
- <target name="ask-to-copy-endorsed-stax-impl-to-node1" if="endorsed-stax-impl-at-node1-does-not-exist-yet">
- <yanel:ask-to-copy-endorsed-jar jarId="stax-impl"/>
- </target>
-
- <target name="ask-to-copy-endorsed-stax-impl-to-node2" if="endorsed-stax-impl-at-node2-does-not-exist-yet">
- <yanel:ask-to-copy-endorsed-jar jarId="stax-impl" serverNode="2"/>
- </target>
-
- <macrodef name="ask-to-copy-endorsed-jar" uri="http://www.wyona.org/yanel/1.0">
- <attribute name="jarId"/>
- <attribute name="serverNode" default="1"/>
- <attribute name="targetDir" default="${tomcat@{serverNode}.home.dir}/common/endorsed"/>
- <sequential>
- <echo>IMPORTANT: Please note that your Tomcat might already contain an endorsed @{jarId} library at '@{targetDir}/'. Please make sure to resolve any conflicts!</echo>
- <input message="Endorsed lib is missing (@{targetDir}/${@{jarId}.artifactId}-${@{jarId}.version}.jar). Do you want it to be added? (YES/no):" addproperty="answer"/>
- <condition property="do-not-copy-endorsed-@{jarId}-to-node@{serverNode}">
- <equals arg1="no" arg2="${answer}"/>
- </condition>
- <antcall target="do-copy-endorsed-@{jarId}-to-node@{serverNode}"/>
- </sequential>
- </macrodef>
-
- <target name="do-copy-endorsed-stax-api-to-node1" unless="do-not-copy-endorsed-stax-api-to-node1">
- <yanel:do-copy-endorsed-jar jarId="stax-api"/>
- </target>
-
- <target name="do-copy-endorsed-stax-api-to-node2" unless="do-not-copy-endorsed-stax-api-to-node2">
- <yanel:do-copy-endorsed-jar jarId="stax-api" serverNode="2"/>
- </target>
-
- <target name="do-copy-endorsed-stax-impl-to-node1" unless="do-not-copy-endorsed-stax-impl-to-node1">
- <yanel:do-copy-endorsed-jar jarId="stax-impl"/>
- </target>
-
- <target name="do-copy-endorsed-stax-impl-to-node2" unless="do-not-copy-endorsed-stax-impl-to-node2">
- <yanel:do-copy-endorsed-jar jarId="stax-impl" serverNode="2"/>
- </target>
-
- <macrodef name="do-copy-endorsed-jar" uri="http://www.wyona.org/yanel/1.0">
- <attribute name="jarId"/>
- <attribute name="serverNode" default="1"/>
- <attribute name="targetDir" default="${tomcat@{serverNode}.home.dir}/common/endorsed"/>
- <sequential>
- <copy file="${yanel.source.home}/build/webapps/${servlet.context.prefix}/WEB-INF/lib/${@{jarId}.artifactId}-${@{jarId}.version}.jar" todir="@{targetDir}" overwrite="false"/>
- <echo>INFO: ${@{jarId}.artifactId}-${@{jarId}.version}.jar has been copied!</echo>
- </sequential>
- </macrodef>
-
-
-
<target name="ask-to-clean-tomcat-cluster-node1" if="property-tomcat-cluster-node1-is-set" description="Clean Tomcat cluster node 1">
<input message="Do you really want to delete your deployed (maybe productive) Yanel version at '${tomcat1.webapps.dir}/${servlet.context.prefix}'? (yes/NO):" addproperty="answerCleanTomcatClusterNode1"/>
<condition property="yes-delete-tomcat-cluster-node1">
Modified: public/yanel/trunk/src/build/targets/webapp/webapp.xml
===================================================================
--- public/yanel/trunk/src/build/targets/webapp/webapp.xml 2010-02-06 14:47:51 UTC (rev 47464)
+++ public/yanel/trunk/src/build/targets/webapp/webapp.xml 2010-02-06 20:53:35 UTC (rev 47465)
@@ -1,9 +1,10 @@
<?xml version="1.0"?>
-<project name="webapp" default="deploy"
- xmlns:yanel="http://www.wyona.org/yanel/1.0"
->
+
+<project name="webapp" default="deploy-to-tomcat" xmlns:yanel="http://www.wyona.org/yanel/1.0">
- <target name="deploy" description="Deploy war file" depends="init, webapp">
+ <target name="deploy-to-tomcat" description="Deploy war file" depends="init, webapp">
+ <echo>Deploy webapp: ${tomcat1.home.dir}</echo>
+
<condition property="property-tomcat-cluster-node1-is-set">
<isset property="tomcat1.home.dir"/>
</condition>
More information about the Yanel-commits
mailing list