2016-03-17 21:53:19 -04:00
|
|
|
unless defined?(Motion::Project::App)
|
|
|
|
raise "This must be required from within a RubyMotion Rakefile"
|
|
|
|
end
|
|
|
|
|
|
|
|
file_dependencies = {
|
2016-03-18 08:36:28 -04:00
|
|
|
'aasm/aasm.rb' => ['aasm/persistence.rb'],
|
|
|
|
'aasm/persistence.rb' => ['aasm/persistence/plain_persistence.rb', 'aasm/persistence/core_data_query_persistence.rb'],
|
|
|
|
'aasm/persistence/base.rb' => ['aasm/base.rb'],
|
|
|
|
'aasm/persistence/core_data_query_persistence.rb' => ['aasm/persistence/base.rb']
|
2016-03-17 21:53:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
exclude_files = [
|
2016-03-18 08:36:28 -04:00
|
|
|
'aasm/rspec.*',
|
|
|
|
'aasm/persistence/active_record_persistence.rb',
|
|
|
|
'aasm/persistence/dynamoid_persistence.rb',
|
|
|
|
'aasm/persistence/mongo_mapper_persistence.rb',
|
|
|
|
'aasm/persistence/mongoid_persistence.rb',
|
2016-03-19 09:37:29 -04:00
|
|
|
'aasm/persistence/sequel_persistence.rb',
|
|
|
|
'aasm/persistence/redis_persistence.rb'
|
2016-03-17 21:53:19 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
Motion::Project::App.setup do |app|
|
|
|
|
parent = File.expand_path File.dirname(__FILE__)
|
|
|
|
|
2016-03-18 09:28:33 -04:00
|
|
|
app.files.unshift Dir.glob(File.join(parent, "aasm/**/*.rb")).reject { |file| exclude_files.any? { |exclude| file.match(exclude) } }
|
2016-03-17 21:53:19 -04:00
|
|
|
|
|
|
|
app.files_dependencies file_dependencies.inject({}, &->(file_dependencies, (file, *dependencies)) do
|
|
|
|
file = File.join(parent, file)
|
|
|
|
dependencies = dependencies.flatten(1).map do |dependency|
|
|
|
|
File.join(parent, dependency)
|
|
|
|
end
|
|
|
|
|
|
|
|
file_dependencies.merge({ file => dependencies })
|
|
|
|
end)
|
|
|
|
end
|