-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
63 lines (51 loc) · 1.37 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
require 'logger'
require 'fileutils'
if Gem.win_platform?
# Needed to be able to create symlinks on Windows.
require 'win32/file'
end
$logger = Logger.new($stdout)
release_flag =
if ENV['GDLISP_RELEASE']
['--release']
else
[]
end
task default: %w[run]
task :clippy do |t, args|
sh 'cargo', 'clippy', *args
end
task :doc do |t, args|
ENV['RUSTDOCFLAGS'] ||= ''
ENV['RUSTDOCFLAGS'] += ' -D warnings'
sh 'cargo', 'doc', *args
end
task :build_rs do |t, args|
sh 'cargo', 'build', *release_flag
end
task build: :build_rs do |t, args|
sh 'cargo', 'run', *release_flag, '--', '--compile-stdlib'
cp 'GDLisp.gd', 'MacroServer/GDLisp.gd'
cp_r 'MacroServer', 'target/debug'
cp 'GDLisp.msgpack', 'target/debug'
cp_r 'MacroServer', 'target/debug/deps'
cp 'GDLisp.msgpack', 'target/debug/deps'
cp_r 'MacroServer', 'target/release'
cp 'GDLisp.msgpack', 'target/release'
cp_r 'MacroServer', 'target/release/deps'
cp 'GDLisp.msgpack', 'target/release/deps'
if release_flag.include? '--release'
mkdir_p 'bin/'
File.delete('bin/gdlisp') if File.exist?('bin/gdlisp')
File.symlink('../target/release/gdlisp', 'bin/gdlisp')
end
end
task run: :build do |t, args|
sh 'cargo', 'run', *release_flag, *args
end
task test: :build do |t, args|
sh 'cargo', 'test', *release_flag, *args
end
task :clean do |t, args|
sh 'cargo', 'clean', *args
end