|
|
@@ -27,7 +27,7 @@ namespace :android do
|
|
|
|
|
|
CMAKE_ANDROID_BUILD_FOLDER = "#{$RAKE_ROOT}/Artifacts/Android_Build"
|
|
|
|
|
|
- task :build_player do
|
|
|
+ task :player do
|
|
|
|
|
|
if !Dir.exists?("#{CMAKE_ANDROID_BUILD_FOLDER}")
|
|
|
FileUtils.mkdir_p(CMAKE_ANDROID_BUILD_FOLDER)
|
|
|
@@ -46,7 +46,7 @@ namespace :web do
|
|
|
|
|
|
CMAKE_WEB_BUILD_FOLDER = "#{$RAKE_ROOT}/Artifacts/Web_Build"
|
|
|
|
|
|
- task :build_player do
|
|
|
+ task :player do
|
|
|
|
|
|
if !Dir.exists?("#{CMAKE_WEB_BUILD_FOLDER}")
|
|
|
FileUtils.mkdir_p(CMAKE_WEB_BUILD_FOLDER)
|
|
|
@@ -67,28 +67,31 @@ namespace :web do
|
|
|
end
|
|
|
|
|
|
|
|
|
-namespace :build_macosx do
|
|
|
+namespace :macosx do
|
|
|
|
|
|
+ ARTIFACTS_FOLDER = "#{$RAKE_ROOT}/Artifacts"
|
|
|
CMAKE_MACOSX_BUILD_FOLDER = "#{$RAKE_ROOT}/Artifacts/MacOSX_Build"
|
|
|
MACOSX_PACKAGE_FOLDER = "#{$RAKE_ROOT}/Artifacts/MacOSX_Package"
|
|
|
|
|
|
task :clean do
|
|
|
|
|
|
- if Dir.exists?("#{CMAKE_MACOSX_BUILD_FOLDER}")
|
|
|
- sh "rm -rf #{CMAKE_MACOSX_BUILD_FOLDER}"
|
|
|
- end
|
|
|
+ folders = ["#{CMAKE_MACOSX_BUILD_FOLDER}", "#{MACOSX_PACKAGE_FOLDER}",
|
|
|
+ "#{ARTIFACTS_FOLDER}/Android_Build", "#{ARTIFACTS_FOLDER}/Web_Build",
|
|
|
+ "#{ARTIFACTS_FOLDER}/AtomicExamples", "#{ARTIFACTS_FOLDER}/Docs",
|
|
|
+ "#{ARTIFACTS_FOLDER}/Examples", "#{ARTIFACTS_FOLDER}/AtomicTiled_Build"]
|
|
|
|
|
|
- if Dir.exists?("#{CMAKE_MACOSX_BUILD_FOLDER}")
|
|
|
- abort("Unable to clean #{CMAKE_MACOSX_BUILD_FOLDER}")
|
|
|
- end
|
|
|
+ for index in 0 ... folders.size
|
|
|
|
|
|
- if Dir.exists?("#{MACOSX_PACKAGE_FOLDER}")
|
|
|
- sh "rm -rf #{MACOSX_PACKAGE_FOLDER}"
|
|
|
- end
|
|
|
+ if Dir.exists?(folders[index])
|
|
|
+ puts "rm -rf #{folders[index]}"
|
|
|
+ sh "rm -rf #{folders[index]}"
|
|
|
+ end
|
|
|
|
|
|
- if Dir.exists?("#{MACOSX_PACKAGE_FOLDER}")
|
|
|
- abort("Unable to clean #{MACOSX_PACKAGE_FOLDER}")
|
|
|
- end
|
|
|
+ if Dir.exists?(folders[index])
|
|
|
+ abort("Unable to clean #{folders[index]}")
|
|
|
+ end
|
|
|
+
|
|
|
+ end
|
|
|
|
|
|
end
|
|
|
|
|
|
@@ -102,7 +105,7 @@ namespace :build_macosx do
|
|
|
|
|
|
end
|
|
|
|
|
|
- task :generate_javascript_bindings => "build_macosx:cmake" do
|
|
|
+ task :generate_javascript_bindings => "macosx:cmake" do
|
|
|
|
|
|
Dir.chdir(CMAKE_MACOSX_BUILD_FOLDER) do
|
|
|
sh "make -j8 JSBind"
|
|
|
@@ -111,7 +114,46 @@ namespace :build_macosx do
|
|
|
|
|
|
end
|
|
|
|
|
|
- task :player => "build_macosx:generate_javascript_bindings" do
|
|
|
+ task :generate_docs => "macosx:generate_javascript_bindings" do
|
|
|
+
|
|
|
+ Dir.chdir("#{$RAKE_ROOT}/Docs") do
|
|
|
+
|
|
|
+ if Dir.exists?("out")
|
|
|
+ sh "rm -rf out"
|
|
|
+ end
|
|
|
+
|
|
|
+ # add the generated JS bindings
|
|
|
+ sh "./gendocs.sh"
|
|
|
+ sh "cp -r out #{$RAKE_ROOT}/Artifacts/Docs"
|
|
|
+ end
|
|
|
+
|
|
|
+ end
|
|
|
+
|
|
|
+ task :generate_examples do
|
|
|
+
|
|
|
+ Dir.chdir("#{$RAKE_ROOT}/Artifacts") do
|
|
|
+
|
|
|
+ if Dir.exists?("AtomicExamples")
|
|
|
+ sh "rm -rf AtomicExamples"
|
|
|
+ end
|
|
|
+
|
|
|
+ if Dir.exists?("Examples")
|
|
|
+ sh "rm -rf Examples"
|
|
|
+ end
|
|
|
+
|
|
|
+ sh "mkdir Examples"
|
|
|
+
|
|
|
+ sh "git clone https://github.com/AtomicGameEngine/AtomicExamples"
|
|
|
+
|
|
|
+ Dir.chdir("AtomicExamples") do
|
|
|
+ sh "git archive master | tar -x -C #{$RAKE_ROOT}/Artifacts/Examples"
|
|
|
+ end
|
|
|
+
|
|
|
+ end
|
|
|
+
|
|
|
+ end
|
|
|
+
|
|
|
+ task :player => "macosx:generate_javascript_bindings" do
|
|
|
|
|
|
Dir.chdir(CMAKE_MACOSX_BUILD_FOLDER) do
|
|
|
# add the generated JS bindings
|
|
|
@@ -121,57 +163,89 @@ namespace :build_macosx do
|
|
|
|
|
|
end
|
|
|
|
|
|
- task :editor => ["build_macosx:player", "atomictiled:build_osx"] do
|
|
|
+ task :editor => [#"android:player",
|
|
|
+ #"web:player",
|
|
|
+ "macosx:player",
|
|
|
+ "atomictiled:osx",
|
|
|
+ "macosx:generate_examples",
|
|
|
+ "macosx:generate_docs"
|
|
|
+ ] do
|
|
|
|
|
|
Dir.chdir(CMAKE_MACOSX_BUILD_FOLDER) do
|
|
|
- # add the generated JS bindings
|
|
|
+
|
|
|
+
|
|
|
sh "make -j8 AtomicEditor"
|
|
|
|
|
|
- PLAYER_APP_FOLDER = "#{CMAKE_MACOSX_BUILD_FOLDER}/Source/Tools/AtomicPlayer/AtomicPlayer.app"
|
|
|
- EDITOR_APP_FOLDER = "#{CMAKE_MACOSX_BUILD_FOLDER}/AtomicEditor/AtomicEditor.app"
|
|
|
- DEPLOYMENT_FOLDER = "#{EDITOR_APP_FOLDER}/Contents/Resources/Deployment/MacOS"
|
|
|
+ end
|
|
|
|
|
|
- COREDATA_FOLDER = "#{$RAKE_ROOT}/Bin/CoreData"
|
|
|
- DATA_FOLDER = "#{$RAKE_ROOT}/Bin/Data"
|
|
|
- EDITORRESOURCES_FOLDER = "#{$RAKE_ROOT}/AtomicEditor/EditorResources"
|
|
|
+ end
|
|
|
|
|
|
- if Dir.exists?("#{EDITOR_APP_FOLDER}/Contents/Resources")
|
|
|
- sh "rm -rf #{EDITOR_APP_FOLDER}/Contents/Resources"
|
|
|
- end
|
|
|
+end
|
|
|
|
|
|
- FileUtils.mkdir_p(DEPLOYMENT_FOLDER)
|
|
|
+namespace :package do
|
|
|
|
|
|
- sh "cp -r #{COREDATA_FOLDER} #{EDITOR_APP_FOLDER}/Contents/Resources/CoreData"
|
|
|
- sh "cp -r #{DATA_FOLDER} #{EDITOR_APP_FOLDER}/Contents/Resources/Data"
|
|
|
- sh "cp -r #{EDITORRESOURCES_FOLDER} #{EDITOR_APP_FOLDER}/Contents/Resources/EditorResources"
|
|
|
- sh "cp -r #{PLAYER_APP_FOLDER} #{DEPLOYMENT_FOLDER}/AtomicPlayer.app"
|
|
|
+ task :macosx_editor => ['macosx:clean',
|
|
|
+ 'macosx:editor'] do
|
|
|
|
|
|
- ATOMICTILED_DEPLOYED_DIR = "#{EDITOR_APP_FOLDER}/Contents/Applications"
|
|
|
|
|
|
- FileUtils.mkdir_p(ATOMICTILED_DEPLOYED_DIR)
|
|
|
+ FileUtils.mkdir_p(MACOSX_PACKAGE_FOLDER)
|
|
|
|
|
|
- FileUtils.cp_r("#{$ATOMICTILED_BUILD_DIR}/bin/Tiled.app", "#{ATOMICTILED_DEPLOYED_DIR}/Tiled.app")
|
|
|
+ MAC_PLAYER_APP_FOLDER_SRC = "#{CMAKE_MACOSX_BUILD_FOLDER}/Source/Tools/AtomicPlayer/AtomicPlayer.app"
|
|
|
+ MAC_EDITOR_APP_FOLDER_SRC = "#{CMAKE_MACOSX_BUILD_FOLDER}/AtomicEditor/AtomicEditor.app"
|
|
|
|
|
|
- Dir.chdir(ATOMICTILED_DEPLOYED_DIR) do
|
|
|
- sh "#{$QT_BIN_DIR}/macdeployqt #{ATOMICTILED_DEPLOYED_DIR}/Tiled.app"
|
|
|
- end
|
|
|
+ COREDATA_FOLDER_SRC = "#{$RAKE_ROOT}/Bin/CoreData"
|
|
|
+ DATA_FOLDER_SRC = "#{$RAKE_ROOT}/Bin/Data"
|
|
|
+ EDITORRESOURCES_FOLDER_SRC = "#{$RAKE_ROOT}/AtomicEditor/EditorResources"
|
|
|
|
|
|
+ PROJECTTEMPLATES_FOLDER_SRC = "#{$RAKE_ROOT}/AtomicEditor/EditorApplicationData/ProjectTemplates"
|
|
|
|
|
|
- end
|
|
|
+ #Example info could possibly go in the AtomicExamples repo
|
|
|
+ EXAMPLEINFO_FOLDER_SRC = "#{$RAKE_ROOT}/AtomicEditor/EditorApplicationData/ExampleInfo"
|
|
|
|
|
|
- end
|
|
|
+ EXAMPLES_FOLDER_SRC = "#{$RAKE_ROOT}/Artifacts/Examples"
|
|
|
+ DOCS_FOLDER_SRC = "#{$RAKE_ROOT}/Artifacts/Docs"
|
|
|
|
|
|
-end
|
|
|
+ MAC_EDITOR_APP_FOLDER_DST = "#{MACOSX_PACKAGE_FOLDER}/AtomicEditor.app"
|
|
|
+ MAC_EDITOR_APP_RESOURCE_FOLDER_DST = "#{MACOSX_PACKAGE_FOLDER}/AtomicEditor.app/Contents/Resources"
|
|
|
+
|
|
|
+
|
|
|
+ sh "cp -r #{MAC_EDITOR_APP_FOLDER_SRC} #{MACOSX_PACKAGE_FOLDER}/AtomicEditor.app"
|
|
|
+
|
|
|
+ DEPLOYMENT_FOLDER_DST = "#{MAC_EDITOR_APP_RESOURCE_FOLDER_DST}/Deployment"
|
|
|
+
|
|
|
+ FileUtils.mkdir_p("#{DEPLOYMENT_FOLDER_DST}")
|
|
|
+
|
|
|
+ FileUtils.mkdir_p(DEPLOYMENT_FOLDER_DST + "/MacOS")
|
|
|
+ FileUtils.mkdir_p(DEPLOYMENT_FOLDER_DST + "/Android")
|
|
|
+
|
|
|
+ sh "cp -r #{COREDATA_FOLDER_SRC} #{MAC_EDITOR_APP_RESOURCE_FOLDER_DST}/CoreData"
|
|
|
+ sh "cp -r #{DATA_FOLDER_SRC} #{MAC_EDITOR_APP_RESOURCE_FOLDER_DST}/Data"
|
|
|
+ sh "cp -r #{EDITORRESOURCES_FOLDER_SRC} #{MAC_EDITOR_APP_RESOURCE_FOLDER_DST}/EditorResources"
|
|
|
+ sh "cp -r #{MAC_PLAYER_APP_FOLDER_SRC} #{DEPLOYMENT_FOLDER_DST}/MacOS/AtomicPlayer.app"
|
|
|
|
|
|
-namespace :package_macosx do
|
|
|
+ sh "cp -r #{EXAMPLES_FOLDER_SRC} #{MAC_EDITOR_APP_RESOURCE_FOLDER_DST}/Examples"
|
|
|
+ sh "cp -r #{DOCS_FOLDER_SRC} #{MAC_EDITOR_APP_RESOURCE_FOLDER_DST}/Docs"
|
|
|
+
|
|
|
+ sh "cp -r #{PROJECTTEMPLATES_FOLDER_SRC} #{MAC_EDITOR_APP_RESOURCE_FOLDER_DST}/ProjectTemplates"
|
|
|
+ sh "cp -r #{EXAMPLEINFO_FOLDER_SRC} #{MAC_EDITOR_APP_RESOURCE_FOLDER_DST}/ExampleInfo"
|
|
|
+
|
|
|
+ # DEPLOY TILED
|
|
|
+ ATOMICTILED_DEPLOYED_DIR = "#{MAC_EDITOR_APP_FOLDER_DST}/Contents/Applications"
|
|
|
+
|
|
|
+ FileUtils.mkdir_p(ATOMICTILED_DEPLOYED_DIR)
|
|
|
+
|
|
|
+ FileUtils.cp_r("#{$ATOMICTILED_BUILD_DIR}/bin/Tiled.app", "#{ATOMICTILED_DEPLOYED_DIR}/Tiled.app")
|
|
|
+
|
|
|
+ Dir.chdir(ATOMICTILED_DEPLOYED_DIR) do
|
|
|
+ sh "#{$QT_BIN_DIR}/macdeployqt #{ATOMICTILED_DEPLOYED_DIR}/Tiled.app"
|
|
|
+ end
|
|
|
|
|
|
- task :editor => ['build_macosx:clean', 'build_macosx:editor'] do
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
-namespace :build_windows do
|
|
|
+namespace :windows do
|
|
|
|
|
|
CMAKE_WINDOWS_BUILD_FOLDER = "#{$RAKE_ROOT}/Artifacts/Windows_Build"
|
|
|
PACKAGE_WINDOWS_FOLDER = "#{$RAKE_ROOT}/Artifacts/Windows_Package"
|
|
|
@@ -206,7 +280,7 @@ namespace :build_windows do
|
|
|
|
|
|
end
|
|
|
|
|
|
- task :generate_javascript_bindings => "build_windows:cmake" do
|
|
|
+ task :generate_javascript_bindings => "windows:cmake" do
|
|
|
|
|
|
Dir.chdir(CMAKE_WINDOWS_BUILD_FOLDER) do
|
|
|
sh "nmake JSBind"
|
|
|
@@ -215,7 +289,7 @@ namespace :build_windows do
|
|
|
|
|
|
end
|
|
|
|
|
|
- task :player => "build_windows:generate_javascript_bindings" do
|
|
|
+ task :player => "windows:generate_javascript_bindings" do
|
|
|
|
|
|
Dir.chdir(CMAKE_WINDOWS_BUILD_FOLDER) do
|
|
|
# add the generated JS bindings
|
|
|
@@ -225,7 +299,7 @@ namespace :build_windows do
|
|
|
|
|
|
end
|
|
|
|
|
|
- task :editor => "build_windows:player" do
|
|
|
+ task :editor => "windows:player" do
|
|
|
|
|
|
Dir.chdir(CMAKE_WINDOWS_BUILD_FOLDER) do
|
|
|
# add the generated JS bindings
|
|
|
@@ -253,7 +327,7 @@ end
|
|
|
|
|
|
namespace :package_windows do
|
|
|
|
|
|
- task :editor => ['build_windows:clean', 'build_windows:editor'] do
|
|
|
+ task :editor => ['windows:clean', 'windows:editor'] do
|
|
|
|
|
|
end
|
|
|
|
|
|
@@ -261,7 +335,7 @@ end
|
|
|
|
|
|
namespace :atomictiled do
|
|
|
|
|
|
- task :build_windows do
|
|
|
+ task :windows do
|
|
|
|
|
|
QT_CREATOR_BIN_DIR = "C:\\Qt\\Tools\\QtCreator\\bin"
|
|
|
ENV['PATH'] = "#{$QT_BIN_DIR};" + ENV['PATH']
|
|
|
@@ -288,7 +362,7 @@ namespace :atomictiled do
|
|
|
|
|
|
end
|
|
|
|
|
|
- task :build_osx do
|
|
|
+ task :osx do
|
|
|
|
|
|
FileUtils.mkdir_p($ATOMICTILED_BUILD_DIR)
|
|
|
|