-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
42 lines (30 loc) · 1.42 KB
/
Rakefile
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
DRAGON_EXE = File.join(Dir.home, "Library/Application Support/itch/apps/dragonruby-gtk/dragonruby-macos/dragonruby")
DRAGON_PUBLISH_EXE = File.join(Dir.home, "Library/Application Support/itch/apps/dragonruby-gtk/dragonruby-macos/dragonruby-publish")
desc "Run the game"
task :run do
directory = File.dirname(__FILE__)
Dir.chdir File.dirname(DRAGON_EXE) do
exec DRAGON_EXE, directory
end
end
desc "Build and publish game"
task :publish do
require_relative "app/constants"
game_directory = File.dirname(__FILE__)
dragon_directory = File.dirname(DRAGON_PUBLISH_EXE)
metadata_path = File.join(game_directory, 'metadata', 'game_metadata.txt')
metadata = File.read(metadata_path)
File.write(metadata_path, metadata.gsub(/^version=(.*)$/) { |match| "version=#{VERSION}" })
rm_rf File.join(game_directory, "builds")
rm_rf File.join(dragon_directory, "builds")
rm_rf File.join(dragon_directory, File.basename(game_directory))
cp_r game_directory, dragon_directory, remove_destination: true
rm_rf File.join(dragon_directory, File.basename(game_directory), ".git")
Dir.chdir dragon_directory do
sh DRAGON_PUBLISH_EXE, File.basename(game_directory)
end
mv File.join(dragon_directory, "builds"), game_directory
sh "open", File.join(game_directory, "builds")
end
task default: :run
# convert *.png -posterize 16 -dither FloydSteinberg -resize 32x32! -filter box -colors 16 -depth 4 -verbose pixelated/white-puff.png