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 ("""
@@ -1011,6 +1031,11 @@ reproducible error case.".format(
10111031
10121032def _watchos_extension_impl (ctx ):
10131033 """Implementation of watchos_extension."""
1034+ required_minimum_os .validate (
1035+ minimum_os_version = ctx .attr .minimum_os_version ,
1036+ platform_type = ctx .attr .platform_type ,
1037+ rule_label = ctx .label ,
1038+ )
10141039
10151040 # TODO(b/155313625): Set the product type as apple_product_type.extension if the attrs set on
10161041 # the rule match a criteria appropriate for watchOS extensions (i.e. SiriKit, Notification
@@ -1332,6 +1357,12 @@ def _watchos_extension_impl(ctx):
13321357
13331358def _watchos_static_framework_impl (ctx ):
13341359 """Implementation of watchos_static_framework."""
1360+ required_minimum_os .validate (
1361+ minimum_os_version = ctx .attr .minimum_os_version ,
1362+ platform_type = ctx .attr .platform_type ,
1363+ rule_label = ctx .label ,
1364+ )
1365+
13351366 rule_descriptor = rule_support .rule_descriptor (
13361367 platform_type = ctx .attr .platform_type ,
13371368 product_type = apple_product_type .static_framework ,
@@ -1489,7 +1520,6 @@ def _watchos_static_framework_impl(ctx):
14891520
14901521def _watchos_single_target_application_impl (ctx ):
14911522 """Implementation of watchos_application for single target watch applications."""
1492-
14931523 minimum_os = apple_common .dotted_version (ctx .attr .minimum_os_version )
14941524 if minimum_os < apple_common .dotted_version ("7.0" ):
14951525 fail ("Single-target watchOS applications require a minimum_os_version of 7.0 or greater." )
0 commit comments