Skip to content

Commit

Permalink
Merge branch 'export'
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Nov 15, 2024
2 parents bfac483 + 3a90676 commit 34e5051
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
22 changes: 9 additions & 13 deletions buildscript.iex
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ defmodule BuildScript do
platforms = [
{"windows", "x86_64"},
{"linuxbsd", "x86_64"},
{"macos", "arm64"},
{"web", "wasm32"},
]
for {target_platform, target_arch} <- platforms do
Expand Down Expand Up @@ -161,19 +160,18 @@ defmodule BuildScript do

templatedir = case @os_family do
{:win32, :nt} ->
"#{System.get_env("USERPROFILE")}/AppData/Roaming/Godot/export_templates/#{version}/"
Path.expand("#{System.get_env("USERPROFILE")}/AppData/Roaming/Godot/export_templates/#{version}/")
{:unix, :darwin} ->
"#{System.get_env("HOME")}/Library/Application Support/Godot/export_templates/#{version}/"
Path.expand("#{System.get_env("HOME")}/Library/Application Support/Godot/export_templates/#{version}/")
{:unix, _} ->
"#{System.get_env("HOME")}/.local/share/godot/export_templates/#{version}/"
Path.expand("#{System.get_env("HOME")}/.local/share/godot/export_templates/#{version}/")
end
File.mkdir_p!(templatedir)

debug_file = case target_platform do
"linuxbsd" -> "#{@extract_dir_extracted}/godot.linuxbsd.template_debug.double.#{target_arch}"
"windows" -> "#{@extract_dir_extracted}/godot.windows.template_debug.double.#{target_arch}.llvm.exe"
"web" -> "#{@extract_dir_extracted}/godot.web.template_debug.double.wasm32.dlink.zip"
"macos" -> "#{@extract_dir_extracted}/godot_macos_double.zip"
"android" -> "#{@extract_dir_extracted}/android_debug.apk"
_ -> raise "Unsupported platform: #{target_platform}"
end
Expand All @@ -182,7 +180,6 @@ defmodule BuildScript do
"linuxbsd" -> "#{@extract_dir_extracted}/godot.linuxbsd.template_release.double.#{target_arch}"
"windows" -> "#{@extract_dir_extracted}/godot.windows.template_release.double.#{target_arch}.llvm.exe"
"web" -> "#{@extract_dir_extracted}/godot.web.template_release.double.wasm32.dlink.zip"
"macos" -> "#{@extract_dir_extracted}/godot_macos_double.zip"
"android" -> "#{@extract_dir_extracted}/android_release.apk"
_ -> raise "Unsupported platform: #{target_platform}"
end
Expand All @@ -194,13 +191,12 @@ defmodule BuildScript do
"macos" -> "macos_debug_#{target_arch}"
"android" -> "android_debug.apk"
_ -> "#{target_platform}_debug_#{target_arch}"
end
end

release_file_name = case target_platform do
"linuxbsd" -> "linux_release.#{target_arch}"
"windows" -> "windows_release_#{target_arch}.exe"
"web" -> "web_dlink_nothreads_release.zip"
"macos" -> "macos_release_#{target_arch}"
"android" -> "android_release.apk"
_ -> "#{target_platform}_release_#{target_arch}"
end
Expand All @@ -221,15 +217,15 @@ defmodule BuildScript do
end
File.chmod(editor_file, 0o755)
pwd = Path.dirname(__ENV__.file)
arguments = ["--headless", "--path", pwd, "--import", "-e"]
System.cmd("bash", ["-c", "#{editor_file} #{Enum.join(arguments, " ")}"], stderr_to_stdout: true)
arguments = ["--headless", "--path", pwd, "--import"]
{output, _exit_code} = System.cmd("bash", ["-c", "#{editor_file} #{Enum.join(arguments, " ")}"])
IO.puts(output)

output_file = "#{@extract_dir}/export_#{target_platform}_#{target_arch}/#{@project_name}"
output_file = if target_platform == "windows", do: output_file <> ".exe", else: output_file

arguments = ["--headless", "--path", pwd, "--export-release", target_platform, output_file, "-e"]
{_, 0} = System.cmd("bash", ["-c", "#{editor_file} #{Enum.join(arguments, " ")}"], stderr_to_stdout: true)
IO.puts(Enum.join(arguments, " "))
{output, _exit_code} = System.cmd("bash", ["-c", "#{editor_file} #{Enum.join(arguments, " ")}"])
IO.puts(output)

case target_platform do
"windows" ->
Expand Down
2 changes: 1 addition & 1 deletion export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ custom_template/release=""
debug/export_console_wrapper=1
application/icon=""
application/icon_interpolation=4
application/bundle_identifier=""
application/bundle_identifier="org.v-sekai.xr-grid"
application/signature=""
application/app_category="Games"
application/short_version=""
Expand Down
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ config_version=5

config/name="xr-grid"
run/main_scene="res://procedural_3d_grid_sample/scenes/main.tscn"
config/features=PackedStringArray("4.4", "Double Precision", "Forward Plus")
config/features=PackedStringArray("4.4", "Forward Plus")
config/icon="res://icon.svg"

[autoload]
Expand Down

0 comments on commit 34e5051

Please sign in to comment.