[portal-commits] JBoss Portal SVN: r9023 - branches/JBoss_Portal_Branch_2_6/build.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Mon Nov 19 06:23:25 EST 2007


Author: thomas.heute at jboss.com
Date: 2007-11-19 06:23:25 -0500 (Mon, 19 Nov 2007)
New Revision: 9023

Modified:
   branches/JBoss_Portal_Branch_2_6/build/build.xml
Log:
JBPORTAL-1713: add proxy capabilities to the portal build

Modified: branches/JBoss_Portal_Branch_2_6/build/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/build.xml	2007-11-19 10:33:43 UTC (rev 9022)
+++ branches/JBoss_Portal_Branch_2_6/build/build.xml	2007-11-19 11:23:25 UTC (rev 9023)
@@ -470,7 +470,7 @@
    <!-- then generate a new libraries.ent file and include it in  -->
    <!-- the build                                                 -->
    <target name="createthirdparty" unless="inhibit.downloads"
-           depends="check.inhibit.downloads">
+           depends="check.inhibit.downloads,set.proxy">
       <ant antfile="build-thirdparty.xml" target="generate-lib-file"/>
    </target>
 
@@ -486,4 +486,49 @@
       </condition>
    </target>
 
+  <!-- check if the the user has specied proxy settings -->
+  <target name="check.proxy">
+    <condition property="hasproxy">
+        <and>
+            <isset property="proxy.host"/>
+            <isset property="proxy.port"/>
+            <not>
+                <equals arg1="" arg2="${proxy.host}" trim="true"/>
+            </not>
+            <not>
+                <equals arg1="" arg2="${proxy.port}" trim="true"/>
+            </not>
+        </and>
+    </condition>
+    <!-- set proxy settings -->
+    <condition property="hasproxyauth">
+        <and>
+            <isset property="hasproxy"/>
+            <isset property="proxy.username"/>
+            <isset property="proxy.password"/>
+            <not>
+                <equals arg1="" arg2="${proxy.username}" trim="true"/>
+            </not>
+            <not>
+                <equals arg1="" arg2="${proxy.password}" trim="true"/>
+            </not>
+        </and>
+    </condition>
+
+  </target>
+
+  <target name="set.proxy" depends="set.proxy.withoutauth, set.proxy.auth"/>
+
+  <!-- set proxy settings without auth -->
+  <target name="set.proxy.withoutauth" if="hasproxy" unless="hasproxyauth" depends="check.proxy">
+    <echo>Proxy is set to ${proxy.host}:${proxy.port}</echo>
+    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"/>
+  </target>
+
+  <!-- set proxy settings using auth -->
+  <target name="set.proxy.auth" if="hasproxyauth" depends="check.proxy">
+    <echo>Auth Proxy is set to ${proxy.host}:${proxy.port} username=[${proxy.username}]</echo>
+    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
+  </target>  
+
 </project>




More information about the portal-commits mailing list