From 0026d9becf489657e300fb2b65e67287475c7060 Mon Sep 17 00:00:00 2001
From: Christophe Sovant <christophe.sovant@forgerock.com>
Date: Fri, 11 Sep 2009 14:48:00 +0000
Subject: [PATCH] Improvements in ant build + update STAF/services versions + dynamic dsmlService compilation/loading

---
 opends/tests/staf-tests/shared/ant/opends.xml |   46 ++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 38 insertions(+), 8 deletions(-)

diff --git a/opends/tests/staf-tests/shared/ant/opends.xml b/opends/tests/staf-tests/shared/ant/opends.xml
index ca3434e..dc8cf44 100644
--- a/opends/tests/staf-tests/shared/ant/opends.xml
+++ b/opends/tests/staf-tests/shared/ant/opends.xml
@@ -60,10 +60,25 @@
               </and>
               <then>
                 <echo>Build ${opends.name} with SNMP</echo>
-                <replace file="${project.home}/build.properties"
-                         value="opendmk.lib.dir=${snmp.opendmk.lib.dir}">
-                  <replacefilter token="opendmk.lib.dir="/>
-                </replace>
+                <var file="${basedir}/user.properties"/>
+                <if>
+                    <or>
+                      <equals arg1="${opendmk.lib.dir}" arg2=""/>
+                      <not>
+                        <equals arg1="${opendmk.lib.dir}" arg2="${snmp.opendmk.lib.dir}"/>
+                      </not>
+                    </or>
+                    <then>
+                      <replace file="${project.home}/build.properties"
+                               value="opendmk.lib.dir=">
+                        <replacefilter token="opendmk.lib.dir=${opendmk.lib.dir}"/>
+                      </replace>
+                      <replace file="${project.home}/build.properties"
+                               value="opendmk.lib.dir=${snmp.opendmk.lib.dir}">
+                        <replacefilter token="opendmk.lib.dir="/>
+                      </replace>
+                    </then>
+                </if>
                 <property name="package.rebuild" value="true"/>
               </then>
               <else>
@@ -83,10 +98,25 @@
               </and>
               <then>
                 <echo>Rebuild ${opends.name} with SNMP</echo>
-                <replace file="${project.home}/build.properties"
-                         value="opendmk.lib.dir=${snmp.opendmk.lib.dir}">
-                  <replacefilter token="opendmk.lib.dir="/>
-                </replace>
+                <var file="${basedir}/user.properties"/>
+                <if>
+                    <or>
+                      <equals arg1="${opendmk.lib.dir}" arg2=""/>
+                      <not>
+                        <equals arg1="${opendmk.lib.dir}" arg2="${snmp.opendmk.lib.dir}"/>
+                      </not>
+                    </or>
+                    <then>
+                      <replace file="${project.home}/build.properties"
+                               value="opendmk.lib.dir=">
+                        <replacefilter token="opendmk.lib.dir=${opendmk.lib.dir}"/>
+                      </replace>
+                      <replace file="${project.home}/build.properties"
+                               value="opendmk.lib.dir=${snmp.opendmk.lib.dir}">
+                        <replacefilter token="opendmk.lib.dir="/>
+                      </replace>
+                    </then>
+                </if>
                 <property name="package.rebuild" value="true"/>
               </then>
             </if>

--
Gitblit v1.10.0