mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
check to see if the xcode eula has been signed
This commit is contained in:
parent
4ec9608472
commit
16f9e38769
@ -28,15 +28,7 @@ class IOSWorkflow extends Workflow {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Function _xcodeExists = () {
|
Function _xcodeExists = () {
|
||||||
if (xcode.isInstalledAndMeetsVersionCheck) {
|
return xcode.isInstalled ? ValidationType.installed : ValidationType.missing;
|
||||||
return ValidationType.installed;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (xcode.isInstalled) {
|
|
||||||
return ValidationType.partial;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ValidationType.missing;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Function _xcodeVersionSatisfactory = () {
|
Function _xcodeVersionSatisfactory = () {
|
||||||
@ -47,6 +39,10 @@ class IOSWorkflow extends Workflow {
|
|||||||
return ValidationType.missing;
|
return ValidationType.missing;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Function _xcodeEulaSigned = () {
|
||||||
|
return xcode.eulaSigned ? ValidationType.installed : ValidationType.missing;
|
||||||
|
};
|
||||||
|
|
||||||
Function _brewExists = () {
|
Function _brewExists = () {
|
||||||
return exitsHappy(<String>['brew', '-v'])
|
return exitsHappy(<String>['brew', '-v'])
|
||||||
? ValidationType.installed : ValidationType.missing;
|
? ValidationType.installed : ValidationType.missing;
|
||||||
@ -71,12 +67,19 @@ class IOSWorkflow extends Workflow {
|
|||||||
iosValidator.addValidator(xcodeValidator);
|
iosValidator.addValidator(xcodeValidator);
|
||||||
|
|
||||||
xcodeValidator.addValidator(new Validator(
|
xcodeValidator.addValidator(new Validator(
|
||||||
'Version Check',
|
'version',
|
||||||
description: 'Xcode version is at least $kXcodeRequiredVersionMajor.$kXcodeRequiredVersionMinor',
|
description: 'Xcode minimum version of $kXcodeRequiredVersionMajor.$kXcodeRequiredVersionMinor.0',
|
||||||
resolution: 'Download the latest version or update via the Mac App Store',
|
resolution: 'Download the latest version or update via the Mac App Store',
|
||||||
validatorFunction: _xcodeVersionSatisfactory
|
validatorFunction: _xcodeVersionSatisfactory
|
||||||
));
|
));
|
||||||
|
|
||||||
|
xcodeValidator.addValidator(new Validator(
|
||||||
|
'EULA',
|
||||||
|
description: 'XCode end user license agreement',
|
||||||
|
resolution: "Open XCode or run the command 'sudo xcodebuild -license'",
|
||||||
|
validatorFunction: _xcodeEulaSigned
|
||||||
|
));
|
||||||
|
|
||||||
Validator brewValidator = new Validator(
|
Validator brewValidator = new Validator(
|
||||||
'brew',
|
'brew',
|
||||||
description: 'install additional development packages',
|
description: 'install additional development packages',
|
||||||
|
@ -40,6 +40,23 @@ class XCode {
|
|||||||
return _isInstalled;
|
return _isInstalled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Has the EULA been signed?
|
||||||
|
bool get eulaSigned {
|
||||||
|
if (!isInstalled)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
ProcessResult result = Process.runSync('/usr/bin/xcrun', <String>['clang']);
|
||||||
|
if (result.stdout != null && result.stdout.contains('license'))
|
||||||
|
return false;
|
||||||
|
if (result.stderr != null && result.stderr.contains('license'))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool _xcodeVersionSatisfactory;
|
bool _xcodeVersionSatisfactory;
|
||||||
bool get xcodeVersionSatisfactory {
|
bool get xcodeVersionSatisfactory {
|
||||||
if (_xcodeVersionSatisfactory != null) {
|
if (_xcodeVersionSatisfactory != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user