Sha256: 3ba8e8fcecf13efeb48ca6ef20d840eda537310c45beac2ecc219a007797ec86

Contents?: true

Size: 911 Bytes

Versions: 2

Compression:

Stored size: 911 Bytes

Contents

require 'rake'
require 'yaml'
require 'tilt'
require 'paint'
require 'nokogiri'
require 'erb'

START = Time.now

#
# Some helper methods
#
def get_sources(ext, dir = 'app')
  Rake::FileList.new("#{dir}/**/*.#{ext}") do |fl|
    fl.exclude('~*')
    fl.exclude(%r{^scratch/})
    # fl.exclude { |f| `git ls-files #{f}`.empty? } # Only commited
  end
end

def config(key)
  return @xml[key] if @xml
  xml = Nokogiri::XML(File.open('config.xml'))
  @xml = {
    app: xml.xpath('//xmlns:name').text,
    desc: xml.xpath('//xmlns:description').text,
    platforms: xml.xpath('//xmlns:platform').map { |os| os['name'] }
  }
  config(key)
end

def layout
  @layout ||= Tilt.new('app/html/layout.haml')
end

def app
  config(:app)
end

def env
  @env ||= ENV['TARGET'] || 'development'
end

# And load all tasks
tasks = File.join(File.dirname(__FILE__), '..', 'tasks')
Dir.glob("#{tasks}/*.rake").each { |r| import r }

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cordova-rake-0.5.0 lib/cordova/rake.rb
cordova-rake-0.4.3 lib/cordova/rake.rb