فهرست منبع

Added option to ignore dependencies when building.

I was on the plane and needed to save battery life. Ivy was eating up
all of it so I added the skip.ivy feature to by-pass ivy setup.

Note: This will fail to compile if dependencies are not properly
configured beforehand.
Thomas Flucke 7 سال پیش
والد
کامیت
b620fd6160
1فایلهای تغییر یافته به همراه12 افزوده شده و 5 حذف شده
  1. 12 5
      build.xml

+ 12 - 5
build.xml

@@ -39,6 +39,10 @@
 	<echo>To see list of targets, use ant -p</echo>
   </target>
 
+  <target name="skip.ivy" description="Do not check dependencies. (Saves laptop battery)">
+    <property name="ivy.skip" value="true"/>  
+  </target>
+
   <target name="ivy.install" unless="ivy.installed">
     <mkdir dir="${ant.lib}"/>
     <get dest="${ivy.jar}"
@@ -51,16 +55,19 @@
     <ivy:dependencytree />
   </target>
 
-  <target name="ivy.resolve.compile" depends="ivy.install">
+  <target name="ivy.resolve.compile" unless="ivy.skip" depends="ivy.install">
     <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact].[ext]" conf="compile"/>
   </target>
 
-  <target name="ivy.resolve.war" depends="ivy.install">
+  <target name="ivy.resolve.war" unless="ivy.skip" depends="ivy.install">
     <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact].[ext]" conf="war"/>
   </target>
 
-  <target name="ivy.resolve.deploy" depends="ivy.install">
+  <target name="ivy.resolve.deploy" unless="ivy.skip" depends="ivy.install">
     <ivy:retrieve pattern="${ant.lib}/[artifact].[ext]" conf="deploy"/>
+  </target>
+  
+  <target name="deploy.load" depends="ivy.resolve.deploy">
     <taskdef resource="org/apache/catalina/ant/antlib.xml" uri="antlib:org.apache.catalina.ant"/>
     <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask" />
     <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask" />
@@ -109,7 +116,7 @@
     <ivy:cleancache/>
   </target>
 
-  <target name="deploy" depends="war,ivy.resolve.deploy" description="Deploy to tomcat">
+  <target name="deploy" depends="war,deploy.load" description="Deploy to tomcat">
 	<deploy url="http://localhost:8080/manager/text"
 		    username="${tomcat.username}"
 		    password="${tomcat.password}"
@@ -118,7 +125,7 @@
 		    war="file:./${build.warfile}" />
   </target>
 
-  <target name="undeploy" depends="ivy.resolve.deploy" description="Undeploy from tomcat">
+  <target name="undeploy" depends="deploy.load" description="Undeploy from tomcat">
     <undeploy url="http://localhost:8080/manager/text"
               username="${tomcat.username}"
               password="${tomcat.password}"