`
shoppingbill
  • 浏览: 58324 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Ant Eclipse IDE Integration

    博客分类:
  • Ant
阅读更多

 

Ant > Ant Eclipse IDE Integration

Ant Eclipse IDE Integration

To integrate Ant build file with the Eclipse IDE, first create a build.xml file, right click the project select New->Other->XML, enter the name as build.xml and click Finish.

Eclipse IDE 集成Ant,首先要创建一个build.xml文件.右击工程选择 New->Other->XML,键入build.xml点击Finish.

<?xml version="1.0" ?> 
<project name="Ant Example" default="execute"> 
	<target name="init" depends="clean"> 
		<mkdir dir="build/classes" /> 
	</target> 
	<target name="compile" depends="init"> 
		<javac srcdir="src" destdir="build/classes" /> 
	</target> 
	<target name="execute" depends="compile"> 
		<java classname="com.vaannila.helloworld.HelloWorld" classpath="build/classes" /> 
	</target> 
	<target name="clean"> 
		<delete dir="build" /> 
	</target> 
</project>

 To build the project right click the build.xml file and select Ant Build.

build工程右击build.xml选择 Ant Build.

The HelloWorld.java file will be compiled and executed. The following message shows the sequence of events that happen once the build file is executed.

HelloWorld.java文件就会编译并运行.下面信息会依此显示出来.

Buildfile: E:\Eclipse Workspace\AntExample\build.xml 
clean: 
[delete] Deleting directory E:\Eclipse Workspace\AntExample\build 
init: 
[mkdir] Created dir: E:\Eclipse Workspace\AntExample\build\classes 
compile: 
[javac] Compiling 1 source file to E:\Eclipse Workspace\AntExample\build\classes 
execute: 
[java] Hello World! 
BUILD SUCCESSFUL 
Total time: 625 milliseconds

 You can download the build file here.

Build file :Download
Project :Download

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics