-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRakefile
58 lines (46 loc) · 1.56 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
require 'rake/testtask'
task default: :build
desc 'Builds the App.'
task gen: 'DialogSystem/DialogSystem.jar'
task gen: 'build/extraction.weights'
task :format do
options = []
options.push '--replace' if ENV['repair']
sh "gherkin_format #{options.join ' '} test/*.feature"
end
task run: 'DialogSystem/DialogSystem.jar' do
sh run_command()
end
def run_command()
"#{ENV['JAVA_HOME']}/bin/java -cp DialogSystem:DialogSystem/resources:DialogSystem/DialogSystem.jar:#{FileList['DialogSystem/lib/*.jar'].join ':'} de.roboy.dialog.DialogSystem"
end
directory 'build'
file 'build/extraction.weights'
file 'build/extraction.weights' do
mkdir_p 'build'
sh "curl -O http://pjreddie.com/media/files/extraction.weights --output extraction.weights"
sh 'mv extraction.weights build'
end
file 'DialogSystem/DialogSystem.jar' => FileList['DialogSystem/**/*.java'] do
cd('DialogSystem') do
mkdir_p 'package'
sh 'cp -r resources ..'
sh "#{ENV['JAVA_HOME']}/bin/javac #{FileList['src/**/*.java']} -cp #{FileList['lib/*.jar'].join ':'} -d package"
sh "#{ENV['JAVA_HOME']}/bin/jar cfm DialogSystem.jar Manifest.txt -C package/ ."
end
end
desc 'Tests the Application'
task :test => :gen do
ENV['sut'] = run_command
options = []
options << '--stop' if ENV['stop']
options << '--tags ~skip'
sh "PYTHONPATH=src behave #{options * ' '} test"
end
task :game => :gen do
puts "Command: #{run_command}"
ENV['command'] = run_command
ENV['PYTHONPATH'] = 'src'
#sh 'PYTHONPATH=src python3 src/roboy/guessing_game.py'
sh 'python3 src/roboy/guessing_game.py'
end