Home
The APACHE ANT Project
Contents
1. T ches de d veloppement La t che javac lt javac gt permet la compilation de fichiers source contenus dans une arborescence de r pertoires srcdir r pertoire racine de l arborescence du r pertoire contenant les sources destdir r pertoire o les r sultats des compilations seront stock s classpath classpath pour l ex cution Il est aussi possible d utiliser un tag fils lt classpath gt pour le sp cifier classpathref utilisation d un classpath pr c demment d fini dans le fichier de build fork lance la compilation dans une JVM d di e au lieu de celle ou s ex cute Ant d faut est false source Version des sources java 1 4 1 5 deprecation avertissements du compilateur concernant l usage d l ments deprecated d faut est off target pr cise la version de la plate forme Java cible 1 1 1 2 1 3 1 4 nowarn debug optimize failonerror nicolas hernande niv nantes fr The APACHE ANT Project La t che j T ches de d veloppement build javac xml lt xml version 1 0 encoding UTF 8 gt lt project name Test javac task default compile basedir gt lt Definition des proprietes du projet gt lt property name sources dir value src gt lt property name build dir value build gt lt property name lib dir value lib gt lt Definition du classpath du projet gt lt path id projet classpath gt lt fileset dir lib dir gt lt include name
2. Gets a file from a URL Applies a diff file to originals FixCRLF Replace ReplaceRegExp Sync Tempfile Touch Checksum Chgrp Chmod Chown Concat nicolas hernandez univ nantes fr The APACHE ANT Project File Directory Archive tasks File Direct Archive Tasks Archive Tasks Zip Unzip Zips a set of files Expands a Zip file Jar Unjar Jars a set of files Unzips a jarfile Manifest Creates a manifest file Rpm Invokes the rpm executable to build a Linux installation file This task currently only works on Linux or other Unix platforms with RPM support Tar Untar Creates a tar archive Untars a tarfile BUnzip2 BZip2 Cab Ear GZip GUnzip War Unwar nicolas hernandez univ nantes fr The APACHE ANT Project Development tasks Compile Tasks Documentation Lo Compile Tasks Compile Tasks Javac Depend JspC Compiles the specified source file s within the running Ant VM or in another VM if the fork attribute is specified Determines which classfiles are out of date with respect to their source removing the classfiles of any other classes that depend on the out of date classes forcing the re compile of the removed classfiles Typically used in conjunction with the Javac task Runs the JSP compiler It can be used to precompile JSP pages for fast initial invocation of JSP pages deployment on a server without the full JDK installed or simply to syntax check the page
3. T ches Hello World T che echo La tache tstamp T ches de gestion de fichiers la tache mkdir La t che delete La t che copy T ches de d veloppement La t che javac La t che java La t che javadoc La t che jar T ches de gestion de projet avanc s La t che JUnit La t che svn nicolas hernandez univ nantes fr The APACHE ANT Project T che echo lt echo gt permet d crire dans un fichier ou d afficher un message durant l ex cution des traitements message the message to echo Optional file the file to write the message to Optional append Append to an existing file or open a new file overwrite an existing file Optional default is false level Control the level at which this message is reported Optional of error warning quiet q info no statement verbose verbose v debug debug d decreasing order Optional default is warning encoding encoding to use default is the local system encoding since Ant 1 7 Optional http ant apache org manual CoreTasks echo html nicolas hernandez univ nantes fr T che echo build echo xml lt xml version 1 0 encoding UTF 8 gt lt project name Test echo avec Ant default init basedir gt lt target name init gt lt echo message Debut des traitements gt lt echo gt Fin des traitements du projet ant project name lt echo gt lt echo message Ceci est un message warning level wa
4. gt lt delete gt lt delete gt lt fileset dir basedir srce includes svn gt lt delete gt lt target gt lt project gt ant buildfile build delete xml Buildfile build delete xml init delete Deleting home hernandez teaching TdD 05_NH_CM_ant test log txt delete Deleting directory home hernandez teaching TdD 05_NH_CM_ant test di BUILD SUCCESSFUL Total time 0 seconds IT Project T ches de gestion de fichiers La t che copy La t che copy lt copy gt Copies a file or resource collection to a new file or directory By default files are only copied if the source file is newer than the destination file or when the destination file does not exist build copy xml lt xml version 1 0 encoding UTF 8 gt lt project name Test de copy avec ant default init basedir gt lt Definition des proprietes du projet gt lt property name sources dir value src gt lt property name build dir value bin gt lt Initialisation des traitements gt lt target name init description Initialisation gt lt Copie des fichiers de configuration et parametrage gt lt copy todir projet build dir gt lt fileset dir projet sources dir gt lt include name x properties gt lt include name cfg xml gt lt fileset gt lt copy gt lt target gt lt project gt D autres options sont disponibles tofile overwrite IT Project
5. jar gt lt fileset gt lt pathelement location build dir gt lt path gt lt Compilation des classes du projet gt lt target name compile description Compilation des classes gt lt javac srcdir sources dir destdir build dir debug on optimize off deprecation on gt lt classpath refid projet classpath gt lt javac gt lt target gt lt project gt T ches de d veloppement La t che java lt java gt permet de lancer une machine virtuelle pour ex cuter une application compil e classname nom pleinement qualifi de la classe ex cuter jar nom du fichier de l application ex cuter classpath classpath pour l ex cution classpathref Utilisation d un classpath pr c demment d fini fork lancer l ex cution dans une JVM d di e au lieu de celle ou l ex cute Ant output enregistrer les sorties de la console dans un fichier nicolas hernandez univ nantes fr The APACHE ANT Project La t che j T ches de d veloppement La t che java build java xml lt xml version 1 0 encoding UTF 8 gt lt project name Test java task default execute basedir gt lt Definition des proprietes du projet gt lt property name sources dir value src gt lt property name build dir value build gt lt property name lib dir value lib gt lt Definition du classpath du projet gt lt path id projet classpath gt lt f
6. message and reading a line of input from the console Plays a sound file at the end of the build according to whether the build failed or succeeded Executes a series of SQL statements via JDBC to a database Statements can either be read in from a text file using the src attribute or from between the enclosing SQL tags Sets the DSTAMP TSTAMP and TODAY properties in the current project based on the current date and time Checks that XML files are valid or only well formed This task uses the XML parser that is currently used by Ant by default but any SAX1 2 parser can be specified nicolas hernandez univ nantes fr The APACHE ANT Project Misc task Property Tasks Misc and Property tasks Property Tasks Property Tasks Available Sets a property if a specified file directory class in the classpath or JVM system resource is available at runtime Basename Sets a property to the last element of a specified path Dirname Sets a property to the value of the specified file up to but not including the last path element Condition Sets a property if a certain condition holds true this is a generalization of Available and Uptodate XmlProperty Loads property values from a well formed XML file Whichresource Echoproperties LoadFile LoadProperties MakeURL PathConvert Property PropertyFile Uptodate nicolas hernandez univ nantes fr The APACHE ANT Project Exemples de mise en oeuvre de taches Sommaire
7. Les cibles lt target gt ensemble de t ches r aliser dans l ordre de pr sentation name le nom de la cible obligatoire description br ve description de la cible optionnel utile pour les IDE depends liste des cibles dont d pend la cible optionnel if conditionne l ex cution par l existence d une propri t optionnel unless conditionne l ex cution par l inexistance de la nicolas hernandez univ nantes fr The APACHE ANT Project Cat gories de taches Sommaire File Directory Archive tasks File Directory tasks Archive Tasks Development tasks Compile Tasks Documentation Logging and Testing Tasks Execution Tasks Execution Tasks Remote Tasks Misc and Property tasks Misc tasks Property Tasks Un aper u complet des t ches standardes disponibles http ant apache org manual tasksoverview html nicolas hernandez univ nantes fr The APACHE ANT Project File Directory Archive tasks File Directory tasks Archive Task File Directory tasks File Directory tasks Copy Delete Mkdir Move Get Patch Copies a file or Fileset to a new file or directory Deletes either a single file all files and sub directories in a specified directory or a set of files specified by one or more FileSets Creates a directory Non existent parent directories are created when necessary Moves a file to a new file or directory or a set s of file s to a new directory
8. The APACHE ANT Project Another Neat Tool un autre chouette outil ant apache org Nicolas Hernandez IUT de Nantes D partement Informatique LINA Laboratoire d Informatique de Nantes Atlantique Cours de Licence Professionnelle 2007 2008 Nantes le 22 novembre 2007 nicolas hernandez univ nantes fr Sommaire A D Motivations principe de l outil ant installation ex cution Structure du fichier de configuration build xml Les cat gories de taches Mises en oeuvres des taches classiques investies dans des cibles habituelles compilation g n ration de documentation test et versionning D finir ses propres taches 6 ant dans Eclipse Sujet du TP nicolas hernandez univ nantes fr The APACHE ANT Project Introduction Sommaire Introduction Motivations Principe Installation Ex cution niv nantes fr The APACHE ANT Project Motivations Introduction Motivations L objectif du projet ant apache org est de fournir un outil pour permettre gt la construction d applications gt l automatisation les op rations r p titives du cycle du d veloppement nettoyage du projet compilation g n ration de la documentation versionning test d ploiement gt l ind pendance envers toute plate forme crit en Java gt la configuration l aide d un fichier de XML qui d crit les t ches ex cuter gt l extension en permettant l criture de nouvell
9. arfile nom du fichier jar cr er basedir r pertoire qui contient les l ments ajouter dans l archive compress spr cise si le contenu de l archive doit tre compress ou non Par d faut est true manifest le fichier manifest qui sera utilis dans l archive build jar xml lt xml version 1 0 encoding UTF 8 gt lt project name Test jar avec Ant default packaging basedir gt lt l ssssssSSS SSS SSS S555 5 SSS SSS SS SS SS SS SS SSS SSS SS SS gt lt G n ration de l archive jar lt l sesssssssssssss sss SSS SSS SSS SSS SSS gt lt target name packaging gt lt jar jarfile test jar basedir src gt lt target gt lt project gt nicolas hernandez univ nantes fr The APACHE ANT Project La t che Taches de gestion de projet avanc s La t che JUnit Installation gt R cup rer JUnit jar http www junit org gt export CLASSPATH CLASSPATH APPLI JUnit junit 4 4 jar Description des t ches lt junit gt This task runs tests from the JUnit testing framework lt formater gt print results of tests in different formats plain xml lt test gt Defines a single test class lt batchtest gt Define a number of tests based on pattern matching http ant apache org manual OptionalTasks junit html nicolas hernandez univ nantes fr Taches de gestion de projet avanc s La t che JUnit build junit xml lt junit printsummary yes haltonfailure yes
10. ead Sequential A container task that can contain other Ant tasks The nested tasks are simply executed in sequence Its primary use is to support the sequential execution of a subset of tasks within the lt parallel gt tag Sleep A task for suspending execution for a specified period of time Useful when a build or deployment process Q 10 fit DN Task nicolas herne univ nantes fr The APACHE ANT Project Execution Ta Execution Tasks Remote Tasks Remote Tasks FTP Scp set Proxy Sshexec Telnet Implements a basic FTP client that can send receive list and delete files and create directories Copy files to or from a remote server using SSH Sets Java s web proxy properties so that tasks and code run in the same JVM can have through the firewall access to remote web sites Execute a command on a remote server using SSH Task to automate a remote telnet session This task uses nested lt read gt and lt write gt tags to indicate strings to wait for and specify text to send nicolas hernandez univ nantes fr The APACHE ANT Project Misc tasks Misc tasks Property Task Misc and Property tasks Mail A task to send SMTP email Echo Fail Input Sound Sql TStamp XmlValidate Echoes text to System out or to a file Exits the current build by throwing a BuildException optionally printing additional information Allows user interaction during the build process by displaying a
11. emple de build properties build properties svnant version 1 0 0 lib dir lib svnant jar lib dir svnant jar svnClientAdapter jar lib dir svnClientAdapter jar svnjavahl jar lib dir svnjavahl jar svnant latest url http subclipse tigris org svn subclipse trunk svnant svnant this url http subclipse tigris org svn subclipse tags svnant svnant v ersion svnant repository user guest svnant repository passwd build xml part 1 2 lt all properties are in build properties gt lt property file build properties gt lt path to the svnant libraries Usually in ANT_HOME lib gt lt path id project classpath gt lt pathelement location svnjavahl jar gt lt pathelement location svnant jar gt lt pathelement location svnClientAdapter jar gt a Th CHE ANT Project nicola nande La t che svn T ches de gestion de projet avanc s La t che svn build xml part 2 2 lt load the svn task gt lt taskdef resource svntask properties classpathref project classpath gt lt target name clean gt lt delete dir src_latest gt lt delete dir src_S svnant version gt lt target gt lt target name checkoutLatest gt lt svn username svnant repository user wd gt password svnant repository pass lt checkout url svnant latest url revision HEAD destPath src_latest gt lt svn gt lt target gt lt
12. erche un fichier build xml dans le r pertoire courant gt si aucune cible n est sp cifi e il prendra celle d clar e par d fault dans le fichier ant Sp cification d un fichier de configuration ant buildfile monbuild xml Ex cution de la cible clean et toutes les cibles dont elle d pend ant clean ant interfac dans de nombreux IDEs Existence de plugins pour Eclipse NetBeans IntelliJ IDEA nicolas hernandez univ nantes fr The APACHE ANT Project Le fichier build xml Sommaire Le fichier build xml l l ment racine et le corps Le fichier build xml l l ment racine Le corps du fichier build xml Les propri t s Les propri t s d finitions et utilisations Les ensembles de fichiers Les ensembles de fichiers Les l ments de chemins et les cibles Les l ments de chemins et les cibles nicolas hernandez univ nantes fr The APACHE ANT Project Le fichi nent racine et le corps Le fichie 1 l l ment racine Le fichier build xml et l l ment racine project Le fichier build xml contient la description du processus de construction de l application Le prologue lt xml version 1 0 encoding UTF 8 gt ou bien ISO 8859 1 L l ment racine du document et ses attributs gt name nom du projet gt default cible par d faut ex cuter si aucune cible pr cis e gt basedir r pertoire de r f rence pour la localisation relative des autres r pertoir
13. es lt project name mon projet default compile basedir gt Note concernant l adressage de fichiers gt Quelque soit la plate forme un chemin utilise la caract re slash comme s parateur gt L expression permet de d signer tous les sous r pertoires du r pertoire d fini dans l attribut dir r pertoire nicolas hernande niv nantes fr The APACHE ANT Project Le fichier build xml l l ment racine et Le corps du fichier bui Le corps du fichier build xml et les commentaires Les commentaires lt Ceci est un exemple de commentair gt Le corps et les d finitions des 1 propri t s properties variables qui contiennent des valeurs utilisables par des cibles ou taches 2 ensembles de fichiers fileset patternset filelist d finis en sp cifiant explicitement des r pertoires des patrons des listes exhaustives de fichiers 3 cibles targets tapes du projet de construction qui mettent en oeuvre des taches traitements unitaires habituellement pr sent es dans cet ordre nicolas hernandez univ nantes fr The APACHE ANT Project Les propri t s Les propri t s d finitions et utilisations Les propri t s d finition Utilit d finir une seule fois une valeur qui est utilis e plusieurs fois dans le projet D finition des variables gt avec l option D nom valeur en ligne de commande gt avec la balise property dans le build xml Dans le bui
14. es t ches nicolas hernandez univ nantes fr The APACHE ANT Project Introduction Principe E build xml gt la commande ant repose sur un fichier de configuration build xml gt le build xml contient un ensemble de cibles target qui constituent les tapes Cible du projet de construction Tache gt chaque cible contient une ou plusieurs t ches task ordonn es qui constituent des traitements unitaires r aliser gt chaque cible peut avoir une d pendance depends envers une ou plusieurs autres cibles pour pouvoir s ex cuter Fichier de configuration Ant Cible Tache Tache nicolas hernandez univ nantes fr The APACHE ANT Project Introduction Installation Installation Download ant apache org Requirement un JDK plut t qu un JRE sans quoi des t ches indisponibles Setup Linux Unix bash export ANT_HOME mon local ant export JAVA_HOME usr local jdk 1 5 0 05 export PATH S PATH ANT_HOME bin Install dans le ANT_HOME Linux Unix bash sh build sh install Dependencies dans le CLASS_PATH Entre autres xalan jar XSL transformer junit jar mail jar Groovy jars scripts Java jdepend jar nicolas hernandez univ nantes fr The APACHE ANT Project Introduction Ex cution Utilisation en ligne de commande selon la syntaxe ant options cible Comportement par d faut gt rech
15. gt lt classpath gt lt pathelement location build tests gt lt pathelement path java class path gt lt classpath gt lt formatter type plain gt lt test name my test TestCase haltonfailure no outfile result gt lt formatter lt test gt type xml gt lt batchtest fork yes todir reports tests gt lt fileset dir src tests gt lt include lt exclude lt fileset gt lt batchtest gt lt junit gt printsummary fork haltonfailure timeout todir name xTest java gt name x AllTests java gt Print one line statistics for each testcase Run the tests in a separate VM Stop the build process if a test fails Cancel the individual tests if they don t finish in the given time Directory to write the reports to IT Project La t che svn T ches de gestion de projet avanc s La t che svn Installation gt R cup rer svnant jar svnClientAdapter jar et svnjavahl jara partir de l archive svnant http subclipse tigris org svnant html gt Les mettre dans le classpath Description de la t che svn http subclipse tigris org svnant svn html gt Exemple de build xml mettant en oeuvre svnant dans l archive r cup r e ci dessus gt Autres exemples d utilisation subversion open collab net articles IntegratingSubversionIntoYourAntBuild html ec univ nante Taches de gestion de projet avanc s La t che svn Un ex
16. ileset dir lib dir gt lt include name jar gt lt fileset gt lt pathelement location build dir gt lt path gt lt Execution de HelloWorld gt lt target name execute description Execution de HelloWorld gt lt java classname HelloWorld fork true gt lt classpath refid projet classpath gt lt java gt lt target gt lt project gt T ches de d veloppement La t che La t che Javadoc lt javadoc gt g n ration de la documentation au format javadoc des classes incluses dans une arborescence de r pertoires sourcepath le r pertoire de base qui contient les sources dont la documentation est g n rer destdir le r pertoire qui va contenir les fichiers de documentation g n r s build javadoc xml lt xml version 1 0 encoding UTF 8 gt lt project name Test javadoc avec Ant default javadoc basedir gt lt l sss s S S S SSSSSSS SSS SSS SS SSS gt lt G n ration de la documentation Javadoc gt lt l s s s s S S S S SSSSSSSSS SSS SS SSS gt lt target name javadoc gt lt mkdir dir doc gt lt javadoc sourcepath src destdir doc gt lt fileset dir src defaultexcludes yes gt lt include name gt lt fileset gt lt javadoc gt lt target gt lt project gt nicolas hernandez univ nantes fr T ches de d veloppement La t che jar lt jar gt la cr ation d une archive de type jar j
17. isateur http ant apache org manual index html Tutoriels http ant apache org manual tutorials html Hello World with Ant Writing Tasks Tasks using Properties Filesets amp Paths Ant et Eclipse http nelp eclipse org help33 index jsp topic org eclipse platform doc user puis gettingStarted qs 81_basics htm ou concepts concepts antsupport htm Manuels non officiel et non complet de ant et maven en fran ais http www jmdoudoux fr java dej index htm Ant et JUnit http ant apache org manual OptionalTasks junit html Antetsvnhttp subclipse tigris org svnant html nicolas hernandez univ nantes fr 2 Project
18. ld xml lt property file mesproprieteslocales properties gt lt property name projet nom value mon_projet gt lt property name projet version value 0 0 10 gt lt property name projet license location doc LICENSE gt lt property name src dir value src gt lt property name build dir value build gt file un fichier qui contient une liste de lignes nom valeur location un fichier dont le contenu d signe une valeur niv nantes fr The APACHE ANT Project Les propri t s Les propri t s d finitions et utilisations Les propri t s utilisation Utilisation l aide de S projet name Ordre de d finition des propri t s seule la premi re d finition d une propri t compte les suivantes sont ignor es Propri t s pr d finies attention changements depuis ant 1 7 basedir chemin absolu du r pertoire de travail ant file chemin absolu du fichier build en cours de traitement ant java version version de la JVM qui ex cute ant v vV Vv iy ant project name nom du projet en cours d utilisation niv nantes fr The APACHE ANT Project Les ensembles de fichiers Les ensembles de fichiers Les ensembles de fichiers Les ensembles de fichiers fileset utilis s au sein d une autre t che dir R pertoire de d part de l ensemble de fichiers includes Liste des fichiers inclure excludes Liste des fichiers exclure lt fileset dir s
19. on existent parent directories are created when necessary Does nothing if the directory already exist http ant apache org manual CoreTasks mkdir html build mkdir xml lt xml version 1 0 encoding UTF 8 gt lt project name Test mkdir avec Ant default init basedir gt pause lt target name init gt lt mkdir dir basedir build gt lt mkdir dir basedir src gt lt mkdir dir basedir dist gt lt mkdir dir basedir lib gt lt target gt lt project gt Avec dir le chemin et le nom du r pertoire a cr er ant buildfile build mkdir xml Buildfile build mkdir xml init mkdir Created dir home hernandez teaching TdD 05 NH CM ant test build mkdir Created dir home hernandez teaching TdD 05 NH CM ant test src mkdir Created dir home hernandez teaching TdD 05_NH_CM_ant test dist mkdir Created dir home hernandez teaching TdD 05_NH_CM_ant test lib BUILD SUCCESSFUL Total time 0 seconds ec univ nante T ches de gestion de fichiers La t che delete La t che delete lt delete gt supprime des fichiers ou des r pertoires build delete xml lt xml version 1 0 encoding UTF 8 gt lt project name Test delete avec Ant default init basedir gt lt target name init gt lt delete dir basedir dist includeEmptyDirs true gt lt delete file basedir log txt gt lt delete gt lt fileset dir basedir build includes class
20. rc includes x x java gt Les ensembles de motifs patternset id Identifiant pour l ensemble qui pourra ainsi tre r utilis refid Demande la r utilisation d un ensemble dont l identifiant est fourni comme valeur ainsi que includes et excludes lt fileset dir src gt lt patternset id source_code gt lt include name java gt lt exclude name xx x gt lt patternset gt lt fileset gt ec univ nante Les ensembles de fichiers Les ensembles de fichiers Les ensembles de fichiers Listes de fichiers finies id Identifiant pour l ensemble qui pourra ainsi tre r utilis dir R pertoire de d part de l ensemble de fichiers files Liste des fichiers s par s par une virgule refid Demande la r utilisation d un ensemble dont l identifiant est fourni comme valeur lt filelist dir texte files fichierl txt fichier2 txt gt Liste traditionnelle de fichiers exclure xx x xx cvsignore xx txt xx SCCS xx te xx SCCS xx ae ERS xx vssver scc xx x x svn xx CVS xx svn xx xx CVS xx xx DS_Store nicolas hernandez univ nantes fr 2 Project Les l ments de chemins et les cibles Les l ments de chemins et les cibles Les l ments de chemins les t ches et les cibles Ajout d l ments la variable classpath pathelement lt classpath gt lt pathelement location lib mabib jar gt lt pathelement location ext gt lt classpath gt
21. rning gt lt echo message Ceci est un message debug level debug gt lt echo file basedir log txt append false message Debut Traitement gt lt echo file basedir log txt append true gt Fin Traitement lt echo gt lt target gt lt project gt T che echo ant quiet buildfile build echo xml Buildfile init echo echo echo echo echo build echo xml Debut des traitements Fin des traitements du projet Test echo avec Ant Ceci est un message warning BUILD SUCCESSFUL Total time 0 seconds T ches Hellc La t che tstamp lt tstamp gt d finit trois propri t s DSTAMP la date du jour au format AAAMMJJ TSTAMP l heure actuelle sous la forme HHMM TODAY la date du jour au format long build tstamp xml lt xml version 1 0 encoding UTF 8 gt lt project name Test tstamp avec Ant default init basedir gt lt target name init gt lt tstamp gt lt echo message Nous sommes le TODAY gt lt echo message DSTAMP DSTAMP gt lt echo message TSTAMP TSTAMP gt lt target gt lt project gt ant buildfile build tstamp xml Buildfile build tstamp xml init echo Nous sommes le November 21 2007 echo DSTAMP 20071121 echo TSTAMP 1120 BUILD SUCCESSFUL Total time 0 seconds IT Project la t che mkdir T ches de gestion de fichiers La t che mkdir lt mkdir gt Creates a directory Also n
22. roit sur une des cibles Puis Run as gt Ant Build ec univ nante Sujet du TP Sujet du TP Construire pour votre projet un build xml contenant les cibles init prepare clean compile compile test test javadoc dist deploy properties usage clean Initialisation d finition des propri t s Pr paration cr ation des r pertoires par exemple Suppression de tout ce que le processus de construction peut produire Compilation des sources de l application Compilation des sources de test Ex cution des tests unitaires Cr ation de la Javadoc Cr ation d une archive des sources de la distribution D ploiement de l application sur le serveur cible Affichage des valeurs de la configuration Affichage des cibles disponibles nettoie les class produits et les r pertoires inutiles checkout commit update diff patch tag versionning avec svn ACHE ANT Project nicolas hernandez univ nantes fr Conclusion Conclusion Synth se multi plate forme configurable gr ce un fichier XML open source extensible v v v yY Perspective gt actuellement la version 1 7 depuis octobre 2006 possibilit de probl mes de compatibilit suivant la version install e gt make le pass et maven le futur nicolas hernandez univ nantes fr The APACHE ANT Project Bibliographie Bibliographie Gestion de Version gt gt gt Site officiel http ant apache org Manuel d util
23. s without deploying them The Javac task can be used to compile the generated Java source For Weblogic JSP compiles see the Wijspc task nicolas hernandez univ nantes fr The APACHE ANT Project Development tasks Documentation Logging and Testing Tasks Documentation Logging and Testing Tasks Documentation Tasks Javadoc Generates code documentation using the javadoc tool Logging Tasks Record Runs a listener that records the logging output of the build process events to a file Several recorders can exist at the same time Each recorder is associated with a file Testing Tasks Junit Runs tests from the Junit testing framework This task has been tested with JUnit 3 0 up to JUnit 3 7 it won t work with versions prior to JUnit 3 0 JunitReport Merges the individual XML files generated by the Junit task and applies a stylesheet on the resulting merged document to provide a browsable report of the nicolas hernana v nantes fr The APACHE ANT Project Execution Tasks Execution Tasks Execution Tasks Execution Tasks Ant Runs Anton a supplied buildfile AntCall Runs another target within the same buildfile Apply ExecOn Exec Executes a system command Java Executes a Java class within the running Ant VM or in another VM if the fork attribute is specified Parallel A container task that can contain other Ant tasks Each nested task specified within the lt parallel gt tag will be executed in its own thr
24. sse doit enfin comporter une m thode public void throws BuildException execute nicolas hernandez univ nantes fr The APACHE ANT Project Code de la cl nentant la tache Code de la classe impl mentant la tache Package tdd import org apache tools ant BuildException import org apache tools ant Task public class MaTacheAMoi extends Task private String msg La m thode appel e par Ant pour l execution de la tache public void execute throws BuildException System out println msg Accesseur pour l attribut message public void setMessage String msg this msg msg nicolas hernandez univ nantes fr 2 Project Conclusion Sommaire ant et Eclipse Sujet du TP Conclusion Bibliographie nicolas hernandez univ nantes fr The APACHE ANT Project ant et Eclipse ant et Eclipse Documentation http help eclipse org help33 index jsp topic org eclipse platform doc user gt puis gettingStarted qs 81_basics htm gt ouconcepts concepts antsupport htm En bref Cr er un projet partir d un ant buildfile ou en ajouter un gt soitFile gt New gt Java Project gt Create a new project java from an existing ant buildfile gt soitFile gt New gt File Ex cuter gt dans la vue Package bouton droit sur le fichier build xml s lectionn gt ou bien Icone Run avec la malette de la barre de menu horizontale gt ou bien dans la vue Outline bouton d
25. target name checkoutThis gt lt svn username svnant repository user password svnant repository pass wd gt lt checkout url svnant this url revision HEAD destPath src_ svnant version gt lt svn gt lt target gt D finir ses propres taches Sommaire D finir une tache ant dans le build xml La classe impl mentant cette tache Code de la classe impl mentant la tache nicolas hernandez univ nantes fr The APACHE ANT Project D finir une t che ant dans D finir une tache ant dans le build xml Ant permet de d finir ces propres taches lt xml version 1 0 gt lt project name ExempleNotreTache default main basedir gt lt taskdef name matache classname tdd MaTacheAMoi gt lt target name main gt lt matache message Ant is Great gt lt target gt lt project gt ec univ nante La classe impl mentant cette t che gt Laclasse impl mentant cette tache doit tendre org apache tools ant Task gt Un accesseur en criture doit tre d fini pour chaque attribut Il aura la forme traditionnelle en Java setNomAttribut Le type recu en param tre de cette m thode peut tre String ou n importe quel des types de base Ant se chargeant des conversions gt Chaque sous l ment support par la t che devra de la m me mani re tre trait par le biais de m thodes Element OU addNom createNom Element gt La cla
Download Pdf Manuals
Related Search
Related Contents
<ドラレコ1の特徴> COBY electronic CSP96 User's Manual 取空 説明書 User Manual Xavax Wanda Tempophore - septodont Gerät Ein - Castle Group Ltd KOHLER K-T16248-4-BN Installation Guide Copyright © All rights reserved.
Failed to retrieve file