Skip to content

Commit

Permalink
Merge pull request #1 from lacostej/github_master
Browse files Browse the repository at this point in the history
Rakefile improvement: portability using ruby code
  • Loading branch information
lacostej authored Nov 6, 2017
2 parents 908eb13 + dde71b3 commit 1021fe1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions DevelopmentTools/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#
# Please refrain from expanding this file unless really necessary

require 'fileutils'

task :chdir do
file = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
rakefile_dir = File.expand_path File.dirname file
Expand All @@ -42,16 +44,10 @@ end

desc 'Build the Uplift DLL and the unitypackage contain the DLL and its dependencies'
task :build, [:unity_version] => [:chdir] do |t, args|
require 'u3d'
args.with_defaults(unity_version: '5.6.0f3')
unity_version = args[:unity_version]
if(U3dCore::Helper.windows?)
sh "echo m_EditorVersion: #{unity_version} > ProjectSettings/ProjectVersion.txt"
sh('copy ProjectSettings\ProjectVersion.txt Build\ProjectSettings /Y')
else
sh "echo \"m_EditorVersion: #{unity_version}\" > ProjectSettings/ProjectVersion.txt"
sh("cp ProjectSettings/ProjectVersion.txt Build/ProjectSettings/ProjectVersion.txt")
end
File.write("ProjectSettings/ProjectVersion.txt", "m_EditorVersion: #{unity_version}")
FileUtils.cp("ProjectSettings/ProjectVersion.txt", "Build/ProjectSettings/ProjectVersion.txt")

sh('bundle exec u3d -- -logFile u3d.log -batchmode -quit -executeMethod BuildTool.DllCompiler.BuildPackage')

Expand Down
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
m_EditorVersion: 5.6.0f3
m_EditorVersion: 5.6.0f3

0 comments on commit 1021fe1

Please sign in to comment.