You are viewing a plain text version of this content. The canonical link for it is here.
Posted to zeta-dev@incubator.apache.org by Jerome Renard <je...@apache.org> on 2011/04/12 15:02:56 UTC

[zeta-dev] PHP based build system : Phing VS Pake

Hi There,

The debate we got earlier [1] on this list after I posted a very early
version of the
Ant based build script showed that we were possibly going in the wrong
direction.

After chatting on IRC we realized that (some statements might look
obvious to you):

1. the actual Makefile is hard to read
2. the actual Makefile is not cross-platform at all
3. the actual Makefile is a PITA to maintain
4. the Ant build file is not as cross-platform as I hoped it was (my bad)
5. the Ant build file will most likely be a PITA to maintain as well

So we thought it could be a good idea to have a look at PHP based build systems.

Our requirements are:
- the build system must be cross platform as much as possible
- the build system must be simple to use and simple (our part) to maintain.
- the build system must be easy to use

I found Phing and Pake and here is what I think about them (please not that
I had a look at those tools during lunch as it was the best I could
do. If I overlooked
anything feel free to tell me):

Phing:
- looks big (bigger than the default Ant)
- provides a lot of features
- is XML based
- is supposed to be Ant for PHP but does not seem to be 100%
compatible with Ant files
- is very well documented

Pake:
- is smaller than Phing (not hard)
- is not as clearly documented as Phing, some parts of the
documentation are still missing
- is not XML based (Derick will appreciate that :P)
- claims to be Make for PHP and it seems it is

My preference would go to Pake as it looks much simpler for our needs
and we could end up
with a very-easy-to-maitain build script. What I appreciate with Pake
is that you can get total
control and freedom on what you do. It already provides all the
features [2] we need in order to
build the docs and the website, and if one of the library is not what
we need we could use AZC
easily.

I will try to give Pake a try as soon as possible. But if one of you
already has experience with
Phing or Pake I would be happy to get your feedback about these tools :)

<this is the auto flagellation part>
I plead guilty for imposing Ant, the reason is that I have been using
it for a couple
of years already and I thought it would solve problems we got in the
Makefile. But I
was wrong.
<this was the auto flagellation part>

1. http://mail-archives.apache.org/mod_mbox/incubator-zeta-dev/201104.mbox/%3CBANLkTikGTSkKg1Yc+ieRxt66a7Ka_853nA@mail.gmail.com%3E
2. https://github.com/indeyets/pake/tree/master/lib/pake

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Christian Grobmeier <gr...@gmail.com>.
>>> - is not XML based (Derick will appreciate that :P)
>>
>> probably the only one ;-)
>
> Not sure if this is a joke, but xml simply has to die (TM).

No joke. And XML has some good benefits. I don't want it to die.
Probably I am oldschool.

> Not a "good doc" by any stretch, but to hit the ground running:

> pake_desc( 'docs for the next registered task' );
> pake_task( 'init-me' ); // registers task "init-me"
> pake_desc( 'Builds the extension' );
> pake_task( 'build-me', 'init-me' );

> function run_init_me($task, $args=array(), $opts=array()){ echo 'hello'; }

Thanks, so far I understood - similar code can be found in the docs.
Still I cannot see why this is better than XML. But I believe its a
matter of view and taste. Maybe - if Zeta uses Pake - I will learn
more and use it myself.

Cheers
Christian

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Gaetano Giunta <gi...@gmail.com>.
Christian Grobmeier wrote:
>> - is not XML based (Derick will appreciate that :P)
> probably the only one ;-)
Not sure if this is a joke, but xml simply has to die (TM).
>> I will try to give Pake a try as soon as possible. But if one of you
>> already has experience with
>> Phing or Pake I would be happy to get your feedback about these tools :)
> I have no experience and no preference with Pake and Phing, but I
> could understand Phing very quickly (no surprise, as a ant user) and
> had some trouble to get into pake. I am still unsure on some points
> and could not use it straight away. You'll probably need to make a
> good documentation on Pake otherwise I can imagine that users who want
> to join the project might have some trouble.
Not a "good doc" by any stretch, but to hit the ground running:

<?php

pake_desc( 'docs for the next registered task' );
pake_task( 'init-me' ); // registers task "init-me"

// another task
pake_desc( 'Builds the extension' );
// registers task build-me, depending on init-me.
// dependencies are not managed as make would do (ie. looking at file timestamps). init-me is always run 1st when build-me is executed
pake_task( 'build-me', 'init-me' );

// function invoked when executing task 'init-me'
//   $args and $opts come from the parameters passed via cli, similar to what a -Dthis.property=that would do in ant.
//   The complete syntax is:
//   php pake.php [generic-pake-options] task [specific-options] [arguments]
//   so that eg running php pake.php init-me --skip-this --this=that andmore
//   would results in $opts = array( 'skip-this' => true, 'this' => 'that' ) and $opts = array( 'andmore' )
function run_init_me($task, $args=array(), $opts=array()){ echo 'hello'; }

function run_build_me($task, $args=array(), $opts=array()){ echo 'world'; }

?>
> I don't see a benefit compared to the actual makefile in readability.
> If you say, Pake is easier - its just in the eye of the observer.
>
>> <this is the auto flagellation part>
>> I plead guilty for imposing Ant, the reason is that I have been using
>> it for a couple  of years already and I thought it would solve problems we got in the
>> Makefile. But I was wrong.
>> <this was the auto flagellation part>
> Naaa, Ant is not such bad! Trying it out was a logical consequence. It
> just didn't fit
>


Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Christian Grobmeier <gr...@gmail.com>.
> - is not XML based (Derick will appreciate that :P)

probably the only one ;-)

> I will try to give Pake a try as soon as possible. But if one of you
> already has experience with
> Phing or Pake I would be happy to get your feedback about these tools :)

I have no experience and no preference with Pake and Phing, but I
could understand Phing very quickly (no surprise, as a ant user) and
had some trouble to get into pake. I am still unsure on some points
and could not use it straight away. You'll probably need to make a
good documentation on Pake otherwise I can imagine that users who want
to join the project might have some trouble.

I don't see a benefit compared to the actual makefile in readability.
If you say, Pake is easier - its just in the eye of the observer.

> <this is the auto flagellation part>
> I plead guilty for imposing Ant, the reason is that I have been using
> it for a couple  of years already and I thought it would solve problems we got in the
> Makefile. But I was wrong.
> <this was the auto flagellation part>

Naaa, Ant is not such bad! Trying it out was a logical consequence. It
just didn't fit

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Henri Bergius <be...@apache.org>.
Hi,

On Tue, Apr 12, 2011 at 6:49 PM, Gaetano Giunta
<gi...@gmail.com> wrote:
> As I proposed pake in the 1szt place, no need to assert any more that I like
> it "enough".

+1 from here as well. We use Pake anyway for Midgard packaging and
installation. So at least Zeta Components have already been installed
on a bunch of machines via Pake ;-)

/Bergie

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Henri Bergius <be...@apache.org>.
On Tue, Apr 12, 2011 at 11:31 PM, Christian Grobmeier
<gr...@gmail.com> wrote:
> And while we are at it, consider to join the incubator.apache.org with
> pake. I am pretty sure there are some supporters around.

I wouldn't mind seeing Pake and some other stuff from Alexey - like
the AppServer in PHP project - under the Apache / Zeta Components
roof. At least AiP is PHP 5.3-only, though. That might be an issue?

BTW, here is a bit more complex Pake example, the "Midgard MVC
installer" we use:
https://github.com/midgardproject/midgardmvc_installer

/Henri

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Jerome Renard <je...@apache.org>.
Hi Alexey,

thanks for your feedback.

On Wed, Apr 13, 2011 at 10:40 PM, Alexey Zakhlestin <in...@gmail.com> wrote:
>
[...]
>>
>> Any feedback welcome :)
>
> line 30:
> I'd use pake_echo_comment() instead. same for other similar lines
>

Fixed.

> lines 94-117:
> 1) I'd use pake_sh($command, true)

Fixed.

> 2) don't forget to use escapeshellarg() where appropriate
>

Yep, I will take care of that later.

> lines 134-137:
> pake_mkdirs($targetDir, 0755); // no need for "if". pake take cares of that
>

Fixed

> lines 139-149:
> pake_copy($tarball, $targetDir.'/'.$options['build.name'].'.tar.bz2');
>

Fixed

> lines 142-143:
> pake_remove_dir($options['build.dir'] . '/phpdoc/');
>

Fixed

> lines 243-245:
> pake_rename( $HTMLFile,  dirname( $HTMLFile ) . '/' . $newHTMLFile );
>

Fixed

>
> pake's versions of basic filesystem-functions are good because:
> 1) they do nothing, if nothing has to be done (won't try to delete non-existant file, won't copy file if source is older than target)
> 2) they report what they do to console
>
> as the result, you have to type less code

Yep that is what I noticed, and that gave me a couple of ideas to
enhance ezcBaseFile

Thanks :)

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Alexey Zakhlestin <in...@gmail.com>.
On 13.04.2011, at 21:28, Jerome Renard wrote:

> Hello,
> 
> I started to test Pake in the context of AZC.
> 
> You can get the Pakefile if you svn up website/
> 
> You may also browse the file here:
> - https://fisheye6.atlassian.com/browse/zetacomponents/website/Pakefile?r=1091818
> 
> As you will see it is quite simple et much more readable that its Ant
> equivalent.
> 
> Any feedback welcome :)

line 30:
I'd use pake_echo_comment() instead. same for other similar lines

lines 94-117:
1) I'd use pake_sh($command, true)
2) don't forget to use escapeshellarg() where appropriate

lines 134-137:
pake_mkdirs($targetDir, 0755); // no need for "if". pake take cares of that

lines 139-149:
pake_copy($tarball, $targetDir.'/'.$options['build.name'].'.tar.bz2');

lines 142-143:
pake_remove_dir($options['build.dir'] . '/phpdoc/');

lines 243-245:
pake_rename( $HTMLFile,  dirname( $HTMLFile ) . '/' . $newHTMLFile );



pake's versions of basic filesystem-functions are good because:
1) they do nothing, if nothing has to be done (won't try to delete non-existant file, won't copy file if source is older than target)
2) they report what they do to console

as the result, you have to type less code

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Gaetano Giunta <gi...@gmail.com>.
Tobias Schlitt wrote:
> On 04/14/2011 11:36 AM, Jerome Renard wrote:
>
>>> I still prefer cli options than env vars for 90% of the time though, as it's
>>> easier to understand what is happening when the options are explicit.
>>>
>>> But, as far as I can see in your code, what you can do is that you can swap
>>> out one config file with another.
>>>
>>> What I was asking to is to separate cofig options: one set that is
>>> project-specific (stored in the config file), and one set that is specific
>>> to the build environment (passed via cli options or env vars).
>> I'll see how to pass arguments from the command line in Pake then.
> I'd suggest to use some kind of "properties" file for configuration.
Yaml is the pake-equivalent of properties. Is it fine with you to have yaml files for config?
> At least that is what we do when using ant. Our scripts ship with a
> build.properties file and the script itself looks for
> build.local.properties. If this doesn't exist, it bails out with a
> message that the user should copy and adjust the original file.
>
> This way is pretty convenient and most obvious I'd say.

Kind of ok, but why not instead:
- take properties from build.properties file (which is complete)
- if build.local.properties is there, use it to override existing properties (if it's not where, just continue)

This way there is no need to copy files around, and the original properties file can be kept in sync easily with the upstream svn/git version.


Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Tobias Schlitt <to...@schlitt.info>.
On 04/14/2011 11:36 AM, Jerome Renard wrote:

>> I still prefer cli options than env vars for 90% of the time though, as it's
>> easier to understand what is happening when the options are explicit.
>>
>> But, as far as I can see in your code, what you can do is that you can swap
>> out one config file with another.
>>
>> What I was asking to is to separate cofig options: one set that is
>> project-specific (stored in the config file), and one set that is specific
>> to the build environment (passed via cli options or env vars).

> I'll see how to pass arguments from the command line in Pake then.

I'd suggest to use some kind of "properties" file for configuration.

At least that is what we do when using ant. Our scripts ship with a
build.properties file and the script itself looks for
build.local.properties. If this doesn't exist, it bails out with a
message that the user should copy and adjust the original file.

This way is pretty convenient and most obvious I'd say.

Cheers,
Toby

-- 
Tobias Schlitt        http://schlitt.info        GPG Key: 0xC462BC14
Want to hire me? Need quality assurance?            http://qafoo.com
eZ Components are Zeta Components now!          http://bit.ly/9S7zbn

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Jerome Renard <je...@apache.org>.
Gaetano,

On Thu, Apr 14, 2011 at 11:23 AM, Gaetano Giunta
<gi...@gmail.com> wrote:
> Jerome Renard <je...@apache.org> wrote on 14/04/2011 11:11:
[...]
>>
>> I believe you can define environment variables on Windows:
>> -
>> https://fisheye6.atlassian.com/browse/zetacomponents/website/Pakefile?hb=true#to150
>
> Sure enough - albeit it's not as common to do it as it's on unix.

Ok.

> I still prefer cli options than env vars for 90% of the time though, as it's
> easier to understand what is happening when the options are explicit.
>
> But, as far as I can see in your code, what you can do is that you can swap
> out one config file with another.
>
> What I was asking to is to separate cofig options: one set that is
> project-specific (stored in the config file), and one set that is specific
> to the build environment (passed via cli options or env vars).
>

I'll see how to pass arguments from the command line in Pake then.

-- 
Jérôme Renard
http://39web.fr | http://jrenard.info | http://twitter.com/jeromerenard

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Gaetano Giunta <gi...@gmail.com>.
Jerome Renard <je...@apache.org> wrote on 14/04/2011 11:11:

> Gaetano,
>
> On Thu, Apr 14, 2011 at 9:40 AM, Gaetano Giunta
> <gi...@gmail.com>  wrote:
>> Jerome Renard wrote:
> [...]
>>>
>>> As you will see it is quite simple et much more readable that its Ant
>>> equivalent.
>>
>> Glad we share the same impressions ;-)
>>>
>>> Any feedback welcome :)
>>>
>> One thing: I see you have set the path to cli tools in config file.
>> While this allows some flexibility, it means the config file will need to be
>> different if running the build on my windows pc and on your mac.
>> I propose instead to make the config file oblivious to the environment, and
>> use options passed on the cli for environment-related parameters, eg
>>
>> php pake.php thistask --php=/usr/local/bin/php --doxygen="c:/program
>> files/doxygen/bin/doxygen.exe"
>>
>
> I believe you can define environment variables on Windows:
> - https://fisheye6.atlassian.com/browse/zetacomponents/website/Pakefile?hb=true#to150

Sure enough - albeit it's not as common to do it as it's on unix.
I still prefer cli options than env vars for 90% of the time though, as it's easier to understand what is happening when the options are explicit.

But, as far as I can see in your code, what you can do is that you can swap out one config file with another.

What I was asking to is to separate cofig options: one set that is project-specific (stored in the config file), and one set that is specific to the build 
environment (passed via cli options or env vars).

Maybe this is not necessary in this case, as the pakefile is really only targeted at one project, but it is a useful separation when the pakefile you produce 
can be used both for different projects and in different environments.

>> Also remember to use escapeshellarg() around your command line executables
>> and paths before invoking them. There might be spaces in them...
>>
>
> I know. As I said earlier on this thread I will take care of that (and
> other tiny details) later.
>


Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Jerome Renard <je...@apache.org>.
Gaetano,

On Thu, Apr 14, 2011 at 9:40 AM, Gaetano Giunta
<gi...@gmail.com> wrote:
> Jerome Renard wrote:
[...]
>>
>> As you will see it is quite simple et much more readable that its Ant
>> equivalent.
>
> Glad we share the same impressions ;-)
>>
>> Any feedback welcome :)
>>
> One thing: I see you have set the path to cli tools in config file.
> While this allows some flexibility, it means the config file will need to be
> different if running the build on my windows pc and on your mac.
> I propose instead to make the config file oblivious to the environment, and
> use options passed on the cli for environment-related parameters, eg
>
> php pake.php thistask --php=/usr/local/bin/php --doxygen="c:/program
> files/doxygen/bin/doxygen.exe"
>

I believe you can define environment variables on Windows:
- https://fisheye6.atlassian.com/browse/zetacomponents/website/Pakefile?hb=true#to150

> Also remember to use escapeshellarg() around your command line executables
> and paths before invoking them. There might be spaces in them...
>

I know. As I said earlier on this thread I will take care of that (and
other tiny details) later.

-- 
Jérôme Renard
http://39web.fr | http://jrenard.info | http://twitter.com/jeromerenard

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Henri Bergius <be...@apache.org>.
On Thu, Apr 14, 2011 at 10:40 AM, Gaetano Giunta
<gi...@gmail.com> wrote:
> Jerome Renard wrote:
>> As you will see it is quite simple et much more readable that its Ant
>> equivalent.
> Glad we share the same impressions ;-)

One could argue that it is easier to program in PHP than in XML ;-)

/Henri

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Gaetano Giunta <gi...@gmail.com>.
Jerome Renard wrote:
> Hello,
>
> I started to test Pake in the context of AZC.
>
> You can get the Pakefile if you svn up website/
>
> You may also browse the file here:
> - https://fisheye6.atlassian.com/browse/zetacomponents/website/Pakefile?r=1091818
>
> As you will see it is quite simple et much more readable that its Ant
> equivalent.
Glad we share the same impressions ;-)
> Any feedback welcome :)
>
One thing: I see you have set the path to cli tools in config file.
While this allows some flexibility, it means the config file will need to be different if running the build on my windows pc and on your mac.
I propose instead to make the config file oblivious to the environment, and use options passed on the cli for environment-related parameters, eg

php pake.php thistask --php=/usr/local/bin/php --doxygen="c:/program files/doxygen/bin/doxygen.exe"

Also remember to use escapeshellarg() around your command line executables and paths before invoking them. There might be spaces in them...

Bye
Gaetano


Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Jerome Renard <je...@gmail.com>.
Hello,

I started to test Pake in the context of AZC.

You can get the Pakefile if you svn up website/

You may also browse the file here:
- https://fisheye6.atlassian.com/browse/zetacomponents/website/Pakefile?r=1091818

As you will see it is quite simple et much more readable that its Ant
equivalent.

Any feedback welcome :)

-- 
Jérôme Renard
http://39web.fr | http://jrenard.info | http://twitter.com/jeromerenard

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Alexey Zakhlestin <in...@gmail.com>.
On 13.04.2011, at 0:31, Christian Grobmeier wrote:

>> I can also setup google-group for pake.
> 
> Setting up a google group will also give you the chance to build up
> community around pake. Then you'll probably find yourself overwhelmed
> with documentation patches.

Here it is:

https://groups.google.com/group/pake


Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Christian Grobmeier <gr...@gmail.com>.
> I'm maintaining/developing pake for last couple of years.
> Documentation could be better — I'll try to fix that.
> Anyway, if you have any questions, I can answer those.
>
> I can also setup google-group for pake.

Setting up a google group will also give you the chance to build up
community around pake. Then you'll probably find yourself overwhelmed
with documentation patches.

And while we are at it, consider to join the incubator.apache.org with
pake. I am pretty sure there are some supporters around.

> A bit of history: pake was, originally, developed for symfony 1.0.
> Later, Fabien tightly connected pake's code to symfony's internals and
> stopped to develop it as a separate project.
> Then, at some point, I came and started to fix it, update it and develop it :)

Thanks for the insight. Very interesting. I guess this explains the
unnamed license you are using.
Just found and follow your blog:
http://blog.milkfarmsoft.com/2009/08/pake-php5-project-build-system/

Cheers

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Alexey Zakhlestin <in...@gmail.com>.
On Tue, Apr 12, 2011 at 7:49 PM, Gaetano Giunta
<gi...@gmail.com> wrote:

> As I proposed pake in the 1szt place, no need to assert any more that I like
> it "enough".
> Missing docs are a pain,k as well as no forums / mailing list / bug tracker.
> But the owner of the github project seems to be a nice guy (ie. responsive)
>
> Another similar tool I found a while ago was "phake", but it looks to be
> even greener than pake. Maybe too much.
>

Hi.

I, actually, read this mailing list.

I'm maintaining/developing pake for last couple of years.
Documentation could be better — I'll try to fix that.
Anyway, if you have any questions, I can answer those.

I can also setup google-group for pake.

A bit of history: pake was, originally, developed for symfony 1.0.
Later, Fabien tightly connected pake's code to symfony's internals and
stopped to develop it as a separate project.
Then, at some point, I came and started to fix it, update it and develop it :)

-- 
Alexey Zakhlestin, http://twitter.com/jimi_dini
http://www.milkfarmsoft.com/

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Gaetano Giunta <gi...@gmail.com>.
Jerome Renard wrote:
> Hi There,
>
> The debate we got earlier [1] on this list after I posted a very early
> version of the
> Ant based build script showed that we were possibly going in the wrong
> direction.
>
> After chatting on IRC we realized that (some statements might look
> obvious to you):
>
> 1. the actual Makefile is hard to read
> 2. the actual Makefile is not cross-platform at all
> 3. the actual Makefile is a PITA to maintain
> 4. the Ant build file is not as cross-platform as I hoped it was (my bad)
> 5. the Ant build file will most likely be a PITA to maintain as well
>
> So we thought it could be a good idea to have a look at PHP based build systems.
>
> Our requirements are:
> - the build system must be cross platform as much as possible
> - the build system must be simple to use and simple (our part) to maintain.
> - the build system must be easy to use
>
> I found Phing and Pake and here is what I think about them (please not that
> I had a look at those tools during lunch as it was the best I could
> do. If I overlooked
> anything feel free to tell me):
>
> Phing:
> - looks big (bigger than the default Ant)
> - provides a lot of features
> - is XML based
> - is supposed to be Ant for PHP but does not seem to be 100%
> compatible with Ant files
> - is very well documented
>
> Pake:
> - is smaller than Phing (not hard)
> - is not as clearly documented as Phing, some parts of the
> documentation are still missing
> - is not XML based (Derick will appreciate that :P)
> - claims to be Make for PHP and it seems it is
>
> My preference would go to Pake as it looks much simpler for our needs
> and we could end up
> with a very-easy-to-maitain build script. What I appreciate with Pake
> is that you can get total
> control and freedom on what you do. It already provides all the
> features [2] we need in order to
> build the docs and the website, and if one of the library is not what
> we need we could use AZC
> easily.
>
> I will try to give Pake a try as soon as possible. But if one of you
> already has experience with
> Phing or Pake I would be happy to get your feedback about these tools :)
>
As I proposed pake in the 1szt place, no need to assert any more that I like it "enough".
Missing docs are a pain,k as well as no forums / mailing list / bug tracker.
But the owner of the github project seems to be a nice guy (ie. responsive)

Another similar tool I found a while ago was "phake", but it looks to be even greener than pake. Maybe too much.

Phing: all I can say is that I never used it but all the people I do know that did now have a very bad opinion of it...

bye
Gaetano

> <this is the auto flagellation part>
> I plead guilty for imposing Ant, the reason is that I have been using
> it for a couple
> of years already and I thought it would solve problems we got in the
> Makefile. But I
> was wrong.
> <this was the auto flagellation part>
>
> 1. http://mail-archives.apache.org/mod_mbox/incubator-zeta-dev/201104.mbox/%3CBANLkTikGTSkKg1Yc+ieRxt66a7Ka_853nA@mail.gmail.com%3E
> 2. https://github.com/indeyets/pake/tree/master/lib/pake
>


Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Jerome Renard <je...@gmail.com>.
Hello Sebastian,

On Wed, Apr 20, 2011 at 10:39 AM, Sebastian Bergmann
<se...@apache.org> wrote:
> Am 20.04.2011 09:30, schrieb Jerome Renard:
>> I would say the main problem with Ant is there is no loops and
>> conditionals
>
>  I have never needed programming structures like that in my build
>  automation scripts. But I think I understand where the problem is: you
>  are trying to use a build automation tool to implement an application:
>  a website generator. This is wrong. What you want to do may be possible
>  with Pake (or any build automation tool that supports build scripts with
>  a cyclomatic complexity > 1) but that does not make it right ;-)
>

That does not make it wrong either. The point is not to be right or wrong.
The point is to get a "build" system that can be run by anyone for
AZC's doc and website.
That means we need something very flexible, cross-platform (well as
much as possible)
and maintainable.

>  Have a look at how the documentation for PHPUnit's manual is built [1].
>  There are a couple of PHP scripts that deal with syntax highlighting of
>  examples and form a website from the HTML that comes out of DocBook/XSL.
>  But the automation of these scripts happens in Ant. As it should be.
>

Automation is trivial I am not worried by that.

By reading your build file I noticed that you actually moved the
complexity out of Ant and used
a couple of PHP scripts that solve specific needs. This is an option I
actually did not had in mind
and which definitely deserves to be tested. Maybe this is the correct
balance between flexibility
and using a standard build system like Ant. I need to finish the
Pakefile first and I'll have a look at
a mix between PHP and Ant.

Have a nice evening :)

-- 
Jérôme Renard
http://39web.fr | http://jrenard.info | http://twitter.com/jeromerenard

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Gaetano Giunta <gi...@gmail.com>.
Sebastian Bergmann wrote:
> Am 20.04.2011 09:30, schrieb Jerome Renard:
>> I would say the main problem with Ant is there is no loops and
>> conditionals
>   I have never needed programming structures like that in my build
>   automation scripts. But I think I understand where the problem is: you
>   are trying to use a build automation tool to implement an application:
>   a website generator. This is wrong. What you want to do may be possible
>   with Pake (or any build automation tool that supports build scripts with
>   a cyclomatic complexity>  1) but that does not make it right ;-)
I surely feel like a troll in asking this, but where exactly is stated that build automation tools should not use loops and conditionals?

The venerable 'make' surely did allow them - and I see fail to see any added value in removing the possibility of using them.
To me, the main downside to make is the fact that tasks have to be written using shell code, which is neither really portable nor fun.
Ant is surely more portable, but even less fun.

And every "build script" becomes an "application-generator application" in the end (just as every application grows to the point where it can send mail ;-) )

>   Have a look at how the documentation for PHPUnit's manual is built [1].
>   There are a couple of PHP scripts that deal with syntax highlighting of
>   examples and form a website from the HTML that comes out of DocBook/XSL.
>   But the automation of these scripts happens in Ant. As it should be.
>
>   --
>   [1] https://github.com/sebastianbergmann/phpunit-documentation
>
Basically the ant file you use is a container for invoking external commands.
Since it contains no logic or complexity at all, it makes a good point in case for using ant.

But it could have been written in pake using exactly the same amount of lines / commands.
And pake allows to do the more complex stuff, that you put in external php scripts, either in-process or out of process.

The advantage would thus be that you need
. no editing of xml files
. a single runtime environment (no java)
. knowledge of a single language (php) for editing the build config
. no separate build tool + application-generating application

Ciao
Gaetano

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Sebastian Bergmann <se...@apache.org>.
Am 20.04.2011 09:30, schrieb Jerome Renard:
> I would say the main problem with Ant is there is no loops and 
> conditionals

 I have never needed programming structures like that in my build
 automation scripts. But I think I understand where the problem is: you
 are trying to use a build automation tool to implement an application:
 a website generator. This is wrong. What you want to do may be possible
 with Pake (or any build automation tool that supports build scripts with
 a cyclomatic complexity > 1) but that does not make it right ;-)

 Have a look at how the documentation for PHPUnit's manual is built [1].
 There are a couple of PHP scripts that deal with syntax highlighting of
 examples and form a website from the HTML that comes out of DocBook/XSL.
 But the automation of these scripts happens in Ant. As it should be.

 --
 [1] https://github.com/sebastianbergmann/phpunit-documentation

-- 
Sebastian Bergmann                    Co-Founder and Principal Consultant
http://sebastian-bergmann.de/                           http://thePHP.cc/

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Jerome Renard <je...@gmail.com>.
Hi Sebastian,

On Wed, Apr 20, 2011 at 8:52 AM, Sebastian Bergmann
<se...@apache.org> wrote:
> Am 12.04.2011 17:02, schrieb Jerome Renard:
>> 4. the Ant build file is not as cross-platform as I hoped it was (my bad)
>> 5. the Ant build file will most likely be a PITA to maintain as well
>
>  Can you elaborate on this? Sorry that I am late to the party, but I do
>  not have the time to keep up with this mailinglist and only now saw this
>  thread today.
>

No worries.

>  I am asking because in my experience Phing, Pake, and friends turned out
>  to be half-baked (pun intended) when compared to Ant.

Well, it really depends on what you want. I would say the main problem with Ant
is there is no loops and conditionals (except <available> but this is
not what I call a
conditional). If you want those loops and conditionnals, you have to
install ant-contrib [1]
but if you want to avoid your users to avoid installing ant-contrib by
themselves (and thus
fighting with CLASSPATH issues and other when you are not used to use
Java) you have
to use Ivy [2] which adds a second level of complexity, but still
acceptable I agree.

The main problem with Ant is that it is hard to program how a build
should be done by using
XML. You can do a lot of operations but it is common to get a 1000+
lines build file, and reading
that long XML files is not really easy (I know there is <include>). I
would say that for trivial tasks,
using Ant would really be useful, but when you want to do more complex
things, like dealing with
external librairies and so on, then you have to be prepared to spend a
lot of time in finding the
library you want and make it installable through Ivy etc, etc.
When you are not used to that this is really time consuming.

Another problem with Ant is that there is no native libraries to deal
with strings, there are external
librairies to workaround that problem, for example, here is what you
can do in order to capitalize
a string in Ant :

#1 using JavaScript in your ant file [3], until you realize that Ant
will beautifully crash when running any <script> task [4]
#2 using Java's regular expressions [5] until you realize that
patterns like \\U$& just do not work in your Ant build script
#3 using XML + XSL [6], but honnetly, why in the world would you have
to install all that stuff in order to simply uppercase a word ?

At some point you always realize that Ant is not as flexible as you
thought it was, you can always workaround
but when you spend more time working around and less time writing the
real build operations I would say Ant is
not the good choice for your current problematic, and for AZC that was
clearly not a good choice.

Note :
I have nothing against Ant, I used it a lot in the past and will
probably continue to use it in the future. But when I
need a lot of flexibility I think I would go for a more specific build
system like Pake for PHP, or Rake for Ruby.

1. http://ant-contrib.sourceforge.net/
2. http://ant.apache.org/ivy/
3. http://marc.info/?l=ant-user&m=104486168926737&w=2
4. http://ant.apache.org/manual/Tasks/script.html
5. http://www.javaregex.com/tutorial5.html
6. https://blog.coremedia.com/cm/post/1505148/2008/05/15/Apache_Ant_Task_to_Upper_and_LowerCase

-- 
Jérôme Renard
http://39web.fr | http://jrenard.info | http://twitter.com/jeromerenard

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Sebastian Bergmann <se...@apache.org>.
Am 12.04.2011 17:02, schrieb Jerome Renard:
> 4. the Ant build file is not as cross-platform as I hoped it was (my bad)
> 5. the Ant build file will most likely be a PITA to maintain as well

 Can you elaborate on this? Sorry that I am late to the party, but I do
 not have the time to keep up with this mailinglist and only now saw this
 thread today.

 I am asking because in my experience Phing, Pake, and friends turned out
 to be half-baked (pun intended) when compared to Ant.

-- 
Sebastian Bergmann                    Co-Founder and Principal Consultant
http://sebastian-bergmann.de/                           http://thePHP.cc/

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Jerome Renard <je...@gmail.com>.
Hi all,

I am more and more convinced that Pake is the tool we need.

In the build system there are a couple of tiny details that are easily
manageable
with Pake and we would not get the same flexibility with Phing or
something else.

I propose we keep Pake so I can finish the conversion from the actual
Makefile to a new Pakefile.

What do you think ?

-- 
Jérôme Renard
http://39web.fr | http://jrenard.info | http://twitter.com/jeromerenard

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Patrick ALLAERT <pa...@gmail.com>.
2011/4/18 Patrick ALLAERT <pa...@gmail.com>:
> 2011/4/12 Jerome Renard <je...@apache.org>:
>> <this is the auto flagellation part>
>> I plead guilty for imposing Ant, the reason is that I have been using
>> it for a couple
>> of years already and I thought it would solve problems we got in the
>> Makefile. But I
>> was wrong.
>> <this was the auto flagellation part>
>
> Oh oui oh oui, je veux voir ça plus souvent :D
>
> Patrick ;)

My bad. This is what happen when you "Reply to all" when you just want
to reply to the author.
The best I can do is, at least, to translate my above perversity:

"Oh yes, I'd like to see that more often :D"

ps: sorry for the annoyance.

-- 
Patrick

Re: [zeta-dev] PHP based build system : Phing VS Pake

Posted by Patrick ALLAERT <pa...@gmail.com>.
2011/4/12 Jerome Renard <je...@apache.org>:
> <this is the auto flagellation part>
> I plead guilty for imposing Ant, the reason is that I have been using
> it for a couple
> of years already and I thought it would solve problems we got in the
> Makefile. But I
> was wrong.
> <this was the auto flagellation part>

Oh oui oh oui, je veux voir ça plus souvent :D

Patrick ;)