mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Resolve Swiftgram build variables
This commit is contained in:
parent
31d160fc23
commit
b7cbb997bd
@ -52,7 +52,8 @@ def generate_xcodeproj(build_environment: BuildEnvironment, disable_extensions,
|
|||||||
file.write('build ' + argument + '\n')
|
file.write('build ' + argument + '\n')
|
||||||
|
|
||||||
call_executable(bazel_generate_arguments)
|
call_executable(bazel_generate_arguments)
|
||||||
|
if app_target_spec == "Telegram:Telegram": # MARK: Swiftgram
|
||||||
|
app_target_spec = "Telegram/Swiftgram"
|
||||||
xcodeproj_path = '{}.xcodeproj'.format(app_target_spec.replace(':', '/'))
|
xcodeproj_path = '{}.xcodeproj'.format(app_target_spec.replace(':', '/'))
|
||||||
return xcodeproj_path
|
return xcodeproj_path
|
||||||
|
|
||||||
|
@ -79,12 +79,22 @@ struct XcodeParse: ParsableCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var rawVariables: [String: String] = [:]
|
var rawVariables: [String: String] = [:]
|
||||||
let requiredBuildSettings: [String] = ["SRCROOT", "PROJECT_DIR", "BAZEL_OUT"]
|
let requiredBuildSettings: [String] = ["SRCROOT", "PROJECT_DIR", "BAZEL_OUT", /* MARK: Swifgram */ "BAZEL_EXTERNAL", "BAZEL_OUTPUT_BASE", "_BAZEL_OUTPUT_BASE:standardizepath" ]
|
||||||
for buildConfiguration in xcodeproj.pbxproj.buildConfigurations {
|
for buildConfiguration in xcodeproj.pbxproj.buildConfigurations {
|
||||||
if buildConfiguration.name == "Debug" {
|
if buildConfiguration.name == "Debug" {
|
||||||
for name in requiredBuildSettings {
|
for setting in requiredBuildSettings {
|
||||||
|
let components = setting.split(separator: ":", maxSplits: 1, omittingEmptySubsequences: false)
|
||||||
|
let name = String(components[0])
|
||||||
|
let modifier = components.count > 1 ? String(components[1]) : nil
|
||||||
|
|
||||||
if let value = buildConfiguration.buildSettings[name]?.stringValue {
|
if let value = buildConfiguration.buildSettings[name]?.stringValue {
|
||||||
rawVariables[name] = value
|
var finalValue = value
|
||||||
|
|
||||||
|
if modifier == "standardizepath" {
|
||||||
|
finalValue = (value as NSString).standardizingPath
|
||||||
|
}
|
||||||
|
|
||||||
|
rawVariables[setting] = finalValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user