SitePoint Sponsor

User Tag List

Results 1 to 18 of 18

Thread: Phing

  1. #1
    SitePoint Addict chiefmonkey's Avatar
    Join Date
    Aug 2002
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Phing

    I have been working with Java a lot over the last year and have been using tools such as Ant and Cruise Control to automate builds in projects.

    So I really happy when i learnt about Phing. I wonder how many people use this tool. I was looking into it, but it seems to be missing a rather important feature. That is the ability to connect to some kind of Version Control (svn, cvs) and grab the latest files for a build.

    Now of course this comes with the caveat that I may have missed this feature as a search for phing and cvs on google returns nothing more than how to get the latest files for phing. A quick search of the user manual doesn't turn up anything either.

    George
    Got Sig!

  2. #2
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there any reason why wouldn't you use Ant or CC for PHP too?

  3. #3
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Phing has support for SubVersion....

    Checkout http://phing.info/

    Im not sure how the SVN works, but I've seen it in there repository.
    Eric Coleman
    We're consentratin' on fallin' apart
    We were contenders, now throwin' the fight
    I just wanna believe, I just wanna believe in us

  4. #4
    SitePoint Addict chiefmonkey's Avatar
    Join Date
    Aug 2002
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BerislavLopac
    Is there any reason why wouldn't you use Ant or CC for PHP too?
    Well no...but I thought it would be nice to use Phing, and also contribute back t the project.

    George
    Got Sig!

  5. #5
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hrm... I was wrong, there is no SVN task...

    Im going to attempt to create a SVN task... possibly a CVS one as well... you interested in lending a hand?

    - Eric
    Eric Coleman
    We're consentratin' on fallin' apart
    We were contenders, now throwin' the fight
    I just wanna believe, I just wanna believe in us

  6. #6
    SitePoint Addict chiefmonkey's Avatar
    Join Date
    Aug 2002
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Eric.Coleman
    Hrm... I was wrong, there is no SVN task...

    Im going to attempt to create a SVN task... possibly a CVS one as well... you interested in lending a hand?

    - Eric
    I would be, we certianly could do with it for projects we are working on.

    George
    Got Sig!

  7. #7
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You might want to look at Rephlux (using SimpleTest for unit tests as well).
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  8. #8
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i have to say... i am super impressed with PHING... and it works on my windows machine... heh

    Jason, maybe you'd be interested in developing a SimpleTest task for Phing?

    George: it appears there is a CVS Task already... just needs a SVN one. The file I am see'n for CVS is in phing/tasks/system/

    - Eric
    Eric Coleman
    We're consentratin' on fallin' apart
    We were contenders, now throwin' the fight
    I just wanna believe, I just wanna believe in us

  9. #9
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just for reference, if your using PHING and Subversion, It took me about an hour to figure out why it wasn't filtering out the .svn directories... I had to use:

    Code:
    <exclude name="**/.svn/**" />
    Here is my resulting build file

    Code:
    <?xml version="1.0"?>
    <!-- TODO: ADD BUILD NUMBER INCREMENTING -->
    <project name="Evolver CS" default="build" basedir=".">
        <property name="build.file.prefix" value="evolvercs" />
        <property name="build.dest" value="build" />
        
        <target name="prepare" depends="clean">
            <echo msg="- preparing for build ... " />
            <mkdir dir="${build.dest}"/>
    		
            <echo msg="- copying build files ... " />
            <copy todir="${build.dest}">
                <fileset dir=".">
                    <exclude name="**/.svn/**" />
                    <exclude name="admin/runtime/config.php" />
                    <exclude name="admin/storage/**" />
                    <exclude name=".htaccess" />
                    <exclude name=".project" />
                    
                    <include name="**/**" />				
                </fileset>
            </copy>
        </target>
    
        <!-- the process for a build goes: clean-build, clean, prepare, build, clean-build -->
        <target name="build" depends="prepare">        
            <echo msg="-----------------------------------" />
            <echo msg="- building archives ..." />
            <echo msg="-----------------------------------" />
            
            <tar destfile="${build.file.prefix}.tar.gz" basedir="${build.dest}" compression="gzip" />
            <zip destfile="${build.file.prefix}.zip" basedir="${build.dest}" />
        
            <echo msg=" " />
            <echo msg="- post build cleanup" />
            <echo msg=" " />
        
            <phingcall target="clean-build" />
        </target>
    
        <target name="clean-build">
            <echo msg="- cleaning up build dir ... " />
            <delete dir="${build.dest}" />
        </target>
    
        <target name="clean" depends="clean-build">
            <echo msg="- cleaning up packaged files ... " />
    
            <delete file="${build.file.prefix}.zip"/>
            <delete file="${build.file.prefix}.tar.gz"/>
        </target>
    </project>
    Eric Coleman
    We're consentratin' on fallin' apart
    We were contenders, now throwin' the fight
    I just wanna believe, I just wanna believe in us

  10. #10
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Eric.Coleman
    Jason, maybe you'd be interested in developing a SimpleTest task for Phing?
    I have never actually used Phing. My rollouts are pretty simple. I checkout the project from cvs into a qa directory. I run the unit test suite, and if it passes, I have a shell command which does and rsync to move the files into the production directory. I have not really needed anything more than this.

  11. #11
    SitePoint Addict chiefmonkey's Avatar
    Join Date
    Aug 2002
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sweatje
    You might want to look at Rephlux (using SimpleTest for unit tests as well).

    Oh I like the look of that. Will it run under OSX?

    Of course as it is GPL'd I could do a port.

    George
    Got Sig!

  12. #12
    SitePoint Addict chiefmonkey's Avatar
    Join Date
    Aug 2002
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Eric.Coleman
    i have to say... i am super impressed with PHING... and it works on my windows machine... heh

    Jason, maybe you'd be interested in developing a SimpleTest task for Phing?

    George: it appears there is a CVS Task already... just needs a SVN one. The file I am see'n for CVS is in phing/tasks/system/

    - Eric
    I would like to try SVN, however it doesn't seem to want to play nice with Eclipse.

    George
    Got Sig!

  13. #13
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What doesn't work nice with Eclipse? I've been using Subversion with Eclipse for a while.

    - Eric
    Eric Coleman
    We're consentratin' on fallin' apart
    We were contenders, now throwin' the fight
    I just wanna believe, I just wanna believe in us

  14. #14
    SitePoint Addict pachanga's Avatar
    Join Date
    Mar 2004
    Location
    Russia, Penza
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by chiefmonkey
    I wonder how many people use this tool.
    I'm going to try Phing for automated builds in the nearest future.

    I think it's better to have one comprehensive and unified build tool than a lot of small scattered around build scripts...is it? Any java gurus around? What are the drawbacks of Ant(if any)?

  15. #15
    SitePoint Guru dagfinn's Avatar
    Join Date
    Jan 2004
    Location
    Oslo, Norway
    Posts
    894
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My experience with Phing is good. It lacks a task for SimpleTest, though.
    Dagfinn Reiersøl
    PHP in Action / Blog / Twitter
    "Making the impossible possible, the possible easy,
    and the easy elegant"
    -- Moshe Feldenkrais

  16. #16
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried using Phing but im not fond of it, probably cause i dont have the time to read through the manual, it's kind of a difficult tool IMHO, and so is cvs, tried it but it does not seem to work on a windows machine very well, so i still dont use cvs which isn't that bad if your just by yourself and not in a team.
    Business as usual is off the menu folks, ...

  17. #17
    SitePoint Addict timvw's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    354
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    galo, have you tried something like http://www.tortoisecvs.org/? It gives you access to cvs via a context menu in your windows... instead of messing with the command prompt (I believe it has even a built-in cvsnt server, so you don't have to install/configure it yourself if you want to have your repositories @localhost)

    But if you are going to spend time learning it, i would advise http://tortoisesvn.tigris.org/ (and svn) instead.

  18. #18
    SitePoint Addict pachanga's Avatar
    Join Date
    Mar 2004
    Location
    Russia, Penza
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about rake?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •