<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[Heck's  Blog]]></title> 
<link>https://www.heckjj.com/index.php</link> 
<description><![CDATA[一瞬间的决定，往往可以改变很多，事实上，让自己成功的往往不是知识，是精神！ 如果你总是为自己找借口，那只好让成功推迟。执行力，今天！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[Heck's  Blog]]></copyright>
<item>
<link>https://www.heckjj.com/ant-build-xml-rar-jar/</link>
<title><![CDATA[利用ant编译发布打包jar文件和打包api文档为rar文件]]></title> 
<author>Heck &lt;@hecks.tk&gt;</author>
<category><![CDATA[编程杂谈]]></category>
<pubDate>Fri, 06 May 2011 15:19:40 +0000</pubDate> 
<guid>https://www.heckjj.com/ant-build-xml-rar-jar/</guid> 
<description>
<![CDATA[ 
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-family: 微软雅黑;">我们首先在build.properties文件中配置好发布时的路径及版本号、发布名称及发布者等等。。然后执行build.xml文件。<br/>build.properties<br/># <br/>#该文件用于配置发布和打包时所需配置 <br/># <br/><br/>#发布版本号 <br/>build.version=0.1 <br/><br/>#发布路径 <br/>build.path=D:/target <br/><br/>#发布名称 <br/>build.name=test <br/><br/>#发布title <br/>build.title=smart rDelta API <br/><br/>#发布者 <br/>build.created-by=Smart rDelta SDT <br/><br/>#vendor <br/>build.vendor=Stone Age Co. Ltd. <br/><br/>#最终发布名称 <br/>final.name=$&#123;build.name&#125;-$&#123;build.version&#125; <br/><br/>#打包后API文档的名称 <br/>doc.name=$&#123;build.name&#125;-$&#123;build.version&#125;-doc</span><span style="font-family: 微软雅黑;"><br/><br/>build.xml <br/>&lt;?xml version=&quot;1.0&quot;?&gt; <br/>&lt;project name=&quot;TestAnt&quot; default=&quot;doc&quot;&gt; <br/><br/>&lt;!-- 定义properies --&gt; <br/>&lt;property file=&quot;build.properties&quot;/&gt; <br/>&lt;property name=&quot;src.dir&quot; value=&quot;src&quot; /&gt; <br/>&lt;property name=&quot;classes.dir&quot; value=&quot;classes&quot; /&gt; <br/>&lt;property name=&quot;lib.dir&quot; value=&quot;lib&quot; /&gt; <br/><br/>&lt;!-- 定义classpath --&gt; <br/>&lt;path id=&quot;compile.classpath&quot;&gt; <br/>&lt;fileset file=&quot;$&#123;lib.dir&#125;/*.jar&quot; /&gt; <br/>&lt;pathelement path=&quot;$&#123;classes.dir&#125;&quot; /&gt; <br/>&lt;/path&gt; <br/><br/>&lt;!-- 初始化任务 --&gt; <br/>&lt;target name=&quot;init&quot;&gt; <br/>&lt;!-- 创建构建目录 --&gt; <br/>&lt;echo message=&quot;Running init ...&quot;/&gt; <br/>&lt;/target&gt; <br/><br/>&lt;!-- 清除构建文件和目录 --&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;target name=&quot;clean&quot; description=&quot;Clean build and distribution directories&quot;&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;echo message=&quot;Running clean ...&quot;/&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;delete dir=&quot;$&#123;build.path&#125;&quot;/&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/target&gt; <br/><br/>&lt;!-- 编译 --&gt; <br/>&lt;target name=&quot;compile&quot; depends=&quot;init&quot; description=&quot;compile the source files&quot;&gt; <br/>&lt;mkdir dir=&quot;$&#123;classes.dir&#125;&quot; /&gt; <br/>&lt;javac srcdir=&quot;$&#123;src.dir&#125;&quot; destdir=&quot;$&#123;classes.dir&#125;&quot; target=&quot;1.6&quot;&gt; <br/>&lt;classpath refid=&quot;compile.classpath&quot; /&gt; <br/>&lt;/javac&gt; <br/>&lt;/target&gt; <br/><br/>&lt;!-- 打包成jar --&gt; <br/>&lt;target name=&quot;pack&quot; depends=&quot;compile&quot; description=&quot;make .jar file&quot;&gt; <br/>&lt;mkdir dir=&quot;$&#123;build.path&#125;&quot;/&gt; <br/>&lt;jar destfile=&quot;$&#123;build.path&#125;/$&#123;final.name&#125;.jar&quot; basedir=&quot;$&#123;classes.dir&#125;&quot;&gt; <br/>&lt;exclude name=&quot;**/*Test.*&quot; /&gt; <br/>&lt;exclude name=&quot;**/Test*.*&quot; /&gt; <br/>&lt;manifest&gt; <br/>&lt;attribute name=&quot;Specification-Title&quot; value=&quot;$&#123;build.title&#125;&quot; /&gt; <br/>&lt;attribute name=&quot;Created-By&quot; value=&quot;$&#123;build.created-by&#125;&quot; /&gt; <br/>&lt;attribute name=&quot;Specification-Version&quot; value=&quot;$&#123;build.version&#125;&quot; /&gt; <br/>&lt;attribute name=&quot;Specification-Vendor&quot; value=&quot;$&#123;build.vendor&#125;&quot; /&gt; <br/>&lt;/manifest&gt; <br/>&lt;/jar&gt; <br/>&lt;/target&gt; <br/><br/>&lt;!-- 输出并打包api文档成rar --&gt; <br/>&lt;target name=&quot;doc&quot; depends=&quot;pack,compile&quot; description=&quot;create api doc&quot;&gt; <br/>&lt;echo message=&quot;Running API Doc ...&quot;/&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tstamp&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;format property=&quot;current.year&quot; pattern=&quot;yyyy&quot;/&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tstamp&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;javadoc sourcepath=&quot;$&#123;src.dir&#125;&quot; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; destdir=&quot;$&#123;build.path&#125;/$&#123;doc.name&#125;&quot; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; author=&quot;true&quot; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; version=&quot;true&quot; <br/>&nbsp;&nbsp;&nbsp;&nbsp; use=&quot;true&quot; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doctitle=&quot;&amp;lt;h1&amp;gt;$&#123;build.title&#125; $&#123;build.version&#125;&amp;lt;/h1&amp;gt;&quot; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; windowtitle=&quot;$&#123;build.name&#125; $&#123;build.version&#125;&quot; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bottom=&quot;Copyright &amp;amp;copy; 1998-$&#123;current.year&#125; - $&#123;build.vendor&#125;&quot;&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;classpath refid=&quot;compile.classpath&quot;/&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/javadoc&gt; <br/>&lt;!-- 打包API文件和目录 --&gt; <br/>&lt;echo message=&quot;Compressing API Doc ...&quot;/&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;zip destfile=&quot;$&#123;build.path&#125;/$&#123;doc.name&#125;.rar&quot;&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;zipfileset dir=&quot;$&#123;build.path&#125;/$&#123;doc.name&#125;&quot;&nbsp;&nbsp; prefix=&quot;$&#123;doc.name&#125;&quot;/&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/zip&gt; <br/>&lt;!-- 打包之后清除构建的API文件和目录以及classes目录 --&gt; <br/>&lt;echo message=&quot;Deleting classes ...&quot;/&gt; <br/>&lt;delete dir=&quot;$&#123;classes.dir&#125;&quot;/&gt; <br/>&lt;echo message=&quot;Deleting API Doc ...&quot;/&gt; <br/>&lt;delete dir=&quot;$&#123;build.path&#125;/$&#123;doc.name&#125;&quot;/&gt; <br/>&lt;/target&gt; <br/><br/>&lt;/project&gt; <br/></span><br/>Tags - <a href="https://www.heckjj.com/tags/ant/" rel="tag">ant</a> , <a href="https://www.heckjj.com/tags/build/" rel="tag">build</a>
]]>
</description>
</item><item>
<link>https://www.heckjj.com/ant-build-xml-rar-jar/#blogcomment</link>
<title><![CDATA[[评论] 利用ant编译发布打包jar文件和打包api文档为rar文件]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://www.heckjj.com/ant-build-xml-rar-jar/#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>