Sha256: c0bbc4e6daba8e3d9f90a248b0da24eed2a7cef207dbc488bacbd2229fdc140e

Contents?: true

Size: 1.65 KB

Versions: 1

Compression:

Stored size: 1.65 KB

Contents

# vim: set shiftwidth=2 tabstop=2 expandtab:
# encoding: utf-8

require 'rake'
require 'rake/delphi'
require 'rake/delphi/project'

if RAKEVERSION !~ /^0\.8/
  require 'rake/dsl_definition'
  include Rake::DSL
  Rake::TaskManager.record_task_metadata = true if Rake::TaskManager.respond_to?('record_task_metadata')
end

module TestAndroidModule
  PROJECT_NAME = 'Rake test project for Android'
  PROJECT_FILE = 'TestProject'

  task :default => 'test_android:compile'

  namespace :test_android do

    desc 'Compilation'
    _task = task :compile do |t|
      puts 'task %s executed' % t.name
    end

    desc 'Preparation'
    task :prepare, :useresources, :options do |t, opts|
      fail 'Cannot compile this project with Delphi below XE5' if ENV['DELPHI_VERSION'].to_i < 18
      _task = Rake::Task['test_android:compile']
      dpr = Rake.application.define_task(Rake::Delphi::Project, (_task.name + ':delphi').to_sym)
      dpr[:resources_additional] = 'resources' if opts[:useresources]
      dpr[:platform] = 'Android32'
      # always use library path for Android
      dpr[:uselibrarypath] = true
      options = opts[:options] || {}
      if options.kind_of?(String)
        options = eval(options)
      end
      options.each do |k, v|
        dpr[k] = v
      end
      dpr_vars = {}
      dpr_vars[:bin_path] = options[:bin] || File.expand_path(File.dirname(__FILE__) + '/bin')

      dpr_vars[:bin] = File.expand_path2(dpr_vars[:bin_path])
      dpr.init(Module.nesting, File.expand_path(__FILE__), dpr_vars, 0)

      directory dpr_vars[:bin_path]
      _task.enhance [dpr_vars[:bin_path], dpr]
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rake-delphi-0.0.11 test/resources/testproject-android/Rakefile.rb