[Editplus] _ [Create an Ant code Snippet]

Source: Internet
Author: User
Tags echo message

1. Editplus has a function to create different types of frequently-used code snippets. Below are the ant code snippets I have made. 2. Save it as ant. ctl and place it in the Editplus installation directory. 3. I like to use editplus as a development tool .. Other snippet .. [html] # TITLE = Ant; EditPlus Auto-completion file v1.0 written by ES-Computing .; this file is provided as a default auto-completion file for Ant. # CASE = n; Project # T = Project_property <property name = "^! "Value =" "/> # T = Project_project <? Xml version = "1.0" encoding = "UTF-8"?> <Project name = "test"> </project> # T = Project_path <path id = "cxf. lib "> <fileset file =" $ {cxf }/*. jar "/> <pathelement path =" $ {basedir}/classes "/> </path> # T = Project_import <! -- The import task may only be used as a top-level task. this means that it may not be used in a target. --> <import file = "customTargets. xml "optional =" true "/> # T = Project_taskdef_ant-contrib <taskdef resource =" net/sf/antcontrib. properties "/>; Task # T = Target_target <target name =" ^! "If =" "> </target> # T = Target_antcall <antcall target =" ^! "> <Param name =" "value =" "/> </antcall> # T = Target_ant <ant antfile =" build. xml "target =" "dir =" "> <property name =" ^! "Value =" "/> </ant> # T = Target_param <param name =" ^! "Value =" "/> # T = Target_parallel <target name =" modifyproperties "if =" build. properties. exists "> <antcall target =" service "/> <parallel threadCount =" 2 "failonany =" true "> <sequential> <antcall target =" client "/> </sequential> <sequential> <antcall target = "service"/> </sequential> </parallel> <antcall target = "publish"/> </target> # T = Target_antcallback_ant-contrib <antcallback target = "test" return = "a"/> # T = Target_server_ant-contrib <antserver port = "6090"/> # T = Target_remoteant_ant-contrib <target name = "client"> <remoteant machine = "localhost" port = "6090"> <runtarget target = "test"> <property name = "foo" value = "bar"/> </runtarget> </remoteant> </target> <target name = "client2"> <remoteant machine = "localhost" port = "6090"> <runant dir = "G: \ Script \ JAVA \ cxf2 "target =" compile "> <property name =" build. type "va Lue = "full"/> </runant> </remoteant> </target>; system # T = System_exec <exec dir = ". "executable =" {{svn.exe} "> <env key =" CATALINA_HOME "value =" $ {CATALINA_HOME} "/> <arg line =" $ {svn. cmd}-r "/> </exec>; file # T = File_delete <delete dir =" ^! "Primary des =" *. xml "/> # T = File_mkdir <mkdir dir =" ^! "/> # T = File_copy <copy todir =" ^! "> <Fileset dir =" ^! "Primary des =" *. * "/> </copy> # T = File_fileset <fileset dir =" ^! "Includes =" "excludes =" "/> <fileset dir = ". "> <include name =" h.zip "/> </fileset> # T = File_zip <zip destfile =" $ {basedir}/SmartAvideo.zip "> <zipfileset dir =" $ {basedir }/gui "prefix =" SmartAvideo "> <include name = "**/*. exe "/> </zipfileset> <fileset dir =" simulator. gh. callcenter "> <include name = "*. xml "/> <include name =" startup. bat "/> <include name =" readme.txt "/> </fileset> </zip> # T = File_unzip <unzip dest =" $ {ArtifactsDir}/$ {warname} _ war "src =" $ {artifactsDir}/$ {warname}. war "/># T = File_propertyfile <! -- Don't use it, it will lost comment --> <propertyfile file = "my. properties "comment =" My properties "> <entry key =" akey "value =" avalue "/> <entry key =" adate "type =" date "value =" now" /> <entry key = "anint" type = "int" operation = "+"/> <entry key = "formated.int" type = "int" default = "0013" operation = "+" pattern = "0000" type = "codeph" text = "/codeph"/> <entry key = "formated. date "type =" date "value =" now "pattern =" ddd hh: mm "/> </propertyfile> # T = File_loadfile <! -- Load a text file into a single property --> <loadfile srcfile = "buildnumber.txt" encoding = "UTF-8" property = "buildnumber" failonerror = "false"> <filterchain> <expandproperties/> </filterchain> </loadfile> # T = File_xmlproperty <xmlproperty file = "somefile. xml "semanticAttributes =" true "/> <? Xml version = "1.0" encoding = "UTF-8"?> <Properties> <tomcat. home> Chinese </tomcat. home> </properties> # T = File_sync <sync todir = "sync" overwrite = "false" includeEmptyDirs = "true" failonerror = "true"> <fileset dir = "G: /repository2 "/> </sync>; message # T = Message_echo <echo message = ""/> # T = Message_input <input message = "All data is going to be deleted from DB continue (y/n )? "Validargs =" y, n "addproperty =" do. delete "/> <condition property =" do. abort "> <equals arg1 =" n "arg2 =" $ {do. delete} "/> </condition> <fail if =" do. abort "> Build aborted by user. </fail>; string # T = String_replacereg <replaceregexp match = "--. * "replace =" "flags =" I "byline =" true "> <fileset dir =" "repldes = "*. SQL "/> </replaceregexp> # T = String_replace <replace dir =" $ {artifactsDir}/tempsqls "token ="; "value = "~ "Casesensitive =" false "summary =" true "> <include name = "*. SQL "/> </replace>; database # T = SQL _ SQL <SQL driver =" $ {db. driver} "url =" $ {db. url} "userid =" $ {db. user} "password =" $ {db. password} "onerror =" stop "print =" true "delimiter = "~ "Autocommit =" true "keepformat =" true "> <classpath refid =" all. lib "/> <fileset dir =" $ {artifactsDir}/tempsqls "> <include name = "*. * "/> </fileset> </SQL>; time # T = Date_time <tstamp> <format property =" version. no "pattern =" yyyyMMddHHmmss "locale =" en "/> </tstamp>; java # T = Java_java <java classname =" org. eclipse. core. launcher. main "failonerror =" true "fork =" true "dir =" "> <arg value ="-application "/> <classpath Refid = "lib"/> <classpath> <path = "$ {eclipse. home}/startup. jar "/> </classpath> </java> # T = Java_javac <javac destdir =" $ {build} "classpath =" xyz. jar "debug =" on "> <src path =" $ {src} "/> <src path =" $ {src2} "/> <include name =" mypackage/p1 /** "/> <include name =" mypackage/p2/** "/> <exclude name =" mypackage/p1/testpackage/** "/> </javac> # T = Java_war <war destfile = "$ {artifactsDir}/$ {warname }. war "webxml =" $ {w Ar. source}/web. xml "update =" false "duplicate =" preserve "> <webinf dir =" data. common/src "> <include name =" hbm /**/*. xml "/> <exclude name =" hbm/**/* Test *. xml "/> </webinf> <fileset file =" $ {war. source}/index. jsp "/> <classes file =" $ {war. source}/ehcache. xml "/> <lib dir =" $ {artifactsDir} "> <include name = "*. jar "/> <exclude name = "*. test. *. jar "/> </lib> </war> # T = Java_java.version <target name =" java. versio N "> <java classname =" org. eclipse. core. launcher. main "failonerror =" true "fork =" true "dir =" "> <jvmarg value ="-version "/> </java> </target>; condition Statement # T = Condition_condition <condition property = "fetchTag" value = "HEAD"> <equals arg1 = "$ {buildType}" arg2 = "N"/> <not> <isset property = "performance. base "/> </not> www.2cto.com </condition> # T = Condition_available <available file =" $ {buildDirectory}/label. propertie S "property =" label. properties. exists "/> # T = Condition_if_ant-contrib <if> <equals arg1 =" $ {foo} "arg2 =" bar "/> <then> <echo message =" The value of property foo is bar "/> </then> <else> <echo message =" The value of property foo is not bar "/> </else> </if> # T = condition_matches; regular <condition property = "build. error "> <matches string =" $ {build. output} "pattern =" [eE] rror "/> </condition> <fail if =" build. Error "/>; email # T = Mail_mail <mail mailhost =" mail.sysway.com "ssl =" false "mailport =" 25 "subject =" extern. ip "user =" "password =" "charset =" UTF-8 "failonerror =" true "> <from address =" huid@syway.com "/> <to address =" huid@sysway.com "/> <message> The $ {buildname} nightly build has completed </message> <fileset dir = "dist"> <includes name = "**/*. zip "/> </fileset> </mail>; Network # T = Network_get <! -- The timestamp is used to check whether the file is up-to-date --> <get src = "$ {libs. location}/ant. jar "dest =" lib/ant. jar "usetimestamp =" true "/> # T = Exception_trycatch_ant-contrib <trycatch property =" foo "reference =" bar "> <try> <antcall target =" fail "/> </ try> <catch> <echo> In <catch>. </echo> </catch> <finally> <echo> In <finally>. </echo> </finally> </trycatch> <echo> As property: $ {foo} </echo> <property name = "baz" refid = "bar"/> <echo> From refe Rence: $ {baz} </echo> <property name = "a" value = "success"/> #3 ., double-click to automatically add the configured code snippets in the text editing area to improve development efficiency.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.