forked from imkira/unity-sysfont
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
55 lines (45 loc) · 1.45 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
#!/usr/bin/env ruby
# -*- coding: UTF-8 -*-
require 'fileutils'
task :default => [:build]
bundle_name = 'SysFont.bundle'
macosx_dir = File.expand_path(File.join(File.dirname(__FILE__), 'macosx'))
jar_name = 'SysFont.jar'
android_dir = File.expand_path(File.join(File.dirname(__FILE__), 'android'))
android_classes = "/Applications/Unity/Unity.app/Contents/PlaybackEngines/AndroidPlayer/bin/classes.jar"
namespace :build do
file "#{macosx_dir}/build/Release/#{bundle_name}" do
Dir.chdir(macosx_dir) do
system 'xcodebuild clean build'
end
end
desc 'Build plugin for MacOSX'
task :macosx => "#{macosx_dir}/build/Release/#{bundle_name}" do
end
file "#{android_dir}/bin/#{jar_name}" do
Dir.chdir(android_dir) do
system 'android update project -p .'
system 'mkdir -p libs'
FileUtils.cp(android_classes, 'libs')
system 'ant release'
FileUtils.mv('bin/classes.jar', "bin/#{jar_name}", :verbose => true)
end
end
desc 'Build plugin for Android'
task :android => "#{android_dir}/bin/#{jar_name}" do
end
desc 'Clean any builds'
task :clean do
Dir.chdir(macosx_dir) do
system 'xcodebuild clean'
FileUtils.rm_rf('build', :verbose => true)
end
Dir.chdir(android_dir) do
system 'android update project -p .'
system 'ant clean'
FileUtils.rm_rf('libs', :verbose => true)
end
end
end
desc 'Build plugin for MacOSX/Android'
task :build => ['build:macosx', 'build:android']