You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Magnus Melander <ma...@huggtand.com> on 2013/01/10 13:47:02 UTC

Extending the package task

Hi!
I have successfully extended the build task as suggested in the documentation:

build do
   puts("Do extra stuff")
end

However, when I try to do the same with the package task, it does not work:

package do
   puts("Custom packaging")  # never happens
end

I can't see any reason why it should not work, but maybe my understanding of buildr is incorrect.
I'm running version 1.47 of buildr.

Regards,
Magnus


Re: Extending the package task

Posted by Magnus Melander <ma...@huggtand.com>.
That works!
Thank you Dieter.
However, it s a bit counter-intuitive for a beginner like me that package behaves differently from
build and clean.
Regards,
Magnus

El 10 jan 2013, a las 16.46, Dieter Vrancken escribió:

> Hi Magnus,
> 
> I think the issue is that 'build' is a function that returns the build task, whereas 'package' is a function that defines a package task based on its arguments. As you don't give arguments, it does not return a task.
> 
> Try the following. This references the package task directly.
> 
> task :package do
>  puts("Custom packaging")
> end
> 
> HTH,
> Dieter
> 
> On Thu, 10 Jan 2013 13:47:02 +0100
> Magnus Melander <ma...@huggtand.com> wrote:
> 
>> Hi!
>> I have successfully extended the build task as suggested in the documentation:
>> 
>> build do
>>   puts("Do extra stuff")
>> end
>> 
>> However, when I try to do the same with the package task, it does not work:
>> 
>> package do
>>   puts("Custom packaging")  # never happens
>> end
>> 
>> I can't see any reason why it should not work, but maybe my understanding of buildr is incorrect.
>> I'm running version 1.47 of buildr.
>> 
>> Regards,
>> Magnus
> 
> -- 
> Dieter Vrancken - Senior software engineer
> T +32 16 23 95 91 | F +32 16 29 34 22
> dieter.vrancken@luciad.com
> 
> *LUCIAD* - high performance visualization
> Wetenschapspark Arenberg | Gaston Geenslaan 11
> 3001 Leuven | Belgium | http://www.luciad.com/
> 
> Click to check for upcoming events: http://www.luciad.com/events.html


Re: Extending the package task

Posted by Dieter Vrancken <di...@luciad.com>.
Hi Magnus,

I think the issue is that 'build' is a function that returns the build task, whereas 'package' is a function that defines a package task based on its arguments. As you don't give arguments, it does not return a task.

Try the following. This references the package task directly.

task :package do
  puts("Custom packaging")
end

HTH,
Dieter

On Thu, 10 Jan 2013 13:47:02 +0100
Magnus Melander <ma...@huggtand.com> wrote:

> Hi!
> I have successfully extended the build task as suggested in the documentation:
> 
> build do
>    puts("Do extra stuff")
> end
> 
> However, when I try to do the same with the package task, it does not work:
> 
> package do
>    puts("Custom packaging")  # never happens
> end
> 
> I can't see any reason why it should not work, but maybe my understanding of buildr is incorrect.
> I'm running version 1.47 of buildr.
> 
> Regards,
> Magnus

-- 
Dieter Vrancken - Senior software engineer
T +32 16 23 95 91 | F +32 16 29 34 22
dieter.vrancken@luciad.com

*LUCIAD* - high performance visualization
Wetenschapspark Arenberg | Gaston Geenslaan 11
3001 Leuven | Belgium | http://www.luciad.com/

Click to check for upcoming events: http://www.luciad.com/events.html