Hi Khristian,
I hacked something quickly together here:
https://gist.github.com/aboisvert/5323180
I didn't use the Ant task since I thought it was too much trouble compared
to using the Proguard 'main class' and passing argument directly to it.
Note that this is just a prototype that doesn't support many of the
proguard options .. basically the bare minimum to get you going.
Hope this helps,
alex
On Fri, Apr 5, 2013 at 7:47 AM, Khristian Schönrock <smirnegger@gmail.com>wrote:
> Hello everyone,
> I'm trying to add a proguard task to my project. So far I've not found any
> sort of Proguard-addon for Buildr, so I tried using the Ant task.
>
> I tried to mimic the OpenJPA task, and ended up with the following code:
>
> REQUIRES = [ ...bunch of libraries... ]
>
> ant('proguard') do |ant|
> ant.taskdef :name=>'proguard', :classname=>'proguard.ant.ProGuardTask',
> :classpath=>REQUIRES.join(File::PATH_SEPARATOR)
> ant.proguard :configuration=>_('../build/configuration.pro'), # config
> file
> :injars=>project('my_project') # snag here
> end
>
> And so I am left with a bunch of intertwining questions:
>
> - Since I'm defining the task in a project that should be processed by
> proguard, I'm not sure how I should add the project to the classpath.
> - Moving the proguard task to some other project ("distribution", for
> example) solves the problem, but proguard complains that I need to define
> the "-injars" parameter, which I tried unsuccessfully with the :injars code
> above.
> - Since "-injars" is part of the configuration, in the Proguard Ant task it
> can be defined either in the configuration file ("configuration.pro"), or
> in the body of the <configuration> tag. Supposing the :configuration key
> maps to this tag, can I add this "tag content"?
>
> How do I best configure this?
>
> Thanks in advance,
> Khristian
>
|