This commit is contained in:
Isaac
2025-12-06 01:42:16 +08:00
parent 1ee7268488
commit dca1f06e91
5 changed files with 43 additions and 14 deletions

View File

@@ -18,10 +18,16 @@ class ProjectGenerator {
let modules = try loadModules(from: modulesPath.string)
print("Loaded \(modules.count) modules")
// Filter out empty modules
// Filter out empty modules, but keep:
// - Modules with source files (excluding .a)
// - Static library modules (only .a files)
// - XCFramework imports
let validModules = modules.filter { name, module in
let sources = module.sources.filter { !$0.hasSuffix(".a") }
return !sources.isEmpty || module.type == "apple_static_xcframework_import"
let nonStaticSources = module.sources.filter { !$0.hasSuffix(".a") }
let staticLibs = module.sources.filter { $0.hasSuffix(".a") }
return !nonStaticSources.isEmpty ||
!staticLibs.isEmpty ||
module.type == "apple_static_xcframework_import"
}
print("Processing \(validModules.count) non-empty modules")

View File

@@ -343,6 +343,8 @@ class TargetBuilder {
// Track all frameworks we've added to avoid duplicates
var linkedFrameworks: Set<String> = []
// Track library search paths for static libraries
var staticLibSearchPaths: Set<String> = []
// Add target dependency (only for direct deps)
for depName in deps {
@@ -375,18 +377,26 @@ class TargetBuilder {
// Link static libraries directly
for libPath in getStaticLibraries(for: depName) {
let libName = Path(libPath).lastComponent
// Use absolute path to the static library in bazel-out
let absolutePath = "$(SRCROOT)/../\(libPath)"
// Create an absolute path to the project root then to the static library
// SRCROOT is xcode-files, so we need to go up one level to get to telegram-ios
let projectRoot = outputDir.parent()
let absoluteLibPath = (projectRoot + libPath).string
let libRef = PBXFileReference(
sourceTree: .group,
sourceTree: .absolute,
name: libName,
lastKnownFileType: "archive.ar",
path: absolutePath
path: absoluteLibPath
)
pbxproj.add(object: libRef)
let buildFile = PBXBuildFile(file: libRef)
pbxproj.add(object: buildFile)
frameworksPhase.files?.append(buildFile)
// Add the library's directory to LIBRARY_SEARCH_PATHS
let libDir = Path(absoluteLibPath).parent().string
if !staticLibSearchPaths.contains(libDir) {
staticLibSearchPaths.insert(libDir)
}
}
linkedFrameworks.insert(depName)
continue
@@ -412,7 +422,7 @@ class TargetBuilder {
}
// Update build configurations with dependency paths
if !depHeaderPaths.isEmpty || !deps.isEmpty {
if !depHeaderPaths.isEmpty || !deps.isEmpty || !staticLibSearchPaths.isEmpty {
for config in target.buildConfigurationList?.buildConfigurations ?? [] {
// Add header search paths
if !depHeaderPaths.isEmpty {
@@ -422,6 +432,11 @@ class TargetBuilder {
// Ensure framework and module search paths include built products
config.buildSettings["FRAMEWORK_SEARCH_PATHS"] = "$(inherited) $(BUILT_PRODUCTS_DIR)"
config.buildSettings["SWIFT_INCLUDE_PATHS"] = "$(inherited) $(BUILT_PRODUCTS_DIR)"
// Add library search paths for static libraries
if !staticLibSearchPaths.isEmpty {
let existing = config.buildSettings["LIBRARY_SEARCH_PATHS"] as? String ?? "$(inherited)"
config.buildSettings["LIBRARY_SEARCH_PATHS"] = existing + " " + staticLibSearchPaths.sorted().joined(separator: " ")
}
}
}

View File

@@ -137,7 +137,7 @@ public final class ChatSearchNavigationContentNode: NavigationBarContentNode {
}
override public var nominalHeight: CGFloat {
return 54.0
return 60.0
}
@objc private func onCloseTapGesture(_ recognizer: UITapGestureRecognizer) {

View File

@@ -111,6 +111,11 @@ public final class HeaderPanelContainerComponent: Component {
}
func update(component: HeaderPanelContainerComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment<Empty>, transition: ComponentTransition) -> CGSize {
var isAnimatingReplacement = false
if let previousComponent = self.component {
isAnimatingReplacement = !component.panels.contains(where: { panel in previousComponent.panels.contains(where: { $0.key == panel.key }) })
}
self.component = component
self.state = state
@@ -183,7 +188,11 @@ public final class HeaderPanelContainerComponent: Component {
panelView.addSubview(panelComponentView)
transition.animateAlpha(view: panelView, from: 0.0, to: 1.0)
panelView.separator.opacity = 0.0
panelView.frame = CGRect(origin: panelFrame.origin, size: CGSize(width: panelFrame.width, height: 0.0))
if isAnimatingReplacement {
panelView.frame = panelFrame
} else {
panelView.frame = CGRect(origin: panelFrame.origin, size: CGSize(width: panelFrame.width, height: 0.0))
}
}
panelView.separator.backgroundColor = component.theme.list.itemPlainSeparatorColor.cgColor
@@ -209,7 +218,9 @@ public final class HeaderPanelContainerComponent: Component {
transition.setAlpha(layer: separator, alpha: 0.0, completion: { [weak separator] _ in
separator?.removeFromSuperlayer()
})
transition.setFrame(view: panelView, frame: CGRect(origin: panelView.frame.origin, size: CGSize(width: panelView.bounds.width, height: 0.0)))
if !isAnimatingReplacement {
transition.setFrame(view: panelView, frame: CGRect(origin: panelView.frame.origin, size: CGSize(width: panelView.bounds.width, height: 0.0)))
}
}
}
for key in removedPanelKeys {

View File

@@ -124,7 +124,6 @@ public final class ThemeGridController: ViewController {
self.statusBar.statusBarStyle = self.presentationData.theme.rootController.statusBarStyle.style
self.navigationBar?.updatePresentationData(NavigationBarPresentationData(presentationData: self.presentationData), transition: .immediate)
self.searchContentNode?.updateThemeAndPlaceholder(theme: self.presentationData.theme, placeholder: self.presentationData.strings.Wallpaper_Search)
if self.isNodeLoaded {
self.controllerNode.updatePresentationData(self.presentationData)
@@ -476,7 +475,6 @@ public final class ThemeGridController: ViewController {
@objc func editPressed() {
self.editingMode = true
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Done, style: .done, target: self, action: #selector(self.donePressed))
self.searchContentNode?.setIsEnabled(false, animated: true)
self.controllerNode.updateState { state in
var state = state
state.editing = true
@@ -487,7 +485,6 @@ public final class ThemeGridController: ViewController {
@objc func donePressed() {
self.editingMode = false
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Edit, style: .plain, target: self, action: #selector(self.editPressed))
self.searchContentNode?.setIsEnabled(true, animated: true)
self.controllerNode.updateState { state in
var state = state
state.editing = false