forked from charlieridley/emu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssetfile
52 lines (47 loc) · 1.17 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
require "rake-pipeline-web-filters"
EMU_VERSION = File.read("VERSION").strip
class VersionInfo < Rake::Pipeline::Filter
def version_info
@version_info ||= begin
latest_tag = `git describe --tags`
last_commit = `git log -n 1 --format="%h (%ci)"`
out = "// Version: #{latest_tag}"
out << "// Last commit: #{last_commit}"
out
end
end
def generate_output(inputs, output)
inputs.each do |input|
file = File.read(input.fullpath)
output.write "#{version_info}\n\n#{file}"
end
end
end
output "dist"
input "src/emu" do
match "**/*.coffee" do
coffee_script
concat [
"core.js.js",
"application_ext.js.js",
"model/model_evented.js.js"
], "ember-emu-#{EMU_VERSION}.js"
end
match "ember-emu-#{EMU_VERSION}.js" do
filter VersionInfo
concat "ember-emu-#{EMU_VERSION}.js"
end
end
output "dist"
input "src/emu-signalr" do
match "**/*.coffee" do
coffee_script
concat [
"signalr_pus_data_adapter.js.js"
], "ember-emu-signalr-#{EMU_VERSION}.js"
end
match "ember-emu-signalr-#{EMU_VERSION}.js" do
filter VersionInfo
concat "ember-emu-signalr-#{EMU_VERSION}.js"
end
end