Skip to content

Commit

Permalink
Disable docc_archive tests & examples
Browse files Browse the repository at this point in the history
These need to use the new symbol graph rule from rules_swift 2.0.0
  • Loading branch information
luispadron committed Jul 3, 2024
1 parent 21553c6 commit a8e21cd
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 127 deletions.
22 changes: 11 additions & 11 deletions examples/ios/HelloWorldSwift/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
load("//apple:docc.bzl", "docc_archive")
load("//apple:ios.bzl", "ios_application", "ios_ui_test", "ios_unit_test")

licenses(["notice"])
Expand Down Expand Up @@ -91,13 +90,14 @@ ios_ui_test(
)

# Example using docc_archive to generate documentation
docc_archive(
name = "HelloWorldSwift.doccarchive",
default_code_listing_language = "en",
dep = ":HelloWorldSwift",
diagnostic_level = "information",
enable_inherited_docs = True,
fallback_bundle_identifier = "com.example.hello-world-swift",
fallback_bundle_version = "1.0.0",
fallback_display_name = "HelloWorldSwift",
)
# TODO: enable once new rules_swift 2.0 symbol graph rule is supported
# docc_archive(
# name = "HelloWorldSwift.doccarchive",
# default_code_listing_language = "en",
# dep = ":HelloWorldSwift",
# diagnostic_level = "information",
# enable_inherited_docs = True,
# fallback_bundle_identifier = "com.example.hello-world-swift",
# fallback_bundle_version = "1.0.0",
# fallback_display_name = "HelloWorldSwift",
# )
155 changes: 77 additions & 78 deletions test/starlark_tests/docc_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@

"""docc Starlark tests."""

load(
"//test/starlark_tests/rules:common_verification_tests.bzl",
"archive_contents_test",
)

def docc_test_suite(name):
"""Test suite for docc rules.
Expand All @@ -27,85 +22,89 @@ def docc_test_suite(name):
"""

# Verify doccarchive bundle is created for Swift iOS app.
archive_contents_test(
name = "{}_contains_doccarchive_when_ios_swift_app".format(name),
build_type = "simulator",
target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_swift_dep.doccarchive",
contains = [
"$BUNDLE_ROOT/index.html",
],
text_file_not_contains = [
"$BUNDLE_ROOT/documentation/basicframework/readme/index.html", # only included with a .docc bundle in data
],
text_test_file = "$BUNDLE_ROOT/metadata.json",
text_test_values = [
"\"bundleDisplayName\":\"app_with_swift_dep\"",
"\"bundleIdentifier\":\"com.google.example\"",
"\"major\":0",
"\"minor\":1",
"\"patch\":0",
],
tags = [name],
)
# TODO: enable once new rules_swift 2.0 symbol graph rule is supported
# archive_contents_test(
# name = "{}_contains_doccarchive_when_ios_swift_app".format(name),
# build_type = "simulator",
# target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_swift_dep.doccarchive",
# contains = [
# "$BUNDLE_ROOT/index.html",
# ],
# text_file_not_contains = [
# "$BUNDLE_ROOT/documentation/basicframework/readme/index.html", # only included with a .docc bundle in data
# ],
# text_test_file = "$BUNDLE_ROOT/metadata.json",
# text_test_values = [
# "\"bundleDisplayName\":\"app_with_swift_dep\"",
# "\"bundleIdentifier\":\"com.google.example\"",
# "\"major\":0",
# "\"minor\":1",
# "\"patch\":0",
# ],
# tags = [name],
# )

# Verify doccarchive bundle is created for Swift iOS framework which includes a .docc bundle.
archive_contents_test(
name = "{}_contains_doccarchive_with_docc_bundle_when_ios_framework".format(name),
build_type = "simulator",
target_under_test = "//test/starlark_tests/targets_under_test/ios:basic_framework_with_docc_bundle.doccarchive",
contains = [
"$BUNDLE_ROOT/index.html",
"$BUNDLE_ROOT/documentation/basicframework/readme/index.html",
],
text_file_not_contains = [],
text_test_file = "$BUNDLE_ROOT/metadata.json",
text_test_values = [
"\"bundleDisplayName\":\"BasicFramework\"",
"\"bundleIdentifier\":\"com.google.example.framework\"",
"\"major\":0",
"\"minor\":1",
"\"patch\":0",
],
tags = [name],
)
# TODO: enable once new rules_swift 2.0 symbol graph rule is supported
# archive_contents_test(
# name = "{}_contains_doccarchive_with_docc_bundle_when_ios_framework".format(name),
# build_type = "simulator",
# target_under_test = "//test/starlark_tests/targets_under_test/ios:basic_framework_with_docc_bundle.doccarchive",
# contains = [
# "$BUNDLE_ROOT/index.html",
# "$BUNDLE_ROOT/documentation/basicframework/readme/index.html",
# ],
# text_file_not_contains = [],
# text_test_file = "$BUNDLE_ROOT/metadata.json",
# text_test_values = [
# "\"bundleDisplayName\":\"BasicFramework\"",
# "\"bundleIdentifier\":\"com.google.example.framework\"",
# "\"major\":0",
# "\"minor\":1",
# "\"patch\":0",
# ],
# tags = [name],
# )

# Verify doccarchive bundle is created for an ObjC library which defines data and has a dependency on a Swift lib.
archive_contents_test(
name = "{}_contains_doccarchive_when_objc_library_with_swift_dep".format(name),
build_type = "simulator",
target_under_test = "//test/starlark_tests/targets_under_test/ios:basic_objc_lib_with_data_and_docc_bundle_dependency.doccarchive",
contains = [
"$BUNDLE_ROOT/index.html",
"$BUNDLE_ROOT/documentation/basiclib/readme/index.html",
],
text_file_not_contains = [],
text_test_file = "$BUNDLE_ROOT/metadata.json",
text_test_values = [
"\"bundleDisplayName\":\"BasicLib\"",
"\"bundleIdentifier\":\"com.google.example.objc.lib\"",
"\"major\":0",
"\"minor\":1",
"\"patch\":0",
],
tags = [name],
)
# TODO: enable once new rules_swift 2.0 symbol graph rule is supported
# archive_contents_test(
# name = "{}_contains_doccarchive_when_objc_library_with_swift_dep".format(name),
# build_type = "simulator",
# target_under_test = "//test/starlark_tests/targets_under_test/ios:basic_objc_lib_with_data_and_docc_bundle_dependency.doccarchive",
# contains = [
# "$BUNDLE_ROOT/index.html",
# "$BUNDLE_ROOT/documentation/basiclib/readme/index.html",
# ],
# text_file_not_contains = [],
# text_test_file = "$BUNDLE_ROOT/metadata.json",
# text_test_values = [
# "\"bundleDisplayName\":\"BasicLib\"",
# "\"bundleIdentifier\":\"com.google.example.objc.lib\"",
# "\"major\":0",
# "\"minor\":1",
# "\"patch\":0",
# ],
# tags = [name],
# )

# Verify hosting_base_path support.
archive_contents_test(
name = "{}_contains_doccarchive_with_docc_bundle_when_ios_framework_with_hosting_base_path".format(name),
build_type = "simulator",
target_under_test = "//test/starlark_tests/targets_under_test/ios:basic_framework_with_docc_bundle_custom_base_path.doccarchive",
contains = [
"$BUNDLE_ROOT/index.html",
"$BUNDLE_ROOT/documentation/basicframework/readme/index.html",
],
text_file_not_contains = [],
text_test_file = "$BUNDLE_ROOT/index.html",
text_test_values = [
"<script src=\"/custom/base/path/js/",
],
tags = [name],
)
# TODO: enable once new rules_swift 2.0 symbol graph rule is supported
# archive_contents_test(
# name = "{}_contains_doccarchive_with_docc_bundle_when_ios_framework_with_hosting_base_path".format(name),
# build_type = "simulator",
# target_under_test = "//test/starlark_tests/targets_under_test/ios:basic_framework_with_docc_bundle_custom_base_path.doccarchive",
# contains = [
# "$BUNDLE_ROOT/index.html",
# "$BUNDLE_ROOT/documentation/basicframework/readme/index.html",
# ],
# text_file_not_contains = [],
# text_test_file = "$BUNDLE_ROOT/index.html",
# text_test_values = [
# "<script src=\"/custom/base/path/js/",
# ],
# tags = [name],
# )

native.test_suite(
name = name,
Expand Down
73 changes: 35 additions & 38 deletions test/starlark_tests/targets_under_test/ios/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ load(
"//test/starlark_tests:common.bzl",
"common",
)
load(
"//apple:docc.bzl",
"docc_archive",
)
load(
"//apple:xcarchive.bzl",
"xcarchive",
Expand Down Expand Up @@ -647,15 +643,15 @@ ios_application(
"//test/starlark_tests/resources:swift_main_lib",
],
)

docc_archive(
name = "app_with_swift_dep.doccarchive",
dep = ":app_with_swift_dep",
fallback_bundle_identifier = "com.google.example",
fallback_bundle_version = "1.0.0",
fallback_display_name = "app_with_swift_dep",
tags = common.fixture_tags,
)
# TODO: enable once new rules_swift 2.0 symbol graph rule is supported
# docc_archive(
# name = "app_with_swift_dep.doccarchive",
# dep = ":app_with_swift_dep",
# fallback_bundle_identifier = "com.google.example",
# fallback_bundle_version = "1.0.0",
# fallback_display_name = "app_with_swift_dep",
# tags = common.fixture_tags,
# )

ios_static_framework(
name = "swift_static_framework",
Expand Down Expand Up @@ -4889,14 +4885,14 @@ objc_library(
data = ["//test/starlark_tests/resources:additional.txt"],
deps = [":basic_framework_lib_with_docc_bundle"],
)

docc_archive(
name = "basic_objc_lib_with_data_and_docc_bundle_dependency.doccarchive",
dep = ":basic_objc_lib_with_data_and_docc_bundle_dependency",
fallback_bundle_identifier = "com.google.example.objc.lib",
fallback_bundle_version = "1.0",
fallback_display_name = "BasicLib",
)
# TODO: enable once new rules_swift 2.0 symbol graph rule is supported
# docc_archive(
# name = "basic_objc_lib_with_data_and_docc_bundle_dependency.doccarchive",
# dep = ":basic_objc_lib_with_data_and_docc_bundle_dependency",
# fallback_bundle_identifier = "com.google.example.objc.lib",
# fallback_bundle_version = "1.0",
# fallback_display_name = "BasicLib",
# )

ios_dynamic_framework(
name = "basic_framework_with_docc_bundle",
Expand All @@ -4915,23 +4911,24 @@ ios_dynamic_framework(
":basic_framework_lib_with_docc_bundle",
],
)

docc_archive(
name = "basic_framework_with_docc_bundle.doccarchive",
dep = ":basic_framework_with_docc_bundle",
fallback_bundle_identifier = "com.google.example.framework",
fallback_bundle_version = "1.0",
fallback_display_name = "BasicFramework",
)

docc_archive(
name = "basic_framework_with_docc_bundle_custom_base_path.doccarchive",
dep = ":basic_framework_with_docc_bundle",
fallback_bundle_identifier = "com.google.example.framework",
fallback_bundle_version = "1.0",
fallback_display_name = "BasicFramework",
hosting_base_path = "custom/base/path",
)
# TODO: enable once new rules_swift 2.0 symbol graph rule is supported
# docc_archive(
# name = "basic_framework_with_docc_bundle.doccarchive",
# dep = ":basic_framework_with_docc_bundle",
# fallback_bundle_identifier = "com.google.example.framework",
# fallback_bundle_version = "1.0",
# fallback_display_name = "BasicFramework",
# )

# TODO: enable once new rules_swift 2.0 symbol graph rule is supported
# docc_archive(
# name = "basic_framework_with_docc_bundle_custom_base_path.doccarchive",
# dep = ":basic_framework_with_docc_bundle",
# fallback_bundle_identifier = "com.google.example.framework",
# fallback_bundle_version = "1.0",
# fallback_display_name = "BasicFramework",
# hosting_base_path = "custom/base/path",
# )

# ---------------------------------------------------------------------------------------
# Target for extension resource bundling.
Expand Down

0 comments on commit a8e21cd

Please sign in to comment.