{"id":275,"date":"2010-07-22T11:04:50","date_gmt":"2010-07-22T11:04:50","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2010\/07\/22\/sample-ant-clean-prepare-and-compile-tasks\/"},"modified":"2017-12-29T12:12:36","modified_gmt":"2017-12-29T12:12:36","slug":"sample-ant-clean-prepare-and-compile-tasks","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/sample-ant-clean-prepare-and-compile-tasks\/","title":{"rendered":"Simple Ant Example &#8211; clean, prepare, and compile tasks"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4415\" src=\"http:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2010\/07\/sample-ant-clean-prepare-an.png\" alt=\"ant-clean-prepare-and-compile-tasks\" width=\"600\" height=\"400\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2010\/07\/sample-ant-clean-prepare-an.png 600w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2010\/07\/sample-ant-clean-prepare-an-300x200.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><strong>Sample Ant clean, prepare, and compile tasks<\/strong><\/p>\n<p>&lt;target name=&#8221;clean&#8221;&gt;<br \/>\n&lt;echo&gt;=== CLEAN ===&lt;\/echo&gt;<br \/>\n&lt;delete failonerror=&#8221;false&#8221;&gt;<br \/>\n&lt;fileset dir=&#8221;${dest.dir}&#8221; includes=&#8221;**\/*&#8221;\/&gt;<br \/>\n&lt;\/delete&gt;<br \/>\n&lt;delete dir=&#8221;${temp.dir}&#8221; \/&gt;<br \/>\n&lt;\/target&gt;<\/p>\n<p>&lt;target name=&#8221;prepare&#8221; depends=&#8221;clean&#8221;&gt;<br \/>\n&lt;echo&gt;=== PREPARE ===&lt;\/echo&gt;<br \/>\n&lt;mkdir dir=&#8221;${dest.dir}&#8221; \/&gt;<br \/>\n&lt;mkdir dir=&#8221;${temp.dir}&#8221; \/&gt;<br \/>\n&lt;mkdir dir=&#8221;${temp.dir.lib}&#8221; \/&gt;<br \/>\n&lt;mkdir dir=&#8221;${temp.dir.meta-inf}&#8221; \/&gt;<br \/>\n&lt;mkdir dir=&#8221;${temp.dir.web-inf}&#8221; \/&gt;<br \/>\n&lt;mkdir dir=&#8221;${temp.dir.classes}&#8221; \/&gt;<br \/>\n&lt;\/target&gt;<\/p>\n<p>&lt;target name=&#8221;compile&#8221; depends=&#8221;prepare&#8221;&gt;<br \/>\n&lt;echo&gt;=== COMPILE ===&lt;\/echo&gt;<br \/>\n&lt;echo&gt;Compiling ${src.dir} files &#8230;&lt;\/echo&gt;<br \/>\n&lt;javac debug=&#8221;on&#8221; srcdir=&#8221;${src.dir}&#8221; destdir=&#8221;${temp.dir.classes}&#8221; includes=&#8221;**\/*&#8221;&gt;<br \/>\n&lt;classpath refid=&#8221;build.class.path&#8221; \/&gt;<br \/>\n&lt;\/javac&gt;<\/p>\n<p>&lt;!&#8211; compile files on the src-tests path &#8211;&gt;<br \/>\n&lt;echo&gt;Compiling ${src.tests.dir} files &#8230;&lt;\/echo&gt;<br \/>\n&lt;javac debug=&#8221;on&#8221; srcdir=&#8221;${src.tests.dir}&#8221; destdir=&#8221;${temp.dir.classes}&#8221; includes=&#8221;com\/**&#8221;&gt;<br \/>\n&lt;classpath refid=&#8221;build.class.path&#8221; \/&gt;<br \/>\n&lt;\/javac&gt;<br \/>\n&lt;\/target&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sample Ant clean, prepare, and compile tasks &lt;target name=&#8221;clean&#8221;&gt; &lt;echo&gt;=== CLEAN ===&lt;\/echo&gt; &lt;delete failonerror=&#8221;false&#8221;&gt; &lt;fileset dir=&#8221;${dest.dir}&#8221; includes=&#8221;**\/*&#8221;\/&gt; &lt;\/delete&gt; &lt;delete dir=&#8221;${temp.dir}&#8221; \/&gt; &lt;\/target&gt; &lt;target name=&#8221;prepare&#8221; depends=&#8221;clean&#8221;&gt; &lt;echo&gt;=== PREPARE ===&lt;\/echo&gt; &lt;mkdir dir=&#8221;${dest.dir}&#8221; \/&gt; &lt;mkdir dir=&#8221;${temp.dir}&#8221; \/&gt; &lt;mkdir dir=&#8221;${temp.dir.lib}&#8221; \/&gt; &lt;mkdir dir=&#8221;${temp.dir.meta-inf}&#8221; \/&gt; &lt;mkdir dir=&#8221;${temp.dir.web-inf}&#8221; \/&gt; &lt;mkdir dir=&#8221;${temp.dir.classes}&#8221; \/&gt; &lt;\/target&gt; &lt;target name=&#8221;compile&#8221; depends=&#8221;prepare&#8221;&gt; &lt;echo&gt;=== COMPILE ===&lt;\/echo&gt; &lt;echo&gt;Compiling ${src.dir}&#8230;<\/p>\n","protected":false},"author":1,"featured_media":4415,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[12],"tags":[4227,3827,4226,4220,683,91,4221,3420,4225,519,1122,4222,938,4218,4224,4228,4223],"class_list":["post-275","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache-ant","tag-and-compile-example","tag-ant-build","tag-ant-clean","tag-ant-example","tag-apache-ant","tag-build","tag-clean","tag-compile","tag-echo","tag-example","tag-guide","tag-prepare","tag-reference","tag-sample","tag-scipt","tag-simple-ant-example","tag-task"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=275"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/275\/revisions"}],"predecessor-version":[{"id":4416,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/275\/revisions\/4416"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/4415"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}