This repository was archived by the owner on May 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplatforms.rake
More file actions
39 lines (36 loc) · 1.44 KB
/
platforms.rake
File metadata and controls
39 lines (36 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
desc 'List available project platforms.'
task :platforms do
COLLECTION_PROJECT_PLATFORMS.each do |platform_path|
platform = File.basename(platform_path, '.yml')
variants = @ceedling[PLATFORMS_SYM].platform_variants(platform).map {|path| File.basename(path, '.yml')}
if !variants.nil? && variants.length > 0
puts "#{platform}: #{variants.join(', ')}"
else
puts platform
end
end
end
namespace :platform do
COLLECTION_PROJECT_PLATFORMS.each do |platform_path|
platform = File.basename(platform_path, '.yml')
desc "Build for '#{platform}' platform."
task platform.to_sym, [:variant] do |t, args|
variant = args[:variant]
if variant.nil?
@ceedling[PLATFORMS_SYM].setup_platform(platform_path)
else
platform_variants = @ceedling[PLATFORMS_SYM].platform_variants(platform)
filename = variant + '.yml'
filelist = platform_variants.map {|s| File.basename(s)}
@ceedling[:file_finder].find_file_from_list(filename, filelist, :error)
variant_path = platform_variants.detect {|path| File.basename(path, '.yml') == variant}
@ceedling[PLATFORMS_SYM].setup_platform(platform_path, variant_path)
end
end
end
rule /^platform:.*/ do |t, args|
filename = t.to_s.split(':')[-1] + '.yml'
filelist = COLLECTION_PROJECT_PLATFORMS.map {|s| File.basename(s)}
@ceedling[:file_finder].find_file_from_list(filename, filelist, :error)
end
end