Hello Buildrians,

I am slowly working my on dependency resolution addon and am stuck on how to tweak the buildr buildfile dsl. I want to add a lock_jar block to define repositories and artifacts at a root level and per project. The root level lock_jar definition will be merged into the lock_jar calls in the projects. These lock_jar definitions will get resolved and locked into a file, similar to how bundler works, when the task <project>:lock_jar:lock is run. Then when compile is called on a project, the lock file is loaded to the classpath. This is an example what I am trying to do with the buildfile:

   require 'lock_jar'
   lock_jar do
        repository = 'http://repo1.maven.org/maven2'

        scope 'test' do
          jar 'junit:junit:jar:4.10'
        end
   end

   define 'app' do

      def 'project1' do
        lock_jar do
          jar "org.apache.mina:mina-core:jar:2.0.4"
        end
      end

      def 'project2' do
         lock_jar do
           pom 'pom.xml'
         end
      end

   end


The problem I have is setting the root 'lock_jar' method for the buildfile. The non working version I have now: https://github.com/mguymon/lock_jar/blob/master/lib/lock_jar/buildr.rb which complains of a NoMethodError : undefined method `lock_jar' for main:Object

Any help is greatly appreciated.

thanks,
Michael

Reply via email to