Bug 42773: Set mime-type on staged web content
git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/companions/zeroconf/trunk@558365 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/build.xml b/build.xml
index aa49be2..82b718d 100644
--- a/build.xml
+++ b/build.xml
@@ -140,16 +140,46 @@
<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) -->
- <exec executable="csh" dir="target/site-deploy" failonerror="true">
+ <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>
-
-
+ </target>
</project>
diff --git a/pom.xml b/pom.xml
index 090eaa4..af57ff1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -154,6 +154,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>