Resolve Swiftgram build variables

This commit is contained in:
Kylmakalle 2025-05-01 22:23:30 +03:00
parent 5e43306965
commit 0b62196e78
2 changed files with 15 additions and 4 deletions

View File

@ -52,7 +52,8 @@ def generate_xcodeproj(build_environment: BuildEnvironment, disable_extensions,
file.write('build ' + argument + '\n')
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(':', '/'))
return xcodeproj_path

View File

@ -79,12 +79,22 @@ struct XcodeParse: ParsableCommand {
}
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 {
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 {
rawVariables[name] = value
var finalValue = value
if modifier == "standardizepath" {
finalValue = (value as NSString).standardizingPath
}
rawVariables[setting] = finalValue
}
}
}