You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@logging.apache.org by ca...@apache.org on 2007/07/21 20:43:44 UTC

svn commit: r558367 - in /logging/chainsaw/trunk: build.xml pom.xml

Author: carnold
Date: Sat Jul 21 11:43:44 2007
New Revision: 558367

URL: http://svn.apache.org/viewvc?view=rev&rev=558367
Log:
Bug 37930: Set mime-type on staged content

Modified:
    logging/chainsaw/trunk/build.xml
    logging/chainsaw/trunk/pom.xml

Modified: logging/chainsaw/trunk/build.xml
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/build.xml?view=diff&rev=558367&r1=558366&r2=558367
==============================================================================
--- logging/chainsaw/trunk/build.xml (original)
+++ logging/chainsaw/trunk/build.xml Sat Jul 21 11:43:44 2007
@@ -31,6 +31,11 @@
   
   <!-- When building a Java Web Start distribution of Chainsaw, some Receivers with external dependencies need to be packaged into a seperate Jar -->
   <property name="webstart-dependant-receivers.jar" value="webstart-dependant-receivers.jar-${version}.jar"/>
+
+   <property name="svnrepo.url" value="https://svn.apache.org/repos/asf"/>
+   <property name="svnsite.url" value="${svnrepo.url}/logging/site/trunk/docs/chainsaw"/>
+   <available property="svn-available" file="target/site-deploy/.svn"/>
+
 	
   <!-- Construct compile classpath -->
   <path id="compile.classpath">
@@ -458,6 +463,66 @@
      <fileset dir="${jar.dest}" includes="log4j-chainsaw*.jar"/>
     </delete>	
   </target>
+
+	<target name="checkout-site" unless="svn-available">
+		<exec executable="svn">
+			<arg value="co"/>
+			<arg value="${svnsite.url}"/>
+			<arg value="target/site-deploy"/>
+		</exec>
+	</target>
+
+	<target name="update-site" if="svn-available">
+		<exec executable="svn" dir="target/site-deploy" failonerror="true">
+			<arg value="update"/>
+		</exec>
+	</target>
+
+	<target name="post-site" depends="checkout-site, update-site"/>
+
+
+        <target name="mime=html">
+            <exec executable="svn">
+		<arg value="propset"/>
+                <arg value="svn:mime-type"/>
+                <arg value="text/html"/>
+                <arg value="${src.html}"/>
+            </exec>
+        </target>
+
+        <target name="mime=css">
+            <exec executable="svn">
+		<arg value="propset"/>
+                <arg value="svn:mime-type"/>
+                <arg value="text/css"/>
+                <arg value="${src.css}"/>
+            </exec>
+        </target>
+	
+
+	<target name="site-deploy">
+		<!-- Add any new files (and generate innocuous warnings for the existing content)  -->
+                <delete file="target/site-deploy/svn-commit.tmp~"/>
+		<exec executable="bash" dir="target/site-deploy" failonerror="true">
+			<arg line='-c "svn add --force *"'/>
+		</exec>
+                <taskdef name="foreach" classname="net.sf.antcontrib.logic.ForEach" />
+                <foreach target="mime=html" param="src.html">
+                        <path>
+                                <fileset dir="target/site-deploy" includes="**/*.html"/>
+                        </path>
+                </foreach>
+                <foreach target="mime=css" param="src.css">
+                        <path>
+                                <fileset dir="target/site-deploy" includes="**/*.css"/>
+                        </path>
+                </foreach>
+		<!--  requires that SVN_EDITOR, VISUAL or EDITOR being set to edit commit description -->
+		<exec executable="svn" dir="target/site-deploy" failonerror="true">
+		    <arg value="commit"/>
+		</exec>
+	</target>
+
 
 </project>
 

Modified: logging/chainsaw/trunk/pom.xml
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/pom.xml?view=diff&rev=558367&r1=558366&r2=558367
==============================================================================
--- logging/chainsaw/trunk/pom.xml (original)
+++ logging/chainsaw/trunk/pom.xml Sat Jul 21 11:43:44 2007
@@ -179,12 +179,39 @@
               <tasks>
                 <taskdef name="replaceregexp" classname="org.apache.tools.ant.taskdefs.optional.ReplaceRegExp"/>
                 <replaceregexp file="target/site/source-repository.html" match="/tags/[^ ]*" replace="/trunk" flags="g"/>
+                <replaceregexp match="-- Generated by (.*) on .*--" replace="-- Generated by \1 --" flags="g">
+		   <fileset dir="target/site/apidocs" includes="**/*.html"/>
+		</replaceregexp>
               </tasks>
             </configuration>
             <goals>
               <goal>run</goal>
             </goals>
           </execution>
+          <execution>
+            <phase>post-site</phase>
+            <id>post-site</id>
+            <configuration>
+                <tasks>
+                   <ant target="post-site"/>
+                </tasks>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+          <execution>
+            <phase>site-deploy</phase>
+            <id>site-deploy</id>
+            <configuration>
+                <tasks>
+                   <ant target="site-deploy"/>
+                </tasks>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
         </executions>
         <dependencies>
           <dependency>
@@ -192,6 +219,11 @@
             <artifactId>ant-nodeps</artifactId>
             <version>1.6.5</version>
           </dependency>
+          <dependency>
+            <groupId>ant-contrib</groupId>
+            <artifactId>ant-contrib</artifactId>
+            <version>1.0b2</version>
+          </dependency>
         </dependencies>
       </plugin>
       <plugin>
@@ -420,9 +452,9 @@
       <id>logging.repo</id>
       <url>scp://people.apache.org/www/people.apache.org/builds/logging/repo/</url>
     </repository>
-    <site>
-      <id>logging.site</id>
-      <url>scp://people.apache.org/www/logging.apache.org/chainsaw</url>
-    </site>
+    <site>
+      <id>logging.site</id>
+      <url>scp://localhost/${user.dir}/target/site-deploy</url>
+    </site>
   </distributionManagement>
 </project>