benel_IF05d_P08_gran..
Transcription
benel_IF05d_P08_gran..
Automatiser les procédures de production de logiciels Aurélien Bénel Systèmes d'information, management des connaissances et communication Bureau T107, [email protected] Qualité du logiciel, Université de technologie de Troyes, 10 novembre 2006 Exemple de procédure 2 Sources (*.java) Sources validées (subversion) Binaires (*.class) Ressources copiées Logiciel distribuable (*.jar) Logiciel déployé (java web start) Ressources (*.png , *.xsd…) Bibliothèques copiées (*.class) Tableau de bord (tests unitaires et de recette) Bibliothèques archivées (*.jar) Make ? 3 titi.o : titi.c gcc –c titi.c toto.o : toto.c titi.h gcc –c toto.c cible tata : toto.o titi.o gcc –o tata toto.o titi.o action(s) makefile $ make tata dépendances Apache Ant 4 <project default="tata"> <target name="tata" depends="toto, titi"> <commande de production/> … </target> <target … </target> … </project> build.xml $ ant $ ant toto -> Binaires 5 <target name="init"> <mkdir dir="build" /> </target> <target name="compile" depends="init"> <javac srcdir="src" destdir="build" /> </target> -> ressources copiées 6 <target name="resources" depends="init"> <copy todir="build/org/porphyry"> <fileset dir="src" excludes="**/*.java build.xml" /> </copy> </target> -> Tableau de bord 7 <project default="test"> … <target name="test" depends="compile, resources"> <junit> <batchtest> <fileset dir="build" includes="**/Test*.class"/> </batchtest> </junit> </target> … </project> -> Sources validées 8 <target name="validate" depends="test"> <svn username="${user}" password="{pass}"> <commit dir="src" message="${feature}"/> </svn> </target> $ ant validate –Duser=toto –Dpass=titi –Dfeature="viewpoints are displayed" -> Bibliothèques copiées 9 <target name="lib" depends="init"> <unjar dest="build"> <fileset dir="lib" includes="*.jar" /> <patternset includes="org/**" /> </unjar> </target> -> Logiciel distribuable 10 <target name="jar" depends="compile, resources, lib"> <jar jarfile="Porphyry.jar" basedir="build" excludes="**/Test*.class"> <manifest> <attribute name="Main-Class" value="org.porphyry.view.Portfolio" /> </manifest> </jar> </target> -> Logiciel déployé 11 <target name="deploy" depends="jar"> <scp todir="${user}:${pass}@tech-ada.utt.fr:/var/www/html/" trust="yes" file="Porphyry.jar" /> </target> $ ant deploy –Duser=toto –Dpass=titi Java Web Start 12 <jnlp codebase="http://tech-ada.utt.fr/java"> <information> <title>Porphyry</title> <vendor>ARTCADHi CNRS</vendor> <description>Digital space for building and confronting interpretations about documents. </description> <homepage href="http://www.porphyry.org/prototypes/expert/" /> <offline-allowed/> </information> <resources> <j2se version="1.5+"/> <jar href="Porphyry.jar"/> </resources> <application-desc/> </jnlp> toto.jnlp [application/x-java-jnlp-file] Bibliographie 13 Apache Software Foundation, Apache Ant Manual, 2005. Disponible sur : <http://ant.apache.org/manual> Chabanois C. et al., SvnAnt Manual, 2006. Disponible sur : <http://subclipse.tigris.org/svnant/svn.html> Dwight Shih, Ant and multiple JUnit test cases, 2003. Disponible sur : <http://ideoplex.com/id/41/ant-and-multiplejunit-test-cases> Sun Microsystems Inc., Java Web Start Guide, 2004. Disponible sur : <http://java.sun.com/javase/6/docs/technotes/guides/javaws/de velopersguide/contents.html>