This repository was archived by the owner on Mar 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
47 lines (41 loc) · 1.26 KB
/
Rakefile
File metadata and controls
47 lines (41 loc) · 1.26 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
task :default => :start
$build_dir = File.expand_path("~/funpacks/bukkit-essentials/build")
$cache_dir = File.expand_path("~/funpacks/bukkit-essentials/cache")
$working_dir = File.expand_path(ENV['WORKING'] || "~/funpacks/bukkit-essentials/working")
task :start do
system %Q{
mkdir -p #{$working_dir}
}
File.write "#{$working_dir}/data.json", <<-EOS
{
"name": "Woodbury",
"access": { "blacklist": [] },
"settings": {
"ops": ["whatupdave"],
"max-players": "22",
"gamemode": 2,
"seed": "s33d",
"allow-nether": true,
"allow-flight": false,
"spawn-animals": true,
"spawn-monsters": false,
"spawn-npcs": false
}
}
EOS
Dir.chdir($working_dir) do
raise "error" unless system "PORT=4032 RAM=638 DATAFILE=#{$working_dir}/data.json #{$build_dir}/bin/run 2>&1"
end
end
task :compile do
fail unless system "rm -rf #{$build_dir} && mkdir -p #{$build_dir} #{$cache_dir}"
fail unless system "bin/compile #{$build_dir} #{$cache_dir} 2>&1"
Dir.chdir($build_dir) do
if !system("bundle check")
fail unless system "bundle install --deployment 2>&1"
end
end
end
task :import do
fail unless system "cd #{$working_dir}/.. && #{$build_dir}/bin/import"
end