Sha256: 3ea0d90cedde4fea6326b3c245e8f18743ae2bf7af7877c2e7cebe7d0a1c49e5

Contents?: true

Size: 924 Bytes

Versions: 4

Compression:

Stored size: 924 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')
  source_files = Rake::FileList.new("#{dir}/**/*.#{ext}") do |fl|
    fl.exclude("~*")
    fl.exclude(/^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

4 entries across 4 versions & 1 rubygems

Version Path
cordova-rake-0.3.1 lib/cordova/rake.rb
cordova-rake-0.3.0 lib/cordova/rake.rb
cordova-rake-0.0.8 lib/cordova/rake.rb
cordova-rake-0.0.7 lib/cordova/rake.rb