Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix don't attempt to get extension_host for launch_path #2992

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 36 additions & 21 deletions test/internal/xcschemes/infos_from_json_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,35 @@ def infos_from_json_test_suite(name):
],
)

expected_launch_path = xcscheme_infos_testable.make_launch_target(
path = "/path/to/App.app",
post_actions = [
xcscheme_infos_testable.make_pre_post_action(
for_build = True,
order = "",
script_text = "ssss",
title = "ttt",
),
],
pre_actions = [
xcscheme_infos_testable.make_pre_post_action(
for_build = True,
order = "7",
script_text = "s",
title = "tttt",
),
],
working_directory = "wd",
)
expected_profile_same_as_run_launch_path = (
xcscheme_infos_testable.make_launch_target(
path = "/path/to/App.app",
post_actions = [],
pre_actions = [],
working_directory = "wd",
)
)

_add_test(
name = "{}_run_launch_path".format(name),

Expand All @@ -716,7 +745,7 @@ def infos_from_json_test_suite(name):
json_str = json.encode([
{
"name": "A scheme",
"profile": None,
"profile": "same_as_run",
"run": struct(
args = full_args,
build_targets = full_build_targets,
Expand Down Expand Up @@ -759,6 +788,11 @@ def infos_from_json_test_suite(name):
expected_infos = [
xcscheme_infos_testable.make_scheme(
name = "A scheme",
profile = xcscheme_infos_testable.make_profile(
build_targets = expected_full_build_targets,
env_include_defaults = "0",
launch_target = expected_profile_same_as_run_launch_path,
),
run = xcscheme_infos_testable.make_run(
args = expected_full_args,
build_targets = expected_full_build_targets,
Expand All @@ -769,26 +803,7 @@ def infos_from_json_test_suite(name):
),
env = expected_full_env,
env_include_defaults = "0",
launch_target = xcscheme_infos_testable.make_launch_target(
path = "/path/to/App.app",
post_actions = [
xcscheme_infos_testable.make_pre_post_action(
for_build = True,
order = "",
script_text = "ssss",
title = "ttt",
),
],
pre_actions = [
xcscheme_infos_testable.make_pre_post_action(
for_build = True,
order = "7",
script_text = "s",
title = "tttt",
),
],
working_directory = "wd",
),
launch_target = expected_launch_path,
xcode_configuration = "custom",
),
),
Expand Down
9 changes: 9 additions & 0 deletions xcodeproj/internal/xcschemes/xcscheme_infos.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ def _make_launch_target(
)

def _make_same_as_run_launch_target(run_launch_target):
if run_launch_target.is_path == TRUE_ARG:
return struct(
is_path = TRUE_ARG,
path = run_launch_target.path,
post_actions = EMPTY_LIST,
pre_actions = EMPTY_LIST,
working_directory = run_launch_target.working_directory,
)

return struct(
extension_host = run_launch_target.extension_host,
id = run_launch_target.id,
Expand Down
Loading