Hi Khristian,
I've made a copy of the Proguard extension I use at work available at
https://gist.github.com/pepijnve/5386437
It's essentially a wrapper for the Proguard Ant task. I've added support
for the options that I actually needed. Might not be 100% complete but
all the essential parts are there.
I haven't experienced any issues related to the task calling exit.
Perhaps exit is not invoked when using Proguard via the Ant task rather
then via its own main method.
Regards,
Pepijn
On 12-04-13 14:27, Khristian Schönrock wrote:
Hi Alex,
thanks for your help! I got my proguard task going as I wanted after a few
modifications to your script: https://gist.github.com/derkosak/5371630
However, I seem to have stumbled upon the "task calls exit(), buildr exits
as well" issue. How can I work around this? I've read that forking the call
does the trick, but couldn't figure out how it is done.
TIA,
Khristian
On Sat, Apr 6, 2013 at 12:28 AM, Alex Boisvert <[email protected]>wrote:
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 <[email protected]
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