This repository has been archived by the owner on Apr 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Assetfile
196 lines (147 loc) · 4.27 KB
/
Assetfile
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
require "rake-pipeline-web-filters"
require 'rake-pipeline-web-filters/filter_with_dependencies'
require "json"
require "less"
require "execjs"
require "uglifier"
require "./app/submodules/yoin-ember/rakep/filters"
require "./app/submodules/yoin-views/rakep/filters"
require "./app/submodules/yoin-views-pos/rakep/filters"
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
is_android = !ENV['ANDROID'].nil? && !ENV['ANDROID'].empty?
output "source/assets2"
input "app/submodules/yoin-views-pos/assets2" do
match "**/*" do
copy
end
end
output "source/assets"
input "app/submodules/yoin-views/assets" do
match "**/*" do
copy
end
end
output "source/assets_fx"
input "app/submodules/yoin-views/assets_fx" do
match "**/*" do
copy
end
end
output "tmp/source"
input "." do
match "app/submodules/yoin-views-pos/less/views/**/*.less" do
filter Yoin::LessFilter, :is_android => is_android
concat "projecttmp.css"
end
if is_android
match "app/submodules/yoin-views/less/query/android/**/*.less" do
filter Yoin::LessFilter, :is_android => is_android
concat "projecttmp.css"
end
end
match "app/submodules/yoin-views/less/query/tablet/**/*.less" do
filter Yoin::LessFilter, :is_android => is_android
concat "projecttmp.css"
end
match "app/submodules/yoin-views/less/query/mobile/**/*.less" do
filter Yoin::LessFilter, :is_android => is_android
concat "projecttmp.css"
end
match "app/submodules/yoin-views/less/views/**/*.less" do
filter Yoin::LessFilter, :is_android => is_android
concat "projecttmp.css"
end
match "app/submodules/yoin-views/reset/normalize.css" do
concat "projecttmp.css"
end
end
input "app" do
match "submodules/yoin-views-pos/templates/**/*.handlebars" do
filter Yoin::HandlebarsPrecompiler
concat "apptmp.js"
end
match "submodules/yoin-views/templates/**/*.handlebars" do
filter Yoin::HandlebarsPrecompiler
concat "apptmp.js"
filter Yoin::AddHandlebarsDependencies
end
match "app/lib/**/*.js" do
minispade :rewrite_requires => true, :string=> false, :module_id_generator => proc { |input|
id = input.path.dup
id.sub!('/lib/', '/')
id.sub!(/\.js$/, '')
id.sub!(/\/main$/, '')
id
}
concat "apptmp.js"
end
if is_android
match "submodules/yoin-views/lib-android/**/*.js" do
minispade :rewrite_requires => true, :string=> false, :module_id_generator => proc { |input|
id = input.path.dup
id.sub!('submodules/', '')
id.sub!(/\.js$/, '')
id.sub!(/\/main$/, '')
id
}
concat "apptmp.js"
end
end
match "submodules/{yoin-ember}/fixtures/**/*.js" do
minispade :rewrite_requires => true, :string=> false, :module_id_generator => proc { |input|
id = input.path.dup
id.sub!('submodules/', '')
id.sub!(/\.js$/, '')
id
}
concat "apptmp.js"
end
match "submodules/{yoin-ember,yoin-views,yoin-views-pos}/lib/**/*.js" do
minispade :rewrite_requires => true, :string=> false, :module_id_generator => proc { |input|
id = input.path.dup
id.sub!('submodules/', '')
id.sub!('/lib/', '/')
id.sub!(/\.js$/, '')
id.sub!(/\/main$/, '')
id
}
concat "apptmp.js"
end
match "submodules/*/packages/{ember-data,ember-application,ember-routing,ember-debug,ember-metal,ember-runtime,ember-states,ember-views,rsvp,container,metamorph,ember-handlebars,ember-handlebars-compiler,ember-touch}/lib/**/.js" do
minispade :rewrite_requires => true, :string=> false, :module_id_generator => proc { |input|
id = input.path.dup
id.sub!('submodules/', '')
id.sub!(/[a-z\-\.]+\//, '')
id.sub!('packages/', '')
id.sub!('/lib/', '/')
id.sub!(/\.js$/, '')
id.sub!(/\/main$/, '')
id
}
concat "apptmp.js"
filter Yoin::FixEmberViews
filter Yoin::AddMicroLoader, :global => true
end
match "submodules/yoin-views/vendor/*.js" do
concat "apptmp.js"
end
match "submodules/yoin-ember/vendor/*.js" do
concat "apptmp.js"
end
end
production = !ENV['YOIN_PROD'].nil? && !ENV['YOIN_PROD'].empty?
output "source"
input "tmp/source" do
match "apptmp.js" do
if production
filter Yoin::EmberProductionFilter
uglify( {:copyright => false} )
end
concat "app.js"
end
match "projecttmp.css" do
concat "project.css"
end
end
# vim: filetype=ruby