You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by mi...@apache.org on 2004/06/01 17:36:53 UTC
cvs commit: cocoon-lenya/src/targets webapp-build.xml
michi 2004/06/01 08:36:53
Modified: src/java/org/apache/lenya/cms/ant CopyTask.java
src/targets webapp-build.xml
Log:
Filter for SCM files added
Revision Changes Path
1.9 +29 -15 cocoon-lenya/src/java/org/apache/lenya/cms/ant/CopyTask.java
Index: CopyTask.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/ant/CopyTask.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- CopyTask.java 3 Mar 2004 12:56:30 -0000 1.8
+++ CopyTask.java 1 Jun 2004 15:36:53 -0000 1.9
@@ -20,6 +20,7 @@
package org.apache.lenya.cms.ant;
import java.io.File;
+import java.io.FilenameFilter;
import java.util.StringTokenizer;
import org.apache.tools.ant.BuildException;
@@ -30,6 +31,7 @@
public class CopyTask extends Task {
private Path pubsRootDirs;
private Path toDir;
+ private String excludes;
/** (non-Javadoc)
* @see org.apache.tools.ant.Task#execute()
@@ -41,40 +43,52 @@
StringTokenizer st = new StringTokenizer(pubsRootDirs.toString(), File.pathSeparator);
+ log("Excludes " + excludes);
+ FilenameFilter filter = new SCMFilenameFilter(excludes);
+
while (st.hasMoreTokens()) {
String pubsRootDir = st.nextToken();
if (new File(pubsRootDir, "publication.xml").isFile()) {
CopyJavaSourcesTask.copyDir(new File(pubsRootDir), new File(toDir.toString()),
- twoTuple, null);
+ twoTuple, filter);
} else {
// FIXME: Look for publications defined by the file "publication.xml"
CopyJavaSourcesTask.copyContentOfDir(new File(pubsRootDir),
- new File(toDir.toString()), twoTuple, null);
+ new File(toDir.toString()), twoTuple, filter);
}
}
numberOfDirectoriesCreated = twoTuple.x;
numberOfFilesCopied = twoTuple.y;
- System.out.println("Copying " + numberOfDirectoriesCreated + " directories to " + toDir);
- System.out.println("Copying " + numberOfFilesCopied + " files to " + toDir);
+ log("Copying " + numberOfDirectoriesCreated + " directories to " + toDir);
+ log("Copying " + numberOfFilesCopied + " files to " + toDir);
}
- /**
- *
- *
- * @param pubsRootDirs
- */
+ /**
+ * Where the publications are located
+ *
+ * @param pubsRootDirs
+ */
public void setPubsRootDirs(Path pubsRootDirs) {
this.pubsRootDirs = pubsRootDirs;
}
- /**
- *
- *
- * @param toDir
- */
+ /**
+ * Where the publications shall be copied to
+ *
+ * @param toDir
+ */
public void setToDir(Path toDir) {
this.toDir = toDir;
+ }
+
+ /**
+ * Which filenames shall be excluded
+ *
+ * @param excludes
+ */
+ public void setExcludes(String excludes) {
+ this.excludes = excludes;
}
}
1.23 +13 -10 cocoon-lenya/src/targets/webapp-build.xml
Index: webapp-build.xml
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/targets/webapp-build.xml,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- webapp-build.xml 30 May 2004 13:24:17 -0000 1.22
+++ webapp-build.xml 1 Jun 2004 15:36:53 -0000 1.23
@@ -65,16 +65,8 @@
<!-- Copy publications -->
<echo>INFO: Copy publications from ${src.webapp.dir}/lenya/pubs to ${build.webapp}/lenya/pubs</echo>
- <copyPubs todir="${build.webapp}/lenya/pubs" pubsrootdirs="${pubs.root.dirs}">
+ <copyPubs todir="${build.webapp}/lenya/pubs" pubsrootdirs="${pubs.root.dirs}" excludes="CVS,.svn">
</copyPubs>
-
- <!-- Workaround for copyPubs task: remove CVS and .svn dirs since copyPubs task does not use deafultexcludes -->
- <delete includeEmptyDirs="true">
- <fileset dir="${build.webapp}/lenya/pubs"
- defaultexcludes="no"
- includes="**/CVS/*,**/CVS,**/.svn/*,**/.svn"
- />
- </delete>
<!-- Patch cocoon.xconf -->
<echo>INFO: Patch cocoon.xconf</echo>
@@ -224,6 +216,17 @@
</fileset>
</copy>
<copy file="${build.webapp}/WEB-INF/lib/xml-apis.jar" todir="${tomcat.endorsed.dir}"/>
+ </target>
+
+ <!-- ============================================================ -->
+ <!-- Install publication -->
+ <!-- ============================================================ -->
+ <target name="install-pub" depends="webapp" description="Install a publication into servlet engine context. Usage: -Dpub.prefix=blog">
+ <echo>INFO: Copy publication ${pub.prefix} to Tomcat</echo>
+ <echo>INFO: Copy From build.webapp=${build.webapp}/lenya/pubs/${pub.prefix} To tomcat.webapps.dir=${tomcat.webapps.dir}/lenya/pubs/${pub.prefix}</echo>
+ <copy todir="${tomcat.webapps.dir}/lenya/pubs/${pub.prefix}" filtering="off">
+ <fileset dir="${build.webapp}/lenya/pubs/${pub.prefix}" excludes="${target.install.excludes}"/>
+ </copy>
</target>
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org