Skip to content
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
2 changes: 1 addition & 1 deletion apple/ios/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ failure_test(

apple_ios_export(
name = "export_simulator",
app = ":simulator_app",
app = "//apple/tests/fixtures/swift_app:ledger_app",
)

failure_test(
Expand Down
6 changes: 3 additions & 3 deletions apple/ios/app.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ def apple_ios_app(

def _test_selection_impl(ctx):
failures = test_errors(ctx.attr.device_type, ctx.attr.os_version, ctx.attr.deployment)
failures.extend(test_source_errors(ctx.attr.srcs, ctx.attr.deps))
failures.extend(test_source_errors(ctx.attr.srcs, ctx.attr.dep_labels))
if len(failures) > 0:
fail("; ".join(failures))
return [CcInfo()]
Expand All @@ -666,7 +666,7 @@ _test_selection = rule(
doc = "Simulator device type to run tests on, such as iPhone 16.",
mandatory = True,
),
"deps": attr.string_list(
"dep_labels": attr.string_list(
doc = "Label texts of test modules.",
mandatory = True,
),
Expand Down Expand Up @@ -699,7 +699,7 @@ def apple_ios_app_test(
device_type = device_type,
os_version = os_version,
srcs = [label_text(src) for src in srcs],
deps = [label_text(dep) for dep in deps],
dep_labels = [label_text(dep) for dep in deps],
tags = ["manual"],
testonly = True,
visibility = ["//visibility:private"],
Expand Down
37 changes: 12 additions & 25 deletions apple/tests/fixtures/swift_app/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# gazelle:ignore
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@rules_shell//shell:sh_test.bzl", "sh_test")
load("@rules_swift//swift:swift_interop_hint.bzl", "swift_interop_hint")
load("//apple/ios:app.bzl", "apple_ios_app", "apple_ios_app_test")
load("//apple/ios:cell.bzl", "APPLE_HOSTS")
load("//cc/rules:defs.bzl", "cc_library")
load("//rust/rules:defs.bzl", "rust_static_library", "rustfmt_test")
load("//swift/rules:defs.bzl", "swift_library")
Expand All @@ -14,9 +14,10 @@ _MACOS_ARM64 = [

rust_static_library(
name = "ledger_rust",
tags = ["manual"],
srcs = ["ledger.rs"],
edition = "2021",
target_compatible_with = _MACOS_ARM64,
target_compatible_with = APPLE_HOSTS,
)

rustfmt_test(
Expand All @@ -27,32 +28,36 @@ rustfmt_test(

swift_interop_hint(
name = "ledger_core_hint",
tags = ["manual"],
module_name = "LedgerCore",
target_compatible_with = _MACOS_ARM64,
target_compatible_with = APPLE_HOSTS,
)

cc_library(
name = "ledger_core",
tags = ["manual"],
visibility = ["//apple/tests/fixtures/swift_app/main:__pkg__"],
hdrs = ["ledger.h"],
aspect_hints = [":ledger_core_hint"],
target_compatible_with = _MACOS_ARM64,
target_compatible_with = APPLE_HOSTS,
)

swift_library(
name = "ledger_kit",
tags = ["manual"],
visibility = ["//apple/tests/fixtures/swift_app/main:__pkg__"],
srcs = ["LedgerKit.swift"],
module_name = "LedgerKit",
target_compatible_with = _MACOS_ARM64,
target_compatible_with = APPLE_HOSTS,
)

swift_library(
name = "ledger_xctests",
tags = ["manual"],
testonly = True,
srcs = ["LedgerAppTests.swift"],
module_name = "LedgerAppTests",
target_compatible_with = _MACOS_ARM64,
target_compatible_with = APPLE_HOSTS,
deps = [
":ledger_core",
":ledger_kit",
Expand All @@ -69,25 +74,7 @@ apple_ios_app(
resources = ["entries.txt"],
tags = ["manual"],
version = "1.4",
)

apple_ios_app(
name = "ledger_device",
bundle_id = "com.example.ledger.device",
deployment = "17.0",
entry = "//apple/tests/fixtures/swift_app/main:ledger_main",
library = ":ledger_rust",
platforms = ["device/arm64"],
provisioning_profile = "ledger_device.mobileprovision",
resources = ["entries.txt"],
tags = ["manual"],
version = "1.4",
)

build_test(
name = "ledger_device_build_test",
targets = [":ledger_device"],
target_compatible_with = _MACOS_ARM64,
visibility = ["//apple/ios:__pkg__"],
)

apple_ios_app_test(
Expand Down
Binary file not shown.
7 changes: 3 additions & 4 deletions apple/tests/fixtures/swift_app/main/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# gazelle:ignore
load("//apple/ios:cell.bzl", "APPLE_HOSTS")
load("//swift/rules:defs.bzl", "swift_library")

swift_library(
name = "ledger_main",
tags = ["manual"],
srcs = ["LedgerAppDelegate.swift"],
module_name = "LedgerApp",
target_compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:arm64",
],
target_compatible_with = APPLE_HOSTS,
visibility = ["//apple/tests/fixtures/swift_app:__pkg__"],
deps = [
"//apple/tests/fixtures/swift_app:ledger_core",
Expand Down
Loading