diff --git a/KissGram/Package.resolved b/KissGram/Package.resolved new file mode 100644 index 0000000..2f60d4d --- /dev/null +++ b/KissGram/Package.resolved @@ -0,0 +1,203 @@ +{ + "pins" : [ + { + "identity" : "async-http-client", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swift-server/async-http-client.git", + "state" : { + "revision" : "78db67e5bf4a8543075787f228e8920097319281", + "version" : "1.18.0" + } + }, + { + "identity" : "async-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/async-kit.git", + "state" : { + "revision" : "a61da00d404ec91d12766f1b9aac7d90777b484d", + "version" : "1.17.0" + } + }, + { + "identity" : "console-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/console-kit.git", + "state" : { + "revision" : "447f1046fb4e9df40973fe426ecb24a6f0e8d3b4", + "version" : "4.6.0" + } + }, + { + "identity" : "multipart-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/multipart-kit.git", + "state" : { + "revision" : "1adfd69df2da08f7931d4281b257475e32c96734", + "version" : "4.5.4" + } + }, + { + "identity" : "routing-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/routing-kit.git", + "state" : { + "revision" : "611bc45c5dfb1f54b84d99b89d1f72191fb6b71b", + "version" : "4.7.2" + } + }, + { + "identity" : "swift-algorithms", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-algorithms.git", + "state" : { + "revision" : "b14b7f4c528c942f121c8b860b9410b2bf57825e", + "version" : "1.0.0" + } + }, + { + "identity" : "swift-atomics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-atomics.git", + "state" : { + "revision" : "6c89474e62719ddcc1e9614989fff2f68208fe10", + "version" : "1.1.0" + } + }, + { + "identity" : "swift-backtrace", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swift-server/swift-backtrace.git", + "state" : { + "revision" : "f25620d5d05e2f1ba27154b40cafea2b67566956", + "version" : "1.3.3" + } + }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections.git", + "state" : { + "revision" : "937e904258d22af6e447a0b72c0bc67583ef64a2", + "version" : "1.0.4" + } + }, + { + "identity" : "swift-crypto", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-crypto.git", + "state" : { + "revision" : "33a20e650c33f6d72d822d558333f2085effa3dc", + "version" : "2.5.0" + } + }, + { + "identity" : "swift-log", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-log.git", + "state" : { + "revision" : "32e8d724467f8fe623624570367e3d50c5638e46", + "version" : "1.5.2" + } + }, + { + "identity" : "swift-metrics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-metrics.git", + "state" : { + "revision" : "34025104068262db0cc998ace178975c5ff4f36b", + "version" : "2.4.0" + } + }, + { + "identity" : "swift-nio", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio.git", + "state" : { + "revision" : "6213ba7a06febe8fef60563a4a7d26a4085783cf", + "version" : "2.54.0" + } + }, + { + "identity" : "swift-nio-extras", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-extras.git", + "state" : { + "revision" : "0e0d0aab665ff1a0659ce75ac003081f2b1c8997", + "version" : "1.19.0" + } + }, + { + "identity" : "swift-nio-http2", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-http2.git", + "state" : { + "revision" : "a8ccf13fa62775277a5d56844878c828bbb3be1a", + "version" : "1.27.0" + } + }, + { + "identity" : "swift-nio-ssl", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-ssl.git", + "state" : { + "revision" : "e866a626e105042a6a72a870c88b4c531ba05f83", + "version" : "2.24.0" + } + }, + { + "identity" : "swift-nio-transport-services", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-transport-services.git", + "state" : { + "revision" : "41f4098903878418537020075a4d8a6e20a0b182", + "version" : "1.17.0" + } + }, + { + "identity" : "swift-numerics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-numerics", + "state" : { + "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b", + "version" : "1.0.2" + } + }, + { + "identity" : "swift-regular-expression", + "kind" : "remoteSourceControl", + "location" : "https://github.com/nerzh/swift-regular-expression", + "state" : { + "revision" : "19c3e569a8e81da6f7f4ee3b73028c25737d3706", + "version" : "0.2.4" + } + }, + { + "identity" : "telegram-vapor-bot", + "kind" : "remoteSourceControl", + "location" : "https://github.com/nerzh/telegram-vapor-bot", + "state" : { + "revision" : "1069491b96952b40a9ebf132cf32aad9ab03bb20", + "version" : "2.2.0" + } + }, + { + "identity" : "vapor", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/vapor.git", + "state" : { + "revision" : "9a340de4995e5a9dade4ff4c51cd2e6ae30c12d6", + "version" : "4.77.0" + } + }, + { + "identity" : "websocket-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/websocket-kit.git", + "state" : { + "revision" : "53fe0639a98903858d0196b699720decb42aee7b", + "version" : "2.14.0" + } + } + ], + "version" : 2 +} diff --git a/KissGram/Package.swift b/KissGram/Package.swift new file mode 100644 index 0000000..3c313ea --- /dev/null +++ b/KissGram/Package.swift @@ -0,0 +1,35 @@ +// swift-tools-version: 5.8 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "KissGram", + platforms: [ + .macOS(.v13), .iOS(.v14), .tvOS(.v14) + ], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .executable( + name: "KissGram", + targets: ["KissGram"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + //.package(url: "../KissMe", from: "1.0.0"), + //.package(path: "../KissMe"), + .package(name: "vapor", url: "https://github.com/vapor/vapor.git", .upToNextMajor(from: "4.57.0")), + .package(name: "TelegramVaporBot", url: "https://github.com/nerzh/telegram-vapor-bot", .upToNextMajor(from: "2.1.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. + .executableTarget( + name: "KissGram", + path: "Sources"), + .testTarget( + name: "KissGramTests", + dependencies: ["KissGram"], + path: "Tests"), + ] +) diff --git a/KissGram/Sources/KissGram-Bridging-Header.h b/KissGram/Sources/KissGram-Bridging-Header.h new file mode 100644 index 0000000..1b2cb5d --- /dev/null +++ b/KissGram/Sources/KissGram-Bridging-Header.h @@ -0,0 +1,4 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + diff --git a/KissGram/Sources/KissGram.swift b/KissGram/Sources/KissGram.swift new file mode 100644 index 0000000..64fa7be --- /dev/null +++ b/KissGram/Sources/KissGram.swift @@ -0,0 +1,68 @@ +// +// KissGram.swift +// KissGram +// +// Created by ened-book-m1 on 2023/06/17. +// + +import Vapor +import TelegramVaporBot + + +var TGBOT: TGBotConnection! + + +class KissGram { + + struct Config: Codable { + let tgAccessToken: String + } + + init() { + } + + func run() async { + do { + var env = try Environment.detect() + try LoggingSystem.bootstrap(from: &env) + let evetnLoop: EventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount * 4) + let app: Application = .init(env, Application.EventLoopGroupProvider.shared(evetnLoop)) + TGBOT = .init() + + defer { app.shutdown() } + try await configure(app) + try app.run() + } catch { + print(error) + } + } + + private func configure(_ app: Application) async throws { + /// set level of debug if you needed + //TGBot.log.logLevel = .error + TGBot.log.logLevel = app.logger.logLevel + + let config = try loadConfig() + let bot: TGBot = .init(app: app, botId: config.tgAccessToken) + await TGBOT.setConnection(try await TGLongPollingConnection(bot: bot)) + + /// OR SET WEBHOOK CONNECTION + /// await TGBOT.setConnection(try await TGWebHookConnection(bot: bot, webHookURL: "https://your_domain/telegramWebHook")) + + await DefaultBotHandlers.addHandlers(app: app, connection: TGBOT.connection) + try await TGBOT.connection.start() + + try routes(app) + } + + private func routes(_ app: Application) throws { + try app.register(collection: TelegramController()) + } + + private func loadConfig() throws -> Config { + let url = URL.currentDirectory().appending(path: "gram-server.json") + let data = try Data(contentsOf: url, options: .uncached) + let config = try JSONDecoder().decode(Config.self, from: data) + return config + } +} diff --git a/KissGram/Sources/TGBot/BotConnection.swift b/KissGram/Sources/TGBot/BotConnection.swift new file mode 100644 index 0000000..bc18776 --- /dev/null +++ b/KissGram/Sources/TGBot/BotConnection.swift @@ -0,0 +1,21 @@ +// +// BotConnection.swift +// KissGram +// +// Created by ened-book-m1 on 2023/06/17. +// + +import Foundation +import TelegramVaporBot + +actor TGBotConnection { + private var _connection: TGConnectionPrtcl! + + var connection: TGConnectionPrtcl { + self._connection + } + + func setConnection(_ conn: TGConnectionPrtcl) { + self._connection = conn + } +} diff --git a/KissGram/Sources/TGBot/BotHandlers.swift b/KissGram/Sources/TGBot/BotHandlers.swift new file mode 100644 index 0000000..5bb54be --- /dev/null +++ b/KissGram/Sources/TGBot/BotHandlers.swift @@ -0,0 +1,75 @@ +// +// BotHandlers.swift +// KissGram +// +// Created by ened-book-m1 on 2023/06/17. +// + +import Vapor +import TelegramVaporBot + +final class DefaultBotHandlers { + + static func addHandlers(app: Vapor.Application, connection: TGConnectionPrtcl) async { + await defaultBaseHandler(app: app, connection: connection) + await messageHandler(app: app, connection: connection) + await commandPingHandler(app: app, connection: connection) + await commandShowButtonsHandler(app: app, connection: connection) + await buttonsActionHandler(app: app, connection: connection) + } + + private static func defaultBaseHandler(app: Vapor.Application, connection: TGConnectionPrtcl) async { + await connection.dispatcher.add(TGBaseHandler({ update, bot in + guard let message = update.message else { return } + //let params: TGSendMessageParams = .init(chatId: .chat(message.chat.id), text: "TGBaseHandler") + //try await connection.bot.sendMessage(params: params) + })) + } + + private static func messageHandler(app: Vapor.Application, connection: TGConnectionPrtcl) async { + await connection.dispatcher.add(TGMessageHandler(filters: (.all && !.command.names(["/ping", "/show_buttons"]))) { update, bot in + let params: TGSendMessageParams = .init(chatId: .chat(update.message!.chat.id), text: "Success") + try await connection.bot.sendMessage(params: params) + }) + } + + private static func commandPingHandler(app: Vapor.Application, connection: TGConnectionPrtcl) async { + await connection.dispatcher.add(TGCommandHandler(commands: ["/ping"]) { update, bot in + try await update.message?.reply(text: "pong", bot: bot) + }) + } + + private static func commandShowButtonsHandler(app: Vapor.Application, connection: TGConnectionPrtcl) async { + await connection.dispatcher.add(TGCommandHandler(commands: ["/show_buttons"]) { update, bot in + guard let userId = update.message?.from?.id else { fatalError("user id not found") } + let buttons: [[TGInlineKeyboardButton]] = [ + [.init(text: "Button 1", callbackData: "press 1"), .init(text: "Button 2", callbackData: "press 2")] + ] + let keyboard: TGInlineKeyboardMarkup = .init(inlineKeyboard: buttons) + let params: TGSendMessageParams = .init(chatId: .chat(userId), + text: "Keyboard active", + replyMarkup: .inlineKeyboardMarkup(keyboard)) + try await connection.bot.sendMessage(params: params) + }) + } + + private static func buttonsActionHandler(app: Vapor.Application, connection: TGConnectionPrtcl) async { + await connection.dispatcher.add(TGCallbackQueryHandler(pattern: "press 1") { update, bot in + let params: TGAnswerCallbackQueryParams = .init(callbackQueryId: update.callbackQuery?.id ?? "0", + text: update.callbackQuery?.data ?? "data not exist", + showAlert: nil, + url: nil, + cacheTime: nil) + try await bot.answerCallbackQuery(params: params) + }) + + await connection.dispatcher.add(TGCallbackQueryHandler(pattern: "press 2") { update, bot in + let params: TGAnswerCallbackQueryParams = .init(callbackQueryId: update.callbackQuery?.id ?? "0", + text: update.callbackQuery?.data ?? "data not exist", + showAlert: nil, + url: nil, + cacheTime: nil) + try await bot.answerCallbackQuery(params: params) + }) + } +} diff --git a/KissGram/Sources/TGBot/TelegramController.swift b/KissGram/Sources/TGBot/TelegramController.swift new file mode 100644 index 0000000..7254e64 --- /dev/null +++ b/KissGram/Sources/TGBot/TelegramController.swift @@ -0,0 +1,25 @@ +// +// TelegramController.swift +// KissGram +// +// Created by ened-book-m1 on 2023/06/17. +// + +import Foundation +import Vapor +import TelegramVaporBot + +final class TelegramController: RouteCollection { + + func boot(routes: Vapor.RoutesBuilder) throws { + routes.get("telegramWebHook", use: telegramWebHook) + } +} + +extension TelegramController { + + func telegramWebHook(_ req: Request) async throws -> Bool { + let update: TGUpdate = try req.content.decode(TGUpdate.self) + return try await TGBOT.connection.dispatcher.process([update]) + } +} diff --git a/KissGram/Sources/main.swift b/KissGram/Sources/main.swift new file mode 100644 index 0000000..643dc58 --- /dev/null +++ b/KissGram/Sources/main.swift @@ -0,0 +1,10 @@ +// +// main.swift +// KissGram +// +// Created by ened-book-m1 on 2023/06/07. +// + +import Foundation + +await KissGram().run() diff --git a/KissMe/Sources/KissProfile.swift b/KissMe/Sources/KissProfile.swift index d806bfd..1a50392 100644 --- a/KissMe/Sources/KissProfile.swift +++ b/KissMe/Sources/KissProfile.swift @@ -98,7 +98,7 @@ extension KissProfile { self.profile = profile } catch { if (error as NSError).code != 2 { - print("\(error)") + print(error) } } } @@ -108,7 +108,7 @@ extension KissProfile { let data = try JSONEncoder().encode(profile) try data.write(to: profileJsonUrl) } catch { - print("\(error)") + print(error) } } } diff --git a/KissMeBatch/Package.swift b/KissMeBatch/Package.swift index c121112..a8fddcc 100644 --- a/KissMeBatch/Package.swift +++ b/KissMeBatch/Package.swift @@ -16,15 +16,13 @@ let package = Package( ], dependencies: [ // Dependencies declare other packages that this package depends on. - //.package(url: "../KissMe", from: "1.0.0"), - .package(path: "../KissMe"), + //.package(path: "../KissMe", 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. .executableTarget( name: "KissMeBatch", - dependencies: ["KissMe"], path: "Sources"), .testTarget( name: "KissMeBatchTests", diff --git a/KissMeBatch/Sources/KissBatch.swift b/KissMeBatch/Sources/KissBatch.swift index 2a6385f..0cf3441 100644 --- a/KissMeBatch/Sources/KissBatch.swift +++ b/KissMeBatch/Sources/KissBatch.swift @@ -6,7 +6,6 @@ // import Foundation -import KissMe struct Batch: Codable { diff --git a/KissMeBatch/Tests/KissMeBatchTests.swift b/KissMeBatch/Tests/KissMeBatchTests.swift new file mode 100644 index 0000000..87ab2b0 --- /dev/null +++ b/KissMeBatch/Tests/KissMeBatchTests.swift @@ -0,0 +1,25 @@ +// +// KissMeBatchTests.swift +// KissMeBatchTests +// +// Created by ened-book-m1 on 2023/06/17. +// + +import XCTest + +final class KissMeBatchTests: XCTestCase { + + override func setUpWithError() throws { + } + + override func tearDownWithError() throws { + } + + func testExample() throws { + } + + func testPerformanceExample() throws { + measure { + } + } +} diff --git a/bin/data b/bin/data index 0c26334..27ffa93 160000 --- a/bin/data +++ b/bin/data @@ -1 +1 @@ -Subproject commit 0c263342c64beb3d95c4b2b24f025a5584cc2fd2 +Subproject commit 27ffa93d3b4dd673379fff99f10e583bec26c25e diff --git a/projects/macos/KissGram.xcodeproj/project.pbxproj b/projects/macos/KissGram.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2230c2a --- /dev/null +++ b/projects/macos/KissGram.xcodeproj/project.pbxproj @@ -0,0 +1,366 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 3435A8142A3A76F300D604F1 /* Vapor in Frameworks */ = {isa = PBXBuildFile; productRef = 3435A8132A3A76F300D604F1 /* Vapor */; }; + 3435A8172A3A771C00D604F1 /* TelegramVaporBot in Frameworks */ = {isa = PBXBuildFile; productRef = 3435A8162A3A771C00D604F1 /* TelegramVaporBot */; }; + 3435A81A2A3A77C000D604F1 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3435A8192A3A77C000D604F1 /* main.swift */; }; + 34F18FCB2A3CC67D0068C697 /* BotHandlers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34F18FCA2A3CC67D0068C697 /* BotHandlers.swift */; }; + 34F18FCD2A3CC6A00068C697 /* TelegramController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34F18FCC2A3CC6A00068C697 /* TelegramController.swift */; }; + 34F18FCF2A3CC6C30068C697 /* BotConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34F18FCE2A3CC6C30068C697 /* BotConnection.swift */; }; + 34F18FDD2A3D59410068C697 /* KissGram.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34F18FDC2A3D59410068C697 /* KissGram.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 348168532A2F96A100A50BD3 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 3435A8182A3A77C000D604F1 /* KissGram-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "KissGram-Bridging-Header.h"; sourceTree = ""; }; + 3435A8192A3A77C000D604F1 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; + 348168552A2F96A100A50BD3 /* KissGram */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = KissGram; sourceTree = BUILT_PRODUCTS_DIR; }; + 34F18FCA2A3CC67D0068C697 /* BotHandlers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BotHandlers.swift; sourceTree = ""; }; + 34F18FCC2A3CC6A00068C697 /* TelegramController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TelegramController.swift; sourceTree = ""; }; + 34F18FCE2A3CC6C30068C697 /* BotConnection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BotConnection.swift; sourceTree = ""; }; + 34F18FDC2A3D59410068C697 /* KissGram.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KissGram.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 348168522A2F96A100A50BD3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3435A8172A3A771C00D604F1 /* TelegramVaporBot in Frameworks */, + 3435A8142A3A76F300D604F1 /* Vapor in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3481684C2A2F96A100A50BD3 = { + isa = PBXGroup; + children = ( + 348168572A2F96A100A50BD3 /* KissGram */, + 348168562A2F96A100A50BD3 /* Products */, + ); + sourceTree = ""; + }; + 348168562A2F96A100A50BD3 /* Products */ = { + isa = PBXGroup; + children = ( + 348168552A2F96A100A50BD3 /* KissGram */, + ); + name = Products; + sourceTree = ""; + }; + 348168572A2F96A100A50BD3 /* KissGram */ = { + isa = PBXGroup; + children = ( + 34F18FDB2A3D591B0068C697 /* TGBot */, + 3435A8192A3A77C000D604F1 /* main.swift */, + 34F18FDC2A3D59410068C697 /* KissGram.swift */, + 3435A8182A3A77C000D604F1 /* KissGram-Bridging-Header.h */, + ); + name = KissGram; + path = ../../KissGram/Sources; + sourceTree = ""; + }; + 34F18FDB2A3D591B0068C697 /* TGBot */ = { + isa = PBXGroup; + children = ( + 34F18FCA2A3CC67D0068C697 /* BotHandlers.swift */, + 34F18FCC2A3CC6A00068C697 /* TelegramController.swift */, + 34F18FCE2A3CC6C30068C697 /* BotConnection.swift */, + ); + path = TGBot; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 348168542A2F96A100A50BD3 /* KissGram */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3481685C2A2F96A100A50BD3 /* Build configuration list for PBXNativeTarget "KissGram" */; + buildPhases = ( + 348168512A2F96A100A50BD3 /* Sources */, + 348168522A2F96A100A50BD3 /* Frameworks */, + 348168532A2F96A100A50BD3 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = KissGram; + packageProductDependencies = ( + 3435A8132A3A76F300D604F1 /* Vapor */, + 3435A8162A3A771C00D604F1 /* TelegramVaporBot */, + ); + productName = KissGram; + productReference = 348168552A2F96A100A50BD3 /* KissGram */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3481684D2A2F96A100A50BD3 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1430; + LastUpgradeCheck = 1430; + TargetAttributes = { + 348168542A2F96A100A50BD3 = { + CreatedOnToolsVersion = 14.3.1; + LastSwiftMigration = 1430; + }; + }; + }; + buildConfigurationList = 348168502A2F96A100A50BD3 /* Build configuration list for PBXProject "KissGram" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 3481684C2A2F96A100A50BD3; + packageReferences = ( + 3435A8122A3A76F300D604F1 /* XCRemoteSwiftPackageReference "vapor" */, + 3435A8152A3A771C00D604F1 /* XCRemoteSwiftPackageReference "telegram-vapor-bot" */, + ); + productRefGroup = 348168562A2F96A100A50BD3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 348168542A2F96A100A50BD3 /* KissGram */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 348168512A2F96A100A50BD3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 34F18FCD2A3CC6A00068C697 /* TelegramController.swift in Sources */, + 34F18FCB2A3CC67D0068C697 /* BotHandlers.swift in Sources */, + 3435A81A2A3A77C000D604F1 /* main.swift in Sources */, + 34F18FCF2A3CC6C30068C697 /* BotConnection.swift in Sources */, + 34F18FDD2A3D59410068C697 /* KissGram.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 3481685A2A2F96A100A50BD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 13.3; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 3481685B2A2F96A100A50BD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 13.3; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 3481685D2A2F96A100A50BD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = NYU8YAYHF8; + ENABLE_HARDENED_RUNTIME = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "../../KissGram/Sources/KissGram-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 3481685E2A2F96A100A50BD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = NYU8YAYHF8; + ENABLE_HARDENED_RUNTIME = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "../../KissGram/Sources/KissGram-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 348168502A2F96A100A50BD3 /* Build configuration list for PBXProject "KissGram" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3481685A2A2F96A100A50BD3 /* Debug */, + 3481685B2A2F96A100A50BD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3481685C2A2F96A100A50BD3 /* Build configuration list for PBXNativeTarget "KissGram" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3481685D2A2F96A100A50BD3 /* Debug */, + 3481685E2A2F96A100A50BD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 3435A8122A3A76F300D604F1 /* XCRemoteSwiftPackageReference "vapor" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/vapor/vapor.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 4.57.0; + }; + }; + 3435A8152A3A771C00D604F1 /* XCRemoteSwiftPackageReference "telegram-vapor-bot" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/nerzh/telegram-vapor-bot"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 2.1.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 3435A8132A3A76F300D604F1 /* Vapor */ = { + isa = XCSwiftPackageProductDependency; + package = 3435A8122A3A76F300D604F1 /* XCRemoteSwiftPackageReference "vapor" */; + productName = Vapor; + }; + 3435A8162A3A771C00D604F1 /* TelegramVaporBot */ = { + isa = XCSwiftPackageProductDependency; + package = 3435A8152A3A771C00D604F1 /* XCRemoteSwiftPackageReference "telegram-vapor-bot" */; + productName = TelegramVaporBot; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 3481684D2A2F96A100A50BD3 /* Project object */; +} diff --git a/projects/macos/KissGram.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/projects/macos/KissGram.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/projects/macos/KissGram.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/projects/macos/KissGram.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/projects/macos/KissGram.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/projects/macos/KissGram.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/projects/macos/KissGram.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/projects/macos/KissGram.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..2f60d4d --- /dev/null +++ b/projects/macos/KissGram.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,203 @@ +{ + "pins" : [ + { + "identity" : "async-http-client", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swift-server/async-http-client.git", + "state" : { + "revision" : "78db67e5bf4a8543075787f228e8920097319281", + "version" : "1.18.0" + } + }, + { + "identity" : "async-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/async-kit.git", + "state" : { + "revision" : "a61da00d404ec91d12766f1b9aac7d90777b484d", + "version" : "1.17.0" + } + }, + { + "identity" : "console-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/console-kit.git", + "state" : { + "revision" : "447f1046fb4e9df40973fe426ecb24a6f0e8d3b4", + "version" : "4.6.0" + } + }, + { + "identity" : "multipart-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/multipart-kit.git", + "state" : { + "revision" : "1adfd69df2da08f7931d4281b257475e32c96734", + "version" : "4.5.4" + } + }, + { + "identity" : "routing-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/routing-kit.git", + "state" : { + "revision" : "611bc45c5dfb1f54b84d99b89d1f72191fb6b71b", + "version" : "4.7.2" + } + }, + { + "identity" : "swift-algorithms", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-algorithms.git", + "state" : { + "revision" : "b14b7f4c528c942f121c8b860b9410b2bf57825e", + "version" : "1.0.0" + } + }, + { + "identity" : "swift-atomics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-atomics.git", + "state" : { + "revision" : "6c89474e62719ddcc1e9614989fff2f68208fe10", + "version" : "1.1.0" + } + }, + { + "identity" : "swift-backtrace", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swift-server/swift-backtrace.git", + "state" : { + "revision" : "f25620d5d05e2f1ba27154b40cafea2b67566956", + "version" : "1.3.3" + } + }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections.git", + "state" : { + "revision" : "937e904258d22af6e447a0b72c0bc67583ef64a2", + "version" : "1.0.4" + } + }, + { + "identity" : "swift-crypto", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-crypto.git", + "state" : { + "revision" : "33a20e650c33f6d72d822d558333f2085effa3dc", + "version" : "2.5.0" + } + }, + { + "identity" : "swift-log", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-log.git", + "state" : { + "revision" : "32e8d724467f8fe623624570367e3d50c5638e46", + "version" : "1.5.2" + } + }, + { + "identity" : "swift-metrics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-metrics.git", + "state" : { + "revision" : "34025104068262db0cc998ace178975c5ff4f36b", + "version" : "2.4.0" + } + }, + { + "identity" : "swift-nio", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio.git", + "state" : { + "revision" : "6213ba7a06febe8fef60563a4a7d26a4085783cf", + "version" : "2.54.0" + } + }, + { + "identity" : "swift-nio-extras", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-extras.git", + "state" : { + "revision" : "0e0d0aab665ff1a0659ce75ac003081f2b1c8997", + "version" : "1.19.0" + } + }, + { + "identity" : "swift-nio-http2", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-http2.git", + "state" : { + "revision" : "a8ccf13fa62775277a5d56844878c828bbb3be1a", + "version" : "1.27.0" + } + }, + { + "identity" : "swift-nio-ssl", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-ssl.git", + "state" : { + "revision" : "e866a626e105042a6a72a870c88b4c531ba05f83", + "version" : "2.24.0" + } + }, + { + "identity" : "swift-nio-transport-services", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-transport-services.git", + "state" : { + "revision" : "41f4098903878418537020075a4d8a6e20a0b182", + "version" : "1.17.0" + } + }, + { + "identity" : "swift-numerics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-numerics", + "state" : { + "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b", + "version" : "1.0.2" + } + }, + { + "identity" : "swift-regular-expression", + "kind" : "remoteSourceControl", + "location" : "https://github.com/nerzh/swift-regular-expression", + "state" : { + "revision" : "19c3e569a8e81da6f7f4ee3b73028c25737d3706", + "version" : "0.2.4" + } + }, + { + "identity" : "telegram-vapor-bot", + "kind" : "remoteSourceControl", + "location" : "https://github.com/nerzh/telegram-vapor-bot", + "state" : { + "revision" : "1069491b96952b40a9ebf132cf32aad9ab03bb20", + "version" : "2.2.0" + } + }, + { + "identity" : "vapor", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/vapor.git", + "state" : { + "revision" : "9a340de4995e5a9dade4ff4c51cd2e6ae30c12d6", + "version" : "4.77.0" + } + }, + { + "identity" : "websocket-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/websocket-kit.git", + "state" : { + "revision" : "53fe0639a98903858d0196b699720decb42aee7b", + "version" : "2.14.0" + } + } + ], + "version" : 2 +} diff --git a/projects/macos/KissGram.xcodeproj/xcshareddata/xcschemes/KissGram.xcscheme b/projects/macos/KissGram.xcodeproj/xcshareddata/xcschemes/KissGram.xcscheme new file mode 100644 index 0000000..0afffc6 --- /dev/null +++ b/projects/macos/KissGram.xcodeproj/xcshareddata/xcschemes/KissGram.xcscheme @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/macos/KissMeBatch.xcodeproj/project.pbxproj b/projects/macos/KissMeBatch.xcodeproj/project.pbxproj index 41bf3cb..a63679a 100644 --- a/projects/macos/KissMeBatch.xcodeproj/project.pbxproj +++ b/projects/macos/KissMeBatch.xcodeproj/project.pbxproj @@ -8,9 +8,8 @@ /* Begin PBXBuildFile section */ 3435A8052A375D6500D604F1 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3435A8042A375D6500D604F1 /* main.swift */; }; - 3435A80D2A375DD600D604F1 /* KissMe.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3435A80C2A375DD600D604F1 /* KissMe.framework */; }; - 3435A80E2A375DD600D604F1 /* KissMe.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3435A80C2A375DD600D604F1 /* KissMe.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 3435A8112A375E6600D604F1 /* KissBatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3435A8102A375E6600D604F1 /* KissBatch.swift */; }; + 34F18FD72A3CCB5D0068C697 /* KissMeBatchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34F18FD62A3CCB5D0068C697 /* KissMeBatchTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -23,24 +22,14 @@ ); runOnlyForDeploymentPostprocessing = 1; }; - 3435A80F2A375DD600D604F1 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3435A80E2A375DD600D604F1 /* KissMe.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 3435A8012A375D6500D604F1 /* KissMeBatch */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = KissMeBatch; sourceTree = BUILT_PRODUCTS_DIR; }; 3435A8042A375D6500D604F1 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; - 3435A80C2A375DD600D604F1 /* KissMe.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = KissMe.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3435A8102A375E6600D604F1 /* KissBatch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KissBatch.swift; sourceTree = ""; }; + 34F18FD42A3CCB5D0068C697 /* KissMeBatchTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KissMeBatchTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 34F18FD62A3CCB5D0068C697 /* KissMeBatchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KissMeBatchTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -48,7 +37,13 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3435A80D2A375DD600D604F1 /* KissMe.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 34F18FD12A3CCB5D0068C697 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( ); runOnlyForDeploymentPostprocessing = 0; }; @@ -59,6 +54,7 @@ isa = PBXGroup; children = ( 3435A8032A375D6500D604F1 /* KissMeBatch */, + 34F18FD52A3CCB5D0068C697 /* KissMeBatchTests */, 3435A8022A375D6500D604F1 /* Products */, 3435A80B2A375DD600D604F1 /* Frameworks */, ); @@ -68,6 +64,7 @@ isa = PBXGroup; children = ( 3435A8012A375D6500D604F1 /* KissMeBatch */, + 34F18FD42A3CCB5D0068C697 /* KissMeBatchTests.xctest */, ); name = Products; sourceTree = ""; @@ -85,11 +82,18 @@ 3435A80B2A375DD600D604F1 /* Frameworks */ = { isa = PBXGroup; children = ( - 3435A80C2A375DD600D604F1 /* KissMe.framework */, ); name = Frameworks; sourceTree = ""; }; + 34F18FD52A3CCB5D0068C697 /* KissMeBatchTests */ = { + isa = PBXGroup; + children = ( + 34F18FD62A3CCB5D0068C697 /* KissMeBatchTests.swift */, + ); + path = KissMeBatchTests; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -100,7 +104,6 @@ 3435A7FD2A375D6500D604F1 /* Sources */, 3435A7FE2A375D6500D604F1 /* Frameworks */, 3435A7FF2A375D6500D604F1 /* CopyFiles */, - 3435A80F2A375DD600D604F1 /* Embed Frameworks */, ); buildRules = ( ); @@ -111,6 +114,23 @@ productReference = 3435A8012A375D6500D604F1 /* KissMeBatch */; productType = "com.apple.product-type.tool"; }; + 34F18FD32A3CCB5D0068C697 /* KissMeBatchTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 34F18FDA2A3CCB5D0068C697 /* Build configuration list for PBXNativeTarget "KissMeBatchTests" */; + buildPhases = ( + 34F18FD02A3CCB5D0068C697 /* Sources */, + 34F18FD12A3CCB5D0068C697 /* Frameworks */, + 34F18FD22A3CCB5D0068C697 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = KissMeBatchTests; + productName = KissMeBatchTests; + productReference = 34F18FD42A3CCB5D0068C697 /* KissMeBatchTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -124,6 +144,9 @@ 3435A8002A375D6500D604F1 = { CreatedOnToolsVersion = 14.3.1; }; + 34F18FD32A3CCB5D0068C697 = { + CreatedOnToolsVersion = 14.3.1; + }; }; }; buildConfigurationList = 3435A7FC2A375D6500D604F1 /* Build configuration list for PBXProject "KissMeBatch" */; @@ -140,10 +163,21 @@ projectRoot = ""; targets = ( 3435A8002A375D6500D604F1 /* KissMeBatch */, + 34F18FD32A3CCB5D0068C697 /* KissMeBatchTests */, ); }; /* End PBXProject section */ +/* Begin PBXResourcesBuildPhase section */ + 34F18FD22A3CCB5D0068C697 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 3435A7FD2A375D6500D604F1 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -154,6 +188,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 34F18FD02A3CCB5D0068C697 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 34F18FD72A3CCB5D0068C697 /* KissMeBatchTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ @@ -292,6 +334,36 @@ }; name = Release; }; + 34F18FD82A3CCB5D0068C697 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = NYU8YAYHF8; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.ened.KissMeBatchTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 34F18FD92A3CCB5D0068C697 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = NYU8YAYHF8; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.ened.KissMeBatchTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -313,6 +385,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 34F18FDA2A3CCB5D0068C697 /* Build configuration list for PBXNativeTarget "KissMeBatchTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 34F18FD82A3CCB5D0068C697 /* Debug */, + 34F18FD92A3CCB5D0068C697 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 3435A7F92A375D6500D604F1 /* Project object */; diff --git a/scripts/build.sh b/scripts/build.sh index a9d2594..4267a6a 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -5,16 +5,7 @@ ## $ ./scripts/build.sh ## -CONSOLE_APP="KissMeConsole" - - -echo "build console bin/${CONSOLE_APP}" - -cd ${CONSOLE_APP} - -rm -rf .build - -swift build -c release - -cp ./.build/release/${CONSOLE_APP} ../bin +./build_any.sh KissMeConsole +#./build_any.sh KissMeBatch +#./build_any.sh KissGram diff --git a/scripts/build_any.sh b/scripts/build_any.sh new file mode 100755 index 0000000..f8f96a8 --- /dev/null +++ b/scripts/build_any.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +## Run this build script at root +## Ex) +## $ ./scripts/build.sh +## + +CONSOLE_APP=$1 + + +echo "build console bin/${CONSOLE_APP}" + +cd ${CONSOLE_APP} + +rm -rf .build + +swift build -c release + +cp ./.build/release/${CONSOLE_APP} ../bin +