Nevermind.  Didn't read the wiki that closely.  I needed the following
package enhance
to apply after the artifact was created:

def sign_jar(task)
  task.enhance do
    puts "Signing jar #{task.to_s}"
    signing = Buildr.settings.build['signing']
    store, aka, pass = signing.values_at('keystore', 'alias', 'storepass')
    puts task.to_s
    ant('signjar') do |signjar|
      signjar.signjar :jar=>task.to_s, :alias=>aka,
:keystore=>store,

                      :storepass=>pass
    end
  end
end

Then on the package to enhance I added:

packages.first.enhance &method(:sign_jar)


Thanks!

On Tue, Mar 19, 2013 at 4:37 PM, Anthony Bargnesi <[email protected]>wrote:

> Hey folks,
>
> I am trying to sign a jar after it is packaged so that the target artifact
> is a signed jar.
>
> I created a separate task to do the work:
>
> task :sign_task do
>   signing = Buildr.settings.build['signing']
>   store, aka, pass = signing.values_at('keystore', 'alias', 'storepass')
>   projects.each do |prj|
>     prj.packages.select{ |pkg| pkg.to_s.end_with?('.jar')}.each do |pkg|
>       ant('signjar') do |signjar|
>         signjar.signjar :jar=>pkg, :alias=>aka, :keystore=>store,
>                         :storepass=>pass
>       end
>     end
>   end
> end
>
> but this isn't hooked into the jar's packaging.  How can this be
> accomplished?
>
> Thanks!
> Anthony Bargnesi
>

Reply via email to