You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Geraldo Lopes de Souza <ge...@gmail.com> on 2011/05/06 02:53:49 UTC

Gwt compile task compatible with gwt 2.3 "validation-api as sources dependency"

Hi,

I needed to pass 'javax.validation:validation-api:jar:1.0.0.GA' sources to
my gwtc task.
It asks you to "buildr artifacts:sources" if source isn't found.
It passes the jar source to gwt compiler.
Someone can have the same problem and save some minutes :)
If you have a better way please enlighten me.

  task :gwtc do
    puts "GWT Compile"
    artifacts = [GWT, GWT_DEV, VALIDATION].collect {|d| artifact(d)}

    validation_sources =
artifact(VALIDATION).to_s.gsub('.jar','-sources.jar')
    if ! File.exists?(validation_sources)
      puts "Validation sources not found. invoke buildr artifacts:sources"
      exit
    end
    artifacts << validation_sources
    classpath_ary = []
    artifacts.each do |a|
      a.install if a.respond_to?(:install)
      classpath_ary << a.to_s
    end
    classpath_ary << compile.source.to_s
    classpath_ary << compile.target.to_s
    cmd = "java -Xmx512m -cp #{classpath_ary.join(':')}
com.google.gwt.dev.Compiler app.Clinica"
    puts cmd
    system cmd
  end

Anyway, never had the chance to thank you for this project.
I use ruby at work for sysadmin.
Use it for building my stuff and keeping me away from xml hell is double
pleasure !!

Kudos to the team.

Geraldo Lopes de Souza