mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
macos flatc
This commit is contained in:
parent
ca437201b7
commit
433c5ecc5c
2
.gitignore
vendored
2
.gitignore
vendored
@ -68,4 +68,4 @@ build-input/*
|
|||||||
submodules/OpusBinding/SharedHeaders/*
|
submodules/OpusBinding/SharedHeaders/*
|
||||||
submodules/FFMpegBinding/SharedHeaders/*
|
submodules/FFMpegBinding/SharedHeaders/*
|
||||||
submodules/OpenSSLEncryptionProvider/SharedHeaders/*
|
submodules/OpenSSLEncryptionProvider/SharedHeaders/*
|
||||||
|
submodules/TelegramCore/FlatSerialization/Sources/*
|
||||||
|
27
submodules/TelegramCore/FlatBuffers/Package.swift
Normal file
27
submodules/TelegramCore/FlatBuffers/Package.swift
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// swift-tools-version:5.5
|
||||||
|
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||||
|
|
||||||
|
import PackageDescription
|
||||||
|
|
||||||
|
let package = Package(
|
||||||
|
name: "FlatBuffers",
|
||||||
|
platforms: [.macOS(.v10_13)],
|
||||||
|
products: [
|
||||||
|
// Products define the executables and libraries a package produces, and make them visible to other packages.
|
||||||
|
.library(
|
||||||
|
name: "FlatBuffers",
|
||||||
|
targets: ["FlatBuffers"]),
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
// Dependencies declare other packages that this package depends on.
|
||||||
|
// .package(url: /* package url */, from: "1.0.0"),
|
||||||
|
],
|
||||||
|
targets: [
|
||||||
|
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
|
||||||
|
// Targets can depend on other targets in this package, and on products in packages this package depends on.
|
||||||
|
.target(
|
||||||
|
name: "FlatBuffers",
|
||||||
|
dependencies: [],
|
||||||
|
path: "Sources"),
|
||||||
|
]
|
||||||
|
)
|
30
submodules/TelegramCore/FlatSerialization/Package.swift
Normal file
30
submodules/TelegramCore/FlatSerialization/Package.swift
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// swift-tools-version:5.5
|
||||||
|
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||||
|
|
||||||
|
import PackageDescription
|
||||||
|
|
||||||
|
let package = Package(
|
||||||
|
name: "FlatSerialization",
|
||||||
|
platforms: [.macOS(.v10_13)],
|
||||||
|
products: [
|
||||||
|
// Products define the executables and libraries a package produces, and make them visible to other packages.
|
||||||
|
.library(
|
||||||
|
name: "FlatSerialization",
|
||||||
|
targets: ["FlatSerialization"]),
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
// Dependencies declare other packages that this package depends on.
|
||||||
|
// .package(url: /* package url */, from: "1.0.0"),
|
||||||
|
.package(name: "FlatBuffers", path: "../FlatBuffers")
|
||||||
|
],
|
||||||
|
targets: [
|
||||||
|
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
|
||||||
|
// Targets can depend on other targets in this package, and on products in packages this package depends on.
|
||||||
|
.target(
|
||||||
|
name: "FlatSerialization",
|
||||||
|
dependencies: [
|
||||||
|
.product(name: "FlatBuffers", package: "FlatBuffers", condition: nil),
|
||||||
|
],
|
||||||
|
path: "Sources"),
|
||||||
|
]
|
||||||
|
)
|
@ -3,10 +3,15 @@
|
|||||||
# Default directories
|
# Default directories
|
||||||
OUTPUT_DIR=""
|
OUTPUT_DIR=""
|
||||||
INPUT_DIR=""
|
INPUT_DIR=""
|
||||||
|
BINARY_PATH=""
|
||||||
|
|
||||||
# Parse command line arguments
|
# Parse command line arguments
|
||||||
while [ "$#" -gt 0 ]; do
|
while [ "$#" -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
--binary)
|
||||||
|
BINARY_PATH="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
--output)
|
--output)
|
||||||
OUTPUT_DIR="$2"
|
OUTPUT_DIR="$2"
|
||||||
shift 2
|
shift 2
|
||||||
@ -28,6 +33,12 @@ if [ -z "$OUTPUT_DIR" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Validate output directory
|
||||||
|
if [ -z "$BINARY_PATH" ]; then
|
||||||
|
echo "Error: --binary argument is required"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -d "$OUTPUT_DIR" ]; then
|
if [ ! -d "$OUTPUT_DIR" ]; then
|
||||||
echo "Error: Output directory does not exist: $OUTPUT_DIR"
|
echo "Error: Output directory does not exist: $OUTPUT_DIR"
|
||||||
exit 1
|
exit 1
|
||||||
@ -58,4 +69,4 @@ for model in $models; do
|
|||||||
flatc_input="$flatc_input $model"
|
flatc_input="$flatc_input $model"
|
||||||
done
|
done
|
||||||
|
|
||||||
flatc --require-explicit-ids --swift -o "$OUTPUT_DIR" ${flatc_input}
|
$BINARY_PATH --require-explicit-ids --swift -o "$OUTPUT_DIR" ${flatc_input}
|
||||||
|
@ -15,6 +15,8 @@ let package = Package(
|
|||||||
dependencies: [
|
dependencies: [
|
||||||
// Dependencies declare other packages that this package depends on.
|
// Dependencies declare other packages that this package depends on.
|
||||||
// .package(url: /* package url */, from: "1.0.0"),
|
// .package(url: /* package url */, from: "1.0.0"),
|
||||||
|
.package(name: "FlatBuffers", path: "./FlatBuffers"),
|
||||||
|
.package(name: "FlatSerialization", path: "./FlatSerialization"),
|
||||||
.package(name: "Postbox", path: "../Postbox"),
|
.package(name: "Postbox", path: "../Postbox"),
|
||||||
.package(name: "SSignalKit", path: "../SSignalKit"),
|
.package(name: "SSignalKit", path: "../SSignalKit"),
|
||||||
.package(name: "MtProtoKit", path: "../MtProtoKit"),
|
.package(name: "MtProtoKit", path: "../MtProtoKit"),
|
||||||
@ -40,6 +42,8 @@ let package = Package(
|
|||||||
.product(name: "DarwinDirStat", package: "DarwinDirStat", condition: nil),
|
.product(name: "DarwinDirStat", package: "DarwinDirStat", condition: nil),
|
||||||
.product(name: "Reachability", package: "Reachability", condition: nil),
|
.product(name: "Reachability", package: "Reachability", condition: nil),
|
||||||
.product(name: "Emoji", package: "Emoji", condition: nil),
|
.product(name: "Emoji", package: "Emoji", condition: nil),
|
||||||
|
.product(name: "FlatBuffers", package: "FlatBuffers", condition: nil),
|
||||||
|
.product(name: "FlatSerialization", package: "FlatSerialization", condition: nil),
|
||||||
.product(name: "EncryptionProvider", package: "EncryptionProvider", condition: nil)],
|
.product(name: "EncryptionProvider", package: "EncryptionProvider", condition: nil)],
|
||||||
path: "Sources"),
|
path: "Sources"),
|
||||||
]
|
]
|
||||||
|
28
third-party/flatc/Package.swift
vendored
Normal file
28
third-party/flatc/Package.swift
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// swift-tools-version:5.5
|
||||||
|
import PackageDescription
|
||||||
|
|
||||||
|
let package = Package(
|
||||||
|
name: "FlatBuffersBuilder",
|
||||||
|
platforms: [
|
||||||
|
.macOS(.v12)
|
||||||
|
],
|
||||||
|
products: [
|
||||||
|
.plugin(
|
||||||
|
name: "FlatBuffersPlugin",
|
||||||
|
targets: ["FlatBuffersPlugin"]
|
||||||
|
)
|
||||||
|
],
|
||||||
|
dependencies: [],
|
||||||
|
targets: [
|
||||||
|
.binaryTarget(
|
||||||
|
name: "flatc",
|
||||||
|
url: "https://github.com/google/flatbuffers/releases/download/v23.5.26/Mac.flatc.binary.zip",
|
||||||
|
checksum: "d65628c225ef26e0386df003fe47d6b3ec8775c586d7dae1a9ef469a0a9906f1"
|
||||||
|
),
|
||||||
|
.plugin(
|
||||||
|
name: "FlatBuffersPlugin",
|
||||||
|
capability: .buildTool(),
|
||||||
|
dependencies: ["flatc"]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user