buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Khristian Schönrock <smirneg...@gmail.com>
Subject Re: Proguard and Ant Task
Date Thu, 25 Apr 2013 09:16:29 GMT
Thanks for the tips, Pepijn and Alex!

I didn't manage to get your Proguard task working as it is, so I made a few
modifications until it worked:
- Proguard version: updated to 4.8 (internal requirement);
- Proguard dependency: changed groupId to net.sf.proguard;
- rt.jar inclusion: substituted it with the version from Alex's script;
- obfuscate() method: since I keep my Proguard configurations in a separate
file, I only provided the :configuration option. The " {'keep' => @keep,
'whyareyoukeeping' => @whykeeping}..." part of the function didn't seem to
like it so much, so I removed it. Could you perhaps provide an example of
how you use your task?

Other than that, it now behaves as expected, and my build runs all the way
to the end.


On Mon, Apr 15, 2013 at 6:20 PM, Alex Boisvert <alex.boisvert@gmail.com>wrote:

> Thanks for sharing Pepijn.   Your version has much better bones than the
> one I threw together quickly.
>
> Khristian: I suggest you try it and go/extend from there.
>
>
> On Mon, Apr 15, 2013 at 12:54 AM, Pepijn Van Eeckhoudt <
> pepijn@vaneeckhoudt.net> wrote:
>
> > Hi Khristian,
> >
> > I've made a copy of the Proguard extension I use at work available at
> > https://gist.github.com/**pepijnve/5386437<
> 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<
> 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 <alex.boisvert@gmail.com
> >*
> >> *wrote:
> >>
> >>  Hi Khristian,
> >>>
> >>> I hacked something quickly together here:
> >>> https://gist.github.com/**aboisvert/5323180<
> 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/co**nfiguration.pro<
> http://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
> >>>>
> >>>>
> >>>
> >>
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message