@@ -439,6 +439,10 @@ def add_arguments(parser):
439
439
metavar = "FLAGS" ,
440
440
help = 'add flags to each Swift invocation' ,
441
441
default = '' )
442
+ parser .add_argument ("--skip-clean" ,
443
+ help = 'skip all git and build clean steps before '
444
+ 'building projects' ,
445
+ action = 'store_true' )
442
446
443
447
444
448
def add_minimal_arguments (parser ):
@@ -740,6 +744,7 @@ def __init__(self, swiftc, swift_version, swift_branch,
740
744
sandbox_profile_xcodebuild ,
741
745
sandbox_profile_package ,
742
746
added_swift_flags ,
747
+ skip_clean ,
743
748
project , action ):
744
749
self .swiftc = swiftc
745
750
self .swift_version = swift_version
@@ -752,6 +757,7 @@ def __init__(self, swiftc, swift_version, swift_branch,
752
757
self .root_path = common .private_workspace ('project_cache' )
753
758
self .current_platform = platform .system ()
754
759
self .added_swift_flags = added_swift_flags
760
+ self .skip_clean = skip_clean
755
761
self .init ()
756
762
757
763
def init (self ):
@@ -781,10 +787,13 @@ def checkout(self, ref, ref_is_sha, pull_after_update,
781
787
if os .path .exists (path ):
782
788
if ref_is_sha :
783
789
common .git_update (self .project ['url' ], ref , path ,
790
+ incremental = self .skip_clean ,
784
791
stdout = stdout , stderr = stderr )
785
792
else :
786
- common .git_clean (path , stdout = stdout , stderr = stderr )
793
+ if not self .skip_clean :
794
+ common .git_clean (path , stdout = stdout , stderr = stderr )
787
795
common .git_checkout (ref , path ,
796
+ force = True ,
788
797
stdout = stdout , stderr = stderr )
789
798
if pull_after_update :
790
799
common .git_pull (path , stdout = stdout , stderr = stderr )
@@ -803,6 +812,7 @@ def dispatch(self, identifier, stdout=sys.stdout, stderr=sys.stderr):
803
812
self .sandbox_profile_xcodebuild ,
804
813
self .sandbox_profile_package ,
805
814
self .added_swift_flags ,
815
+ incremental = self .skip_clean ,
806
816
stdout = stdout , stderr = stderr )
807
817
except common .ExecuteCommandFailure as error :
808
818
return self .failed (identifier , error )
@@ -840,6 +850,7 @@ def dispatch(self, identifier, stdout=sys.stdout, stderr=sys.stderr):
840
850
self .sandbox_profile_xcodebuild ,
841
851
self .sandbox_profile_package ,
842
852
self .added_swift_flags ,
853
+ incremental = self .skip_clean ,
843
854
should_strip_resource_phases = True ,
844
855
stdout = stdout , stderr = stderr )
845
856
except common .ExecuteCommandFailure as error :
0 commit comments