forked from fuse4x/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rb
executable file
·33 lines (24 loc) · 1.27 KB
/
build.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
#!/usr/bin/env ruby
# Possible flags are:
# --debug this builds distribuition with debug flags enabled
# --root DIR install the binary into this directory. If this flag is not set - the script
# redeploys kext to local machine and restarts it
# --clean clean before build
CWD = File.dirname(__FILE__)
FRAMEWORKS_DIR = '/Library/Frameworks/'
Dir.chdir(CWD)
debug = ARGV.include?('--debug')
clean = ARGV.include?('--clean')
root_dir = ARGV.index('--root') ? ARGV[ARGV.index('--root') + 1] : nil
abort("root directory #{root_dir} does not exist") if ARGV.index('--root') and not File.exists?(root_dir)
system('git clean -xdf') if clean
configuration = debug ? 'Debug' : 'Release'
system("xcodebuild SYMROOT=build SHARED_PRECOMPS_DIR=build -PBXBuildsContinueAfterErrors=0 -parallelizeTargets -configuration #{configuration} -alltargets") or abort("cannot build kext")
install_path = root_dir ? File.join(root_dir, FRAMEWORKS_DIR) : FRAMEWORKS_DIR
system("sudo mkdir -p #{install_path}") if root_dir
system("sudo cp -R build/#{configuration}/Fuse4X.framework #{install_path}") or abort
# TODO:
# Framework should use dylib/header files from root_dir
# Copy debug symbols?
# Copy project template
# Generate docmentation and put it both to distibution and the site