Class: Rake::ExtensionTask
- Inherits:
-
BaseExtensionTask
- Object
- TaskLib
- BaseExtensionTask
- Rake::ExtensionTask
- Defined in:
- lib/rake/extensiontask.rb
Instance Attribute Summary (collapse)
-
- (Object) config_includes
Returns the value of attribute config_includes.
-
- (Object) config_script
Returns the value of attribute config_script.
-
- (Object) cross_compile
Returns the value of attribute cross_compile.
-
- (Object) cross_config_options
Returns the value of attribute cross_config_options.
-
- (Object) cross_platform
Returns the value of attribute cross_platform.
-
- (Object) no_native
Returns the value of attribute no_native.
Attributes inherited from BaseExtensionTask
#config_options, #ext_dir, #gem_spec, #lib_dir, #name, #platform, #source_pattern, #tmp_dir
Instance Method Summary (collapse)
- - (Object) binary(platform = nil)
- - (Object) cross_compiling(&block)
- - (Object) define
- - (Object) init(name = nil, gem_spec = nil)
Methods inherited from BaseExtensionTask
Constructor Details
This class inherits a constructor from Rake::BaseExtensionTask
Instance Attribute Details
- (Object) config_includes
Returns the value of attribute config_includes
16 17 18 |
# File 'lib/rake/extensiontask.rb', line 16 def config_includes @config_includes end |
- (Object) config_script
Returns the value of attribute config_script
11 12 13 |
# File 'lib/rake/extensiontask.rb', line 11 def config_script @config_script end |
- (Object) cross_compile
Returns the value of attribute cross_compile
12 13 14 |
# File 'lib/rake/extensiontask.rb', line 12 def cross_compile @cross_compile end |
- (Object) cross_config_options
Returns the value of attribute cross_config_options
14 15 16 |
# File 'lib/rake/extensiontask.rb', line 14 def @cross_config_options end |
- (Object) cross_platform
Returns the value of attribute cross_platform
13 14 15 |
# File 'lib/rake/extensiontask.rb', line 13 def cross_platform @cross_platform ||= 'i386-mingw32' end |
- (Object) no_native
Returns the value of attribute no_native
15 16 17 |
# File 'lib/rake/extensiontask.rb', line 15 def no_native @no_native end |
Instance Method Details
- (Object) binary(platform = nil)
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/rake/extensiontask.rb', line 38 def binary(platform = nil) if platform == "java" warn_once <<-EOF Compiling a native C extension on JRuby. This is discouraged and a Java extension should be preferred. EOF "#{name}.#{RbConfig::MAKEFILE_CONFIG['DLEXT']}" else super end end |
- (Object) cross_compiling(&block)
34 35 36 |
# File 'lib/rake/extensiontask.rb', line 34 def cross_compiling(&block) @cross_compiling = block if block_given? end |
- (Object) define
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/rake/extensiontask.rb', line 50 def define if (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ironruby') warn_once <<-EOF WARNING: You're attempting to (cross-)compile C extensions from a platform (#{RUBY_ENGINE}) that does not support native extensions or mkmf.rb. Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/native compile. EOF return end super unless compiled_files.empty? warn "WARNING: rake-compiler found compiled files in '#{@ext_dir}' directory. Please remove them." end # only gems with 'ruby' platforms are allowed to define native tasks define_native_tasks if !@no_native && (@gem_spec && @gem_spec.platform == 'ruby') # only define cross platform functionality when enabled return unless @cross_compile if cross_platform.is_a?(Array) then cross_platform.each { |platf| define_cross_platform_tasks(platf) } else define_cross_platform_tasks(cross_platform) end end |
- (Object) init(name = nil, gem_spec = nil)
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rake/extensiontask.rb', line 18 def init(name = nil, gem_spec = nil) super @config_script = 'extconf.rb' @source_pattern = "*.c" @compiled_pattern = "*.{o,obj,so,bundle,dSYM}" @cross_compile = false @cross_config_options = [] @cross_compiling = nil @no_native = false @config_includes = [] end |