2019-07-03 09:44:53 +02:00
|
|
|
# Build GodotTools solution
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
from SCons.Script import Dir
|
|
|
|
|
|
|
|
|
|
|
|
def build_godot_tools(source, target, env):
|
|
|
|
# source and target elements are of type SCons.Node.FS.File, hence why we convert them to str
|
|
|
|
|
2020-03-30 08:28:32 +02:00
|
|
|
module_dir = env["module_dir"]
|
2019-07-03 09:44:53 +02:00
|
|
|
|
2020-03-30 08:28:32 +02:00
|
|
|
solution_path = os.path.join(module_dir, "editor/GodotTools/GodotTools.sln")
|
|
|
|
build_config = "Debug" if env["target"] == "debug" else "Release"
|
2019-07-03 09:44:53 +02:00
|
|
|
|
2020-05-09 17:09:49 +02:00
|
|
|
from .solution_builder import build_solution
|
2019-07-03 09:44:53 +02:00
|
|
|
|
2020-06-23 21:01:54 +02:00
|
|
|
extra_msbuild_args = ["/p:GodotPlatform=" + env["platform"]]
|
|
|
|
|
|
|
|
build_solution(env, solution_path, build_config, extra_msbuild_args)
|
2019-12-28 19:12:32 +01:00
|
|
|
# No need to copy targets. The GodotTools csproj takes care of copying them.
|
2019-07-03 09:44:53 +02:00
|
|
|
|
|
|
|
|
2019-11-22 23:42:24 +01:00
|
|
|
def build(env_mono, api_sln_cmd):
|
2020-03-30 08:28:32 +02:00
|
|
|
assert env_mono["tools"]
|
2019-07-03 09:44:53 +02:00
|
|
|
|
2020-03-30 08:28:32 +02:00
|
|
|
output_dir = Dir("#bin").abspath
|
|
|
|
editor_tools_dir = os.path.join(output_dir, "GodotSharp", "Tools")
|
2019-07-03 09:44:53 +02:00
|
|
|
|
2020-03-30 08:28:32 +02:00
|
|
|
target_filenames = ["GodotTools.dll"]
|
2019-07-03 09:44:53 +02:00
|
|
|
|
2020-03-30 08:28:32 +02:00
|
|
|
if env_mono["target"] == "debug":
|
|
|
|
target_filenames += ["GodotTools.pdb"]
|
2019-07-03 09:44:53 +02:00
|
|
|
|
|
|
|
targets = [os.path.join(editor_tools_dir, filename) for filename in target_filenames]
|
|
|
|
|
2019-11-22 23:42:24 +01:00
|
|
|
cmd = env_mono.CommandNoCache(targets, api_sln_cmd, build_godot_tools, module_dir=os.getcwd())
|
2019-07-03 09:44:53 +02:00
|
|
|
env_mono.AlwaysBuild(cmd)
|