buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ilya Pyatigorskiy <ata...@gmail.com>
Subject Re: NoMethodError : undefined method `java' for Buildr::Eclipse::Java:Module
Date Wed, 23 Mar 2011 18:10:45 GMT
I believe you are missing "Commands" bit:
Java.java should be Java::Commands.java

Btw you might also be interested in this (a bit more complex) gwt
script. It offers:
1) auto recompile only when needed (if you can maintain the list of sources)
2) draftCompile (faster) in dev env
3) fetching gwt modules from config

(I'm an extreme newbie in ruby so there are a few obvious ugly pieces
there, starting with _("target/classes") where i didn't know how to
pass compile.target to java classpath and up to the rm_rf bit)

--- build.yaml ---
gwt-modules:
  - ru.proj.web.main.MainModule

--- buildfile ---
    gwt_sources = FileList[_("src/main/java/**/*.gwt.xml"),
                           _("src/main/java/ru/proj/entity/**/*"),
                           _("src/main/java/ru/proj/web/main/client/**/*"),
                           _("src/main/java/ru/proj/web/main/shared/**/*")]

    gwt_dest = _("target/gwt")
    file gwt_dest => gwt_sources do |t|
      puts "GWT Compile"
      rm_rf gwt_dest # need that to update the timestamp on the dir
      classpath = compile.dependencies + GWT_DEV + GWT_USER +
[_("src/main/resources"), _("src/main/java"), _("src/main/webapp"),
_("target/classes")]
      args = ["-war", gwt_dest, "-localWorkers", "2"]
      if Buildr.environment == "development"
        args << "-draftCompile"
      end
      args << Buildr.settings.build['gwt-modules'].join(" ")
      Java::Commands.java("com.google.gwt.dev.Compiler", args,
        {:classpath => classpath, :java_args => ["-Xmx256M"], :verbose=>true})
    end


On Wed, Mar 23, 2011 at 3:24 AM, Geraldo Lopes de Souza
<geraldo.ls@gmail.com> wrote:
> 2011/3/22 Geraldo Lopes de Souza <geraldo.ls@gmail.com>
>
>> Hi,
>>
>> I'm getting NoMethodError : undefined method `java' for
>> Buildr::Eclipse::Java:Module while trying to execute Java.java.
>>
>> ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]
>> buildr (1.4.5)
>>
>> Thanks for help
>>
>> buildfile below
>>
>> require 'buildr'
>> VERSAO = '0.1'
>>
>> GWT = 'com.google.gwt:gwt-user:jar:2.2.0'
>> GWT_DEV = 'com.google.gwt:gwt-dev:jar:2.2.0'
>>
>> repositories.remote << "http://repo1.maven.org/maven2/"
>>
>> layout = Layout.new
>>
>> layout[:source, :main, :java] = "src"
>> layout[:source, :test, :java] = "test"
>> layout[:target, :main, :classes] = "war/WEB-INF/classes"
>> layout[:target, :main] = 'war'
>> layout[:target] = 'war'
>> layout[:target, :test, :classes] = "test-classes"
>>
>> define 'clinica', :layout => layout do
>>  project.version = VERSAO
>>  project.group = 'group'
>>  compile.options.target = '1.6'
>>
>>  compile.with(GWT)
>>
>> task :gwtc do
>>    puts "GWT Compile"
>>    classpath = [GWT, GWT_DEV, "src/app/client", "src/app/shared"]
>>    Java.java  :main => ["com.google.gwt.dev.Compiler"],
>>               :classpath => classpath,
>>               :java_args => ["-Xmx256M"]
>>  end
>>
>>  task :build => :gwtc
>> end
>

Mime
View raw message