diff --git a/.gitignore b/.gitignore index 7188982c46..c13cc028ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ submodules/**/.build/* swiftgram-scripts Swiftgram/Playground/custom_bazel_path.bzl +Swiftgram/Playground/codesigning buildServer.json fastlane/README.md diff --git a/Swiftgram/Playground/BUILD b/Swiftgram/Playground/BUILD index 181edbce77..f860378633 100644 --- a/Swiftgram/Playground/BUILD +++ b/Swiftgram/Playground/BUILD @@ -1,14 +1,30 @@ +load("@bazel_skylib//rules:common_settings.bzl", + "bool_flag", +) load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application") load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") load( "@rules_xcodeproj//xcodeproj:defs.bzl", - "top_level_target", + "top_level_targets", "xcodeproj", ) load( "@build_configuration//:variables.bzl", "telegram_bazel_path" ) +bool_flag( + name = "disableProvisioningProfiles", + build_setting_default = False, + visibility = ["//visibility:public"], +) + +config_setting( + name = "disableProvisioningProfilesSetting", + flag_values = { + ":disableProvisioningProfiles": "True", + }, +) + objc_library( name = "PlaygroundMain", srcs = [ @@ -37,11 +53,15 @@ swift_library( ios_application( name = "Playground", - bundle_id = "app.swiftgram.playground", + bundle_id = "app.swiftgram.ios.Playground", families = [ "iphone", "ipad", ], + provisioning_profile = select({ + ":disableProvisioningProfilesSetting": None, + "//conditions:default": "codesigning/Playground.mobileprovision", + }), infoplists = ["Resources/Info.plist"], minimum_os_version = "14.0", visibility = ["//visibility:public"], @@ -58,7 +78,10 @@ xcodeproj( build_mode = "bazel", project_name = "Playground", tags = ["manual"], - top_level_targets = [ - ":Playground", - ], + top_level_targets = top_level_targets( + labels = [ + ":Playground", + ], + target_environments = ["device", "simulator"], + ), ) \ No newline at end of file diff --git a/Swiftgram/Playground/README.md b/Swiftgram/Playground/README.md index cdb7a64699..221a308b19 100644 --- a/Swiftgram/Playground/README.md +++ b/Swiftgram/Playground/README.md @@ -2,6 +2,10 @@ Small app to quickly iterate on components testing without building an entire messenger. +## (Optional) Setup Codesigning + +Create simple `codesigning/Playground.mobileprovision`. It is only required for non-simulator builds and can be skipped with `--disableProvisioningProfiles`. + ## Generate Xcode project Same as main project described in [../../Readme.md](../../Readme.md), but with `--target="Swiftgram/Playground"` parameter.