Uploaded image for project: 'Buildr (Retired)'
  1. Buildr (Retired)
  2. BUILDR-659

Checkstyle addon can not handle local dependencies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.4.9
    • 1.4.10
    • Extensions
    • None
    • JRuby 1.7.1
      ArchLinux x86_64

    Description

      I have a small test project called 'project' in which I am trying bits of functionality from various addons. While trying to configure checkstyle, I ran into the following: 'buildr project:checkstyle:xml --trace' results in the trace below.

      My buildfile contains the following:

      require 'buildr/checkstyle'

      repositories.remote << "http://repo1.maven.org/maven2"

      define "project" do
      compile.with FileList['lib/*/*.jar']
      end

      Nothing fancy, the test code relies on some jars inside the project. The problematic line in checkstyle.rb is

      cp = Buildr.artifacts(dependencies).each(&:invoke).map(&:to_s)

      Some of my dependencies are plain strings, which don't respond to invoke.

      Removing the compile.with line and fixing the code allows checkstyle to execute as expected.

      Trace:

      (in /space/projects/internal/training/buildr/project, development)

        • Execute project
        • Invoke project (first_time)
        • Execute project:checkstyle:xml
        • Invoke project
        • Invoke project:checkstyle:xml (first_time)
          Checkstyle: Analyzing source code...
          mkdir -p /space/projects/internal/training/buildr/project/reports/checkstyle
          Buildr aborted!
          NoMethodError : undefined method `invoke' for #<String:0x60992d7c>
          org/jruby/RubyBasicObject.java:1659:in `_send_'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/buildr-1.4.9-java/lib/buildr/core/util.rb:169:in `to_proc'
          org/jruby/RubyArray.java:1612:in `each'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/buildr-1.4.9-java/addon/buildr/checkstyle.rb:37:in `checkstyle'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/buildr-1.4.9-java/addon/buildr/checkstyle.rb:170:in `ProjectExtension'
          org/jruby/RubyProc.java:249:in `call'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
          org/jruby/RubyArray.java:1612:in `each'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/buildr-1.4.9-java/lib/buildr/core/application.rb:673:in `invoke_with_call_chain'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/1.9/monitor.rb:211:in `mon_synchronize'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/buildr-1.4.9-java/lib/buildr/core/application.rb:659:in `invoke_with_call_chain'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/buildr-1.4.9-java/lib/buildr/core/application.rb:654:in `invoke'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/buildr-1.4.9-java/lib/buildr/core/application.rb:238:in `top_level'
          org/jruby/RubyArray.java:1612:in `each'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/buildr-1.4.9-java/lib/buildr/core/application.rb:238:in `top_level'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/buildr-1.4.9-java/lib/buildr/core/application.rb:534:in `standard_exception_handling'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/buildr-1.4.9-java/lib/buildr/core/application.rb:229:in `top_level'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/buildr-1.4.9-java/lib/buildr/core/application.rb:130:in `run'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/buildr-1.4.9-java/lib/buildr/core/application.rb:534:in `standard_exception_handling'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/buildr-1.4.9-java/lib/buildr/core/application.rb:127:in `run'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/lib/ruby/gems/shared/gems/buildr-1.4.9-java/bin/buildr:19:in `(root)'
          org/jruby/RubyKernel.java:1046:in `load'
          /home/dieterv/.rbenv/versions/jruby-1.7.1/bin/buildr:23:in `(root)'

      Attachments

        Activity

          People

            pdonald Peter Donald
            jackrabbit Dieter Vrancken
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: