From c586763a6c04601f4b33cdeb103ef249ff3a5f4d Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Mon, 29 Jan 2007 16:31:54 +0000
Subject: [PATCH] Add a new Ant task that can be used to ensure that new files marked for addition to the Subversion repository have the "svn:eol-style" property set to "native".

---
 opends/build.xml |   43 +++++++++++++++++++++++++++++++++++--------
 1 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/opends/build.xml b/opends/build.xml
index b2cab9e..7263c8d 100644
--- a/opends/build.xml
+++ b/opends/build.xml
@@ -133,7 +133,7 @@
 
 
   <!-- The build target that should be used before committing code. -->
-  <target name="precommit" depends="checkstyle,clean,copyrightdates,dsml,javadoc,testwithcoverage"
+  <target name="precommit" depends="checkstyle,clean,copyrightdates,eolstyle,dsml,javadoc,testwithcoverage"
        description="Perform all processing needed before committing code." />
 
 
@@ -156,7 +156,7 @@
 
   <!-- The build target that should be used to build everything. -->
   <target name="all"
-       depends="checkstyle,clean,copyrightdates,dsml,javadoc,testallwithcoverage"
+       depends="checkstyle,clean,copyrightdates,eolstyle,dsml,javadoc,testallwithcoverage"
        description="Build using all defined targets." />
 
 
@@ -255,7 +255,7 @@
 
 
 
-  <!-- Check modified files to see any copyright updates are needed. -->
+  <!-- Check modified files to see if any copyright updates are needed. -->
   <target name="copyrightdates" depends="buildtools"
        description="Ensure updated files have the correct copyright year" >
     <taskdef name="checkcopyrightdates"
@@ -271,21 +271,48 @@
     </taskdef>
 
     <checkcopyrightdates>
-      <fileset dir="${src.dir}" includes="**/*.java" />
-      <fileset dir="${quicksetup.src.dir}" includes="**/*.java" />
-      <fileset dir="${statuspanel.src.dir}" includes="**/*.java" />
-      <fileset dir="${unittest.testng.src.dir}" includes="**/*.java" />
-      <fileset dir="${functest.testng.src.dir}" includes="**/*.java" />
+      <fileset dir="${basedir}" includes="**/*.java" excludes="build/**/*" />
       <fileset dir="${basedir}" includes="**/*.xml" excludes="build/**/*" />
+      <fileset dir="${basedir}" includes="**/*.html" excludes="build/**/*" />
       <fileset dir="${basedir}" includes="**/*.sh" excludes="build/**/*" />
       <fileset dir="${basedir}" includes="**/*.bat" excludes="build/**/* " />
       <fileset dir="${basedir}" includes="**/*.ldif" excludes="build/**/*" />
+      <fileset dir="${basedir}" includes="**/*.txt" excludes="build/**/*" />
     </checkcopyrightdates>
   </target>
 
 
 
 
+  <!-- Check added files to see if any svn:eol-style updates are needed. -->
+  <target name="eolstyle" depends="buildtools"
+       description="Ensure added files have the correct svn:eol-style" >
+    <taskdef name="checkeolstyle"
+             classname="org.opends.build.tools.CheckEOLStyle">
+      <classpath>
+        <fileset dir="${build.dir}/build-tools">
+          <include name="*.jar" />
+        </fileset>
+        <fileset dir="${svnkit.dir}">
+          <include name="*.jar" />
+        </fileset>
+      </classpath>
+    </taskdef>
+
+    <checkeolstyle>
+      <fileset dir="${basedir}" includes="**/*.java" excludes="build/**/*" />
+      <fileset dir="${basedir}" includes="**/*.xml" excludes="build/**/*" />
+      <fileset dir="${basedir}" includes="**/*.html" excludes="build/**/*" />
+      <fileset dir="${basedir}" includes="**/*.sh" excludes="build/**/*" />
+      <fileset dir="${basedir}" includes="**/*.bat" excludes="build/**/* " />
+      <fileset dir="${basedir}" includes="**/*.ldif" excludes="build/**/*" />
+      <fileset dir="${basedir}" includes="**/*.txt" excludes="build/**/*" />
+    </checkeolstyle>
+  </target>
+
+
+
+
   <!-- Ensure that the source code meets basic style requirements. -->
   <target name="checkstyle" description="Perform basic source style checks">
     <mkdir dir="${checkstyle.cache.dir}" />

--
Gitblit v1.10.0