9797 "new_watchosapplicationbundleinfo" ,
9898 "new_watchosextensionbundleinfo" ,
9999)
100+ load (
101+ "//apple/internal:required_minimum_os.bzl" ,
102+ "required_minimum_os" ,
103+ )
100104load (
101105 "//apple/internal:resources.bzl" ,
102106 "resources" ,
@@ -149,6 +153,12 @@ load(
149153
150154def _watchos_framework_impl (ctx ):
151155 """Experimental implementation of watchos_framework."""
156+ required_minimum_os .validate (
157+ minimum_os_version = ctx .attr .minimum_os_version ,
158+ platform_type = ctx .attr .platform_type ,
159+ rule_label = ctx .label ,
160+ )
161+
152162 rule_descriptor = rule_support .rule_descriptor (
153163 platform_type = ctx .attr .platform_type ,
154164 product_type = apple_product_type .framework ,
@@ -404,6 +414,12 @@ def _watchos_framework_impl(ctx):
404414
405415def _watchos_dynamic_framework_impl (ctx ):
406416 """Experimental implementation of watchos_dynamic_framework."""
417+ required_minimum_os .validate (
418+ minimum_os_version = ctx .attr .minimum_os_version ,
419+ platform_type = ctx .attr .platform_type ,
420+ rule_label = ctx .label ,
421+ )
422+
407423 rule_descriptor = rule_support .rule_descriptor (
408424 platform_type = ctx .attr .platform_type ,
409425 product_type = apple_product_type .framework ,
@@ -707,6 +723,11 @@ def _watchos_dynamic_framework_impl(ctx):
707723
708724def _watchos_application_impl (ctx ):
709725 """Implementation of watchos_application."""
726+ required_minimum_os .validate (
727+ minimum_os_version = ctx .attr .minimum_os_version ,
728+ platform_type = ctx .attr .platform_type ,
729+ rule_label = ctx .label ,
730+ )
710731
711732 if ctx .attr .deps :
712733 return _watchos_single_target_application_impl (ctx )
@@ -715,7 +736,6 @@ def _watchos_application_impl(ctx):
715736
716737def _watchos_extension_based_application_impl (ctx ):
717738 """Implementation of watchos_application for watchOS 2 extension-based application bundles."""
718-
719739 minimum_os = apple_common .dotted_version (ctx .attr .minimum_os_version )
720740 if minimum_os >= apple_common .dotted_version ("9.0" ):
721741 fail ("""
@@ -1008,6 +1028,11 @@ reproducible error case.".format(
10081028
10091029def _watchos_extension_impl (ctx ):
10101030 """Implementation of watchos_extension."""
1031+ required_minimum_os .validate (
1032+ minimum_os_version = ctx .attr .minimum_os_version ,
1033+ platform_type = ctx .attr .platform_type ,
1034+ rule_label = ctx .label ,
1035+ )
10111036
10121037 # TODO(b/155313625): Set the product type as apple_product_type.extension if the attrs set on
10131038 # the rule match a criteria appropriate for watchOS extensions (i.e. SiriKit, Notification
@@ -1326,6 +1351,12 @@ def _watchos_extension_impl(ctx):
13261351
13271352def _watchos_static_framework_impl (ctx ):
13281353 """Implementation of watchos_static_framework."""
1354+ required_minimum_os .validate (
1355+ minimum_os_version = ctx .attr .minimum_os_version ,
1356+ platform_type = ctx .attr .platform_type ,
1357+ rule_label = ctx .label ,
1358+ )
1359+
13291360 rule_descriptor = rule_support .rule_descriptor (
13301361 platform_type = ctx .attr .platform_type ,
13311362 product_type = apple_product_type .static_framework ,
@@ -1483,7 +1514,6 @@ def _watchos_static_framework_impl(ctx):
14831514
14841515def _watchos_single_target_application_impl (ctx ):
14851516 """Implementation of watchos_application for single target watch applications."""
1486-
14871517 minimum_os = apple_common .dotted_version (ctx .attr .minimum_os_version )
14881518 if minimum_os < apple_common .dotted_version ("7.0" ):
14891519 fail ("Single-target watchOS applications require a minimum_os_version of 7.0 or greater." )
0 commit comments