-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathRakefile
More file actions
75 lines (61 loc) · 2.05 KB
/
Rakefile
File metadata and controls
75 lines (61 loc) · 2.05 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
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
require 'rake'
require './ezbake.rb'
puts "EZBAKE PROJECT NAME: #{EZBake::Config[:project]}"
RAKE_ROOT = File.dirname(__FILE__)
# TODO: not sure what to do here. I have it this way so that you
# can toggle it on and off during dev, but in practice, we probably
# just want it on all the time? Otherwise we'd just be detecting
# to see if there were any snapshots involved, and if so, we'd
# dynamically turn it on; so it's not providing any safety...
LEIN_SNAPSHOTS_IN_RELEASE = true
if LEIN_SNAPSHOTS_IN_RELEASE
ENV['LEIN_SNAPSHOTS_IN_RELEASE'] = 'y'
end
# Load tasks and variables for packaging automation
require 'packaging'
Pkg::Util::RakeUtils.load_packaging_tasks
namespace :package do
task :bootstrap do
puts 'Bootstrap is no longer needed, using packaging-as-a-gem'
end
task :implode do
puts 'Implode is no longer needed, using packaging-as-a-gem'
end
end
# We want to use ezbake's package:tar and its dependencies, because it
# contains all the special java snowflake magicks, so we have to clear the
# packaging repo's. We also want to use ezbake's clean task, since it has so
# much more clean than the packaging repo knows about
['clean'].each do |task|
Rake::Task[task].clear if Rake::Task.task_defined?(task)
end
# All variables have been set, so we can load the ezbake tasks
Dir[ File.join(RAKE_ROOT, 'tasks','*.rake') ].sort.each { |t| load t }
task :'default.erb' => [ :package ]
task :allclean => [ :clobber ]
desc "Remove build artifacts (other than clojure (lein) builds)"
task :clean do
rm_rf FileList["ext/files", "pkg", "*.tar.gz"]
end
desc "Get rid of build artifacts including clojure (lein) builds"
task :clobber => [ :clean ] do
rm_rf FileList["target/EZBake::Config[:project]*jar"]
end
if defined?(Pkg) and defined?(Pkg::Config)
@version = Pkg::Config.version
else
begin
%x{which git >/dev/null 2>&1}
if $?.success?
@version = %x{git describe --always --dirty}
if $?.success?
@version.chomp!
end
end
rescue
@version = "0.0-dev-build"
end
end
task :version do
puts @version
end