Add support for older macOS versions

This commit is contained in:
david-swift 2024-02-27 06:24:48 +01:00
parent c825ccebb9
commit 7d80bb7da7
3 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ import PackageDescription
let package = Package( let package = Package(
name: "Adwaita", name: "Adwaita",
platforms: [ platforms: [
.macOS(.v13) .macOS(.v10_15)
], ],
products: [ products: [
.library( .library(

View File

@ -74,7 +74,7 @@ struct Class: ClassLike, Decodable {
// \(widgetName).swift // \(widgetName).swift
// Adwaita // Adwaita
// //
// Created by auto-generation on \(dateFormatter.string(from: .now)). // Created by auto-generation on \(dateFormatter.string(from: .init())).
// //
import CAdw import CAdw

View File

@ -74,7 +74,7 @@ struct Generation {
func getGtkDefinitions(path: String) -> GIR? { func getGtkDefinitions(path: String) -> GIR? {
var path = path var path = path
let girDir = getGtkGirDir() let girDir = getGtkGirDir()
path.replace(GenerationConfiguration.gtkIncludeDir, with: girDir) path = path.replacingOccurrences(of: GenerationConfiguration.gtkIncludeDir, with: girDir)
let data = (try? Data(contentsOf: .init(fileURLWithPath: path))) ?? .init() let data = (try? Data(contentsOf: .init(fileURLWithPath: path))) ?? .init()
return try? GIR.decodeGIR(data) return try? GIR.decodeGIR(data)
} }
@ -85,7 +85,7 @@ struct Generation {
func getAdwDefinitions(path: String) -> GIR? { func getAdwDefinitions(path: String) -> GIR? {
var path = path var path = path
let girDir = getAdwGirDir() let girDir = getAdwGirDir()
path.replace(GenerationConfiguration.adwIncludeDir, with: girDir) path = path.replacingOccurrences(of: GenerationConfiguration.adwIncludeDir, with: girDir)
let data = (try? Data(contentsOf: .init(fileURLWithPath: path))) ?? .init() let data = (try? Data(contentsOf: .init(fileURLWithPath: path))) ?? .init()
return try? GIR.decodeGIR(data) return try? GIR.decodeGIR(data)
} }