public static void OnPostProcessInstallPods(BuildTarget buildTarget,
string pathToBuiltProject) {
if (!InjectDependencies()) return;
if (UpdateTargetSdk()) return;
string pod_command = FindPodTool();
if (String.IsNullOrEmpty(pod_command)) {
Log("'pod' command not found; unable to generate a usable" +
" Xcode project. " + COCOAPOD_INSTALL_INSTRUCTIONS,
level: LogLevel.Error);
return;
}
// Require at least version 1.0.0
CommandLine.Result result =
CommandLine.Run(pod_command, "--version", pathToBuiltProject);
if (result.exitCode != 0 || result.stdout[0] == '0') {
Log("Error running cocoapods. Please ensure you have at least " +
"version 1.0.0. " + COCOAPOD_INSTALL_INSTRUCTIONS,
level: LogLevel.Error);
return;
}
result = CommandLine.Run(
pod_command, "install", pathToBuiltProject,
// cocoapods seems to require this, or it spits out a warning.
envVars: new Dictionary<string,string>() {
{"LANG", (System.Environment.GetEnvironmentVariable("LANG") ??
"en_US.UTF-8").Split('.')[0] + ".UTF-8"}
});
if (result.exitCode != 0) {
Log("Pod install failed. See the output below for " +
"details.\n\n" + result.stdout + "\n\n" +
result.stderr, level: LogLevel.Error);
return;
}
}