@@ -651,7 +651,8 @@ def __init__(self):
651
651
self .subresults = {value : [] for value in ResultEnum .values }
652
652
653
653
def add (self , result ):
654
- self .subresults [result .result ].append (result )
654
+ if result :
655
+ self .subresults [result .result ].append (result )
655
656
656
657
def xfails (self ):
657
658
return self .subresults [Result .XFAIL ]
@@ -988,6 +989,7 @@ def __init__(self,
988
989
added_xcodebuild_flags ,
989
990
skip_clean , build_config ,
990
991
strip_resource_phases ,
992
+ only_latest_versions ,
991
993
action , version , project ):
992
994
super (CompatActionBuilder , self ).__init__ (
993
995
swiftc , swift_version , swift_branch ,
@@ -999,9 +1001,17 @@ def __init__(self,
999
1001
strip_resource_phases ,
1000
1002
action , project
1001
1003
)
1004
+ self .only_latest_versions = only_latest_versions
1002
1005
self .version = version
1003
1006
1004
1007
def dispatch (self , identifier , stdout = sys .stdout , stderr = sys .stderr ):
1008
+ if self .only_latest_versions :
1009
+ if self .version ['version' ] != \
1010
+ sorted (self .project ['compatibility' ],
1011
+ reverse = True ,
1012
+ key = lambda x : [float (y ) for y in x ['version' ].split ('.' )])[0 ]['version' ]:
1013
+ return None
1014
+
1005
1015
if not self .swift_version :
1006
1016
self .swift_version = self .version ['version' ].split ('.' )[0 ]
1007
1017
try :
0 commit comments