Any tutor

249 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
249
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Any tutor

  1. 1. Ant Tutor. Jaiyalas
  2. 2. Antbuildfile
  3. 3. is XML
  4. 4. • one Projecthas • at least one (default) Target • tasks
  5. 5. buildfile (XML) = Project Target Target TargetTask Task Task Task Task Task Task Task
  6. 6. Project
  7. 7. Setup Basic Properties of Certain Project but not necessary
  8. 8. •name•default as Properties•basedir• description as Element but not necessary
  9. 9. e.g. <project name="myPro" default="build" basedir="."> <description>This is my first project</description> ... </project>
  10. 10. Target
  11. 11. has Attributes
  12. 12. •name• depends• if } Condition• unless• description
  13. 13. Depends andCondition
  14. 14. e.g. 2 <target name=”A” /> 1 <target name=”B” /> 3 <target name=”C” depends=”B, A” /> 1 <target name=”A” /> 2 <target name=”B” depends=”A”/> 3 <target name=”C” depends=”B, A” />
  15. 15. e.g. <condition property="myTarget.run"> <and> <available file="foo.txt"/> <available file="bar.txt"/> </and> </condition> =if( fileExist(foo.txt) && fileExist(bar.txt)) setProperty(myTarget.run)
  16. 16. e.g.<target name="myTarget" depends="myTarget.check" if="myTarget.run"> <echo>Files foo.txt and bar.txt are present.</echo></target><target name="myTarget.check"> <condition property="myTarget.run"> <and> <available file="foo.txt"/> <available file="bar.txt"/> </and> </condition></target>
  17. 17. Task
  18. 18. Function
  19. 19. dirname unjar propertyecho fail javadoc javac java jarchecksum delete move copy mkdir chmod manifest
  20. 20. e.g. <property name="betadir" location="${basedir}/beta"/> <property name=”alphadir” location=”${betadir}/alpha”>
  21. 21. appendix Scala
  22. 22. e.g. <property name="scala.dir" location="scala-2.8.0.r18549-b20090823020847"/> <property name="scala.lib.dir" location="${scala.dir}/lib"/> <path id="project.classpath"> <pathelement location="${scala.lib.dir}/scala-library.jar"/> </path> <taskdef resource="scala/tools/ant/antlib.xml"> <classpath> <pathelement location="${scala.lib.dir}/scala-compiler.jar"/> <pathelement location="${scala.lib.dir}/scala-library.jar"/> </classpath> </taskdef> <target name="compile"> <mkdir dir="${cls.build.dir}"/> <fsc srcdir="${src.dir}" destdir="${cls.build.dir}" classpathref="project.classpath" force="never" deprecation="yes" unchecked="yes"> <include name="**/*.scala"/> </fsc> </target>

×