Run the xcodebuild command only we actually use iOSTargetInfo.

This commit is contained in:
Matthieu Gautier 2018-04-17 17:40:11 +02:00
parent 72d9e99bf9
commit 9acd6b3447
1 changed files with 8 additions and 2 deletions

View File

@ -238,8 +238,14 @@ class iOSTargetInfo(TargetInfo):
hosts=['Darwin'])
self.arch = arch
self.arch_full, self.cpu, self.sdk_name = self.__arch_infos[arch]
command = "xcodebuild -version -sdk {} | grep -E '^Path' | sed 's/Path: //'".format(self.sdk_name)
self.root_path = subprocess.check_output(command, shell=True)[:-1].decode()
self._root_path = None
@property
def root_path(self):
if self._root_path is None:
command = "xcodebuild -version -sdk {} | grep -E '^Path' | sed 's/Path: //'".format(self.sdk_name)
self._root_path = subprocess.check_output(command, shell=True)[:-1].decode()
return self._root_path
def __str__(self):
return "iOS"