-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathRakefile
28 lines (22 loc) · 1.04 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
require 'colorize'
desc "Release A New Version"
task :release do
puts "Releasing Version: ".bold
version = STDIN.gets.strip
puts "Exporting unity package...".bold
unity_app = "/Applications/Unity/Hub/Editor/2020.3.15f2/Unity.app"
working_path = `pwd`.strip
proj_path = "#{working_path}/LINE_SDK_Unity"
puts `#{unity_app}/Contents/MacOS/Unity -batchmode -projectPath #{proj_path} -exportPackage Assets/Plugins Assets/LineSDK output.unitypackage -quit`
FileUtils.mkdir "Release" unless File.exists?("Release")
FileUtils.mv "#{proj_path}/output.unitypackage", "./Release/line_sdk_unity_#{version}.unitypackage"
Rake::Task["updateDocVersion"].invoke(version)
`open ./Release`
end
desc "Update version in Doxyfile"
task :updateDocVersion, [:version] do |task, args|
puts "work", args[:version]
text = File.read('Doxyfile')
new_contents = text.gsub(/PROJECT_NUMBER\s+=\s+(\d+\.)?(\d+\.)?(\*|\d+)/, "PROJECT_NUMBER = #{args[:version]}")
File.open("Doxyfile", "w") {|file| file.puts new_contents }
end