-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.rb
executable file
·87 lines (58 loc) · 2.02 KB
/
setup.rb
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
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env ruby
# Setup script for Stackwalk
# NOTE: sudo is required on linux (unless skipping package manager installs)
require 'English'
# RubySetupSystem Bootstrap
if !File.exist? 'RubySetupSystem/RubySetupSystem.rb'
puts 'Initializing RubySetupSystem'
system 'git submodule init && git submodule update'
if $CHILD_STATUS.exitstatus != 0
abort('Failed to initialize or update git submodules. ' \
'Please make sure git is in path and ' \
'you have an ssh key setup for your github account')
end
else
# Make sure RubySetupSystem is up to date
# This may make debugging RubySetupSystem harder so feel free to comment out
system 'git submodule update'
end
require 'fileutils'
require_relative 'RubySetupSystem/RubyCommon.rb'
def checkRunFolder(suggested)
random_file = File.join(suggested, 'setup.rb')
onError('Not ran from base directory!') unless File.exist?(random_file)
thirdPartyFolder = File.join suggested, 'ThirdParty'
FileUtils.mkdir_p thirdPartyFolder
FileUtils.mkdir_p File.join suggested, 'build', 'ThirdParty'
thirdPartyFolder
end
def projectFolder(baseDir)
File.expand_path File.join(baseDir, '../')
end
require_relative 'RubySetupSystem/RubySetupSystem.rb'
require_relative 'stack_walk_dependencies.rb'
# All the objects
installer = Installer.new(
@libs_list
)
installer.run
onError "'StackWalk' folder is missing" unless File.exist? ProjectDir
Dir.chdir(ProjectDir) do
FileUtils.mkdir_p 'build'
end
success 'StackWalk folder and assets are good to go'
info 'Compiling StackWalk'
# Build directory is made earlier
Dir.chdir(File.join(ProjectDir, 'build')) do
onError 'Failed to configure main project' unless runCMakeConfigure []
onError 'Failed to compile main project' unless TC.runCompiler
end
success 'Done compiling StackWalk'
success 'All done.'
if OS.linux?
info "To compile again just run 'make' in ./build"
puts 'You may need to run this setup again from time to time'
else
info 'Open build/StackWalkAsAService.sln and start coding'
end
exit 0