15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# Copyright 2014 The Chromium Authors. All rights reserved. 25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# Use of this source code is governed by a BSD-style license that can be 35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# found in the LICENSE file. 45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 55d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)import subprocess 65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)import sys 75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# This script returns the path to the SDK of the given type. Pass the type of 95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# SDK you want, which is typically "iphone" or "iphonesimulator". 105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# 115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# In the GYP build, this is done inside GYP itself based on the SDKROOT 125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# variable. 135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)if len(sys.argv) != 2: 155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) print "Takes one arg (SDK to find)" 165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) sys.exit(1) 175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)print subprocess.check_output(['xcodebuild', '-version', '-sdk', 195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) sys.argv[1], 'Path']).strip() 20