buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carl-Gustaf Harroch <charr...@gmail.com>
Subject adding LinkedResources to .project when calling the eclipse task
Date Mon, 01 Feb 2010 13:10:54 GMT
Hello,

I need to add an external source to the .project file when generating
an eclipse project. This is a requirement for my android project which
would fail upon testing otherwise. My aim would be to do something
along the following lines:

in buildfile:
eclipse.external_sources = project('RESTProvider')

and overriding the Eclipse module with:
---
module Buildr
  module Eclipse
    include Extension
    class Eclipse
      def external_sources=(var)
        @external_sources = arrayfy(var)
      end

      def external_sources(*values)
        if values.size > 0
          @external_sources ||= []
          @external_sources += values
        else
          @external_sources || (@project.parent ?
@project.parent.eclipse.external_sources : [])
        end
      end
    end
  end
end

class Buildr::Project
  include Buildr::Eclipse::Android
end
---

>From here I am not sure how to overwrite the after_define method as it
seems to only call if the .project does not exist. As such if the base
Eclipe module creates the file, my implementation will not be called
and vice versa. I am not a rubyist per say so any guidance would be
appreciated.

Regards,
Carl

Mime
View raw message