• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Ant vs Phing
 

Ant vs Phing

on

  • 9,768 views

Parola chiave "automatizzare"

Parola chiave "automatizzare"

Statistics

Views

Total Views
9,768
Views on SlideShare
9,766
Embed Views
2

Actions

Likes
11
Downloads
0
Comments
0

2 Embeds 2

http://www.techgig.com 1
https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Cos’è Ant\nCos’è Phing\nCosa possiamo automatizzare\nCosa possiamo automatizzare con Ant/Phing\nPrincipali gruppi di task\nTarget -> Target chain\n\n
  • \n
  • Quotidianamente, Compiti ripetitivi (e noiosi): fare i backup, lavare la macchina, trasformare immagini in serie, cambiare i pannolini, deploy di siti web, test del codice, verifica delle performance, lavare i denti, minimizzare js e css\nPer fortuna ci sono molte cose che si possono automatizzare con i sistemi di build automation\nutilizzare software BA è una best practice perchè procedure manuali sono passive di errori, BA sono autodocumentate, aumentano la nostra produttività, le BA possono essere lanciate da altri sistemi, cron, CI\n\n
  • Quanti utilizzano software di build automation?\nAnt/Phing/Altro\n\n
  • \n
  • in principio\n
  • luglio 2000 1.1\nben si adatta\n
  • tracce nel 2001\n2004 porting su PHP5\n
  • Consigliato JDK 1.4, sconsigliato perchè non funzionano diversi task (dal sito non è dato sapere quali)\n
  • PHPUnit 3.4\nSimpletest\nXdebug 2\nPhpdocumentor\n
  • Jenkins, Cruise control, Bamboo: entrambi, bamboo con symlink\n\n
  • Template for Jenkins jobs for PHP project\n
  • Template for Jenkins jobs for PHP project\n
  • I maggiori programmi utilizzati (a parte Vi ed Emacs), Cross platform (tranne Textmate)\nNe utilizzate altri?\n
  • * Eclipse si, ZS version <8\n** Bundle non in rete ma da creare a mano\n*** Presente ad oggi solo in Early Access Program (probabilmente dalla 2.1)\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • per ant, git e svn non sono nel ramo ufficiale ma si trovano dei plugin/macro\n
  • Mess Detector, analizza il codice e fornisce un report su possibli bug, espressioni complicate, parametri metodi e proprietà non utilizzati\n\n
  • In realtà originariamente Ant supportava l’attributo “command” ma ora è deprecato\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • oltre ad include/exclude, dimensione, created at, dir/file, quale livello del fs\nricrea la struttura\noltre al fileset esistono altri type, filelist, mapper, filter\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n\n
  • \n\n
  • \n

Ant vs Phing Ant vs Phing Presentation Transcript

  • Ant vs Phingparola chiave automatizzare
  • Ego slide • Manuel “Kea” Baldassarri • Senior Developer in Ideato • PHP developer dal 1992 • Marito e Padre • mb@ideato.it twitter: k3a • flickr: kea42 slideshare: kea42http://phpday.it #phpday @k3a
  • Automatehttp://phpday.it #phpday @k3a
  • ? Te stohttp://phpday.it #phpday @k3a
  • Build automation software http://en.wikipedia.org/wiki/List_of_build_automation_softwarehttp://phpday.it #phpday @k3a
  • GNU makehttp://phpday.it #phpday @k3a
  • Ant • Ant is kind of GNU make • Ant is a Java library and command-line tool • Ant is Open Source, maintained by Apache • Ant is cross platform and portable • Ant is well suited to a large number of automation and scripting taskshttp://phpday.it #phpday @k3a
  • Phing • PHing Is Not GNU make • Its a PHP project build system or build tool based on Apache Anthttp://phpday.it #phpday @k3a
  • Installation Ant • Apt-get o Yum • Donwload binary file and setup the env • SVN + Build • Requires JRE 1.4http://phpday.it #phpday @k3a
  • Installation Phing • PEAR • Donwload binary file and setup the env • SVN • Requires PHP 5.2http://phpday.it #phpday @k3a
  • http://phpday.it #phpday @k3a
  • Phing and Jenkinshttp://phpday.it #phpday @k3a
  • Ant and Jenkinshttp://phpday.it #phpday @k3a
  • http://phpday.it #phpday @k3a
  • Ant Phing Netbeans Plugin No Eclipse Plugin wip Built-in* Zend Studio Run cmd Textmate Bundle** Bundle** phpStorm No Built-in*** Komodo Run cmd Run cmdhttp://phpday.it #phpday @k3a
  • How they work • XML configuration file • Project, Target, Task, Property, Typehttp://phpday.it #phpday @k3a
  • http://phpday.it #phpday @k3a
  • project <?xml version="1.0" ?> <project name="TestProject" basedir="." default="main"> <!-- Everything else goes here --> </project>http://phpday.it #phpday @k3a
  • target <target name="main"> <!-- everything else goes here --> </target>http://phpday.it #phpday @k3a
  • target <target name="t1">...</target> <target name="t2">...</target> <target name="main" depends="t1,t2"> ... </target>http://phpday.it #phpday @k3a
  • target <target name="t1" depends="t3">...</target> <target name="t2" depends="t3">...</target> <target name="t3">...</target> <target name="t4" depends="t1,t2"> ... </target>http://phpday.it #phpday @k3a
  • Tasks • Archive • Logging • Audit/Coverage • Mail • Deployment • Remote • Documentation • Versioning • File • Testinghttp://phpday.it #phpday @k3a
  • Useful tasks • scp • ssh (phing), sshexec (ant) • ftpdeploy (phing), ftp (ant) • tar (gzip, bzip2), zip • git*, svn*, cvshttp://phpday.it #phpday @k3a
  • Useful Phing tasks • PHPUnit • JsLint, JsMin • PHPDocumentor • XMLLint • PHPDepend • PHPLint • PHPMD • Tidy • PHPCPD • S3http://phpday.it #phpday @k3a
  • ExecTask ANT <exec executable="ls"> <arg value="-l"/> <arg value="/tmp"/> </exec> PHING <exec command="ls -l /tmp" />http://phpday.it #phpday @k3a
  • property Build.xml <property name="db.name" value="phpday" /> <property name="db.user" value="k3a" /> <property name="db.port" value="3306" /> build.properties file db.name = phpday db.user = k3a db.port = 3306 <property file=build.properties />http://phpday.it #phpday @k3a
  • property <project default="uno"> <property name="chi_sono" value="io" /> <target name="uno"> <echo>Chi sono: ${chi_sono}</echo> </target> </project> $ ant uno: [echo] Chi sono: iohttp://phpday.it #phpday @k3a
  • property <project default="uno"> <property name="chi_sono" value="io" /> <target name="uno"> <echo>Chi sono: ${chi_sono}</echo> </target> </project> $ ant -Dchi_sono=phpDay uno: [echo] Chi sono: phpDayhttp://phpday.it #phpday @k3a
  • property <project default="uno"> <property name="chi_sono" value="io" /> <target name="uno"> <property name="chi_sono" value="voi" /> <echo>Chi sono: ${chi_sono}</echo> </target> </project> $ ant uno: [echo] Chi sono: iohttp://phpday.it #phpday @k3a
  • fileset <project> <fileset dir="." id="foo"> <include name="*.php" /> </fileset> <target name="uno" > <copy todir="/tmp"> <fileset refid="foo" /> </copy> </target> </project>http://phpday.it #phpday @k3a
  • fileset <fileset dir="/tmp" id="fileset1"> <include name="dir1/file.txt" /> <include name="dir2/**" /> <exclude name="dir2/**/i*.php" /> </fileset>http://phpday.it #phpday @k3a
  • fileset <scp todir="user:password@somehost:/home/chuck"> <fileset dir="src_dir"> <include name="**/*.java"/> </fileset> </scp> <scp file="myfile.txt" todir="user@somehost:/home/chuck" keyfile="${user.home}/.ssh/id_dsa" passphrase="my extremely secret passphrase" />http://phpday.it #phpday @k3a
  • PHP Project Wizard (PPW) ppw --source src --tests tests --name myproject PHP Project Wizard (PPW) 1.0.4 by Sebastian Bergmann. Wrote build script for Apache Ant to ./build.xml Wrote configuration for PHPUnit to ./phpunit.xml.disthttp://phpday.it #phpday @k3a
  • build.xml <target name="parallelTasks"> <parallel threadCount="2"> <sequential> <antcall target="pdepend"/> <antcall target="phpmd"/> </sequential> <antcall target="phpcpd"/> <antcall target="phpcs"/> <antcall target="phpdoc"/> <antcall target="phploc"/> </parallel> </target>http://phpday.it #phpday @k3a
  • build.xml <target name="phpmd" description="Generate pmd.xml PHPMD"> <exec executable="phpmd"> <arg line="${source} xml codesize,design,naming,unusedcode --reportfile ${basedir}/build/logs/pmd.xml" /> </exec> </target>http://phpday.it #phpday @k3a
  • Conclusions 42http://phpday.it #phpday @k3a
  • ? Te stohttp://phpday.it #phpday @k3a
  • Lasciate un feedback! http://joind.in/2999http://phpday.it #phpday @k3a
  • Riferimenti • Apache Ant: http://ant.apache.org/ • Phing: http://www.phing.info/trac/ • phpunit, ppw, phpcpd, phploc... https://github.com/sebastianbergmann • phpmd: http://phpmd.org • phpdepend: http://pdepend.org/ • Extending phing: http://www.phing.info/docs/guide/ current/chapters/ExtendingPhing.htmlhttp://phpday.it #phpday @k3a