Enable HAVE_AVFOUNDATION_VIDEO_OUTPUT on PLATFORM(IOSMAC)
[WebKit-https.git] / Tools / BuildSlaveSupport / delete-stale-build-files
index 8933d3b..3745c68 100755 (executable)
@@ -1,5 +1,5 @@
-#!/usr/bin/python
-# Copyright (C) 2013 Apple Inc.  All rights reserved.
+#!/usr/bin/env python
+# Copyright (C) 2013, 2015 Apple Inc.  All rights reserved.
 # Copyright (C) 2012 Google Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -45,14 +45,14 @@ def main():
         return -2
 
     genericPlatform = options.platform.split('-', 1)[0]
-    if genericPlatform != 'mac':
+    if genericPlatform not in ('mac', 'ios'):
         print 'Exited without removing any files.'
         return 0
 
     if options.build_directory:
         buildDirectory = options.build_directory
     else:
-        buildDirectory = webkitBuildDirectory(genericPlatform, options.configuration)
+        buildDirectory = webkitBuildDirectory(genericPlatform, options.platform, options.configuration)
 
     exit_code = 0
 
@@ -62,7 +62,7 @@ def main():
             ext = os.path.splitext(full_path)[1]
 
             try:
-                if ext not in ('.o',) or os.path.getsize(full_path):
+                if ext not in ('.o', '.d') or os.path.getsize(full_path):
                     continue
             except OSError as exception:
                 print exception
@@ -78,7 +78,11 @@ def main():
     return exit_code
 
 
-def webkitBuildDirectory(platform, configuration):
+def webkitBuildDirectory(platform, fullPlatform, configuration):
+    if fullPlatform.startswith('ios-simulator'):
+        platform = 'ios-simulator'
+    elif platform == 'ios':
+        platform = 'device'
     return subprocess.Popen(['perl', os.path.join(os.path.dirname(__file__), "..", "Scripts", "webkit-build-directory"),
         "--" + platform, "--" + configuration, '--top-level'], stdout=subprocess.PIPE).communicate()[0].strip()