2020-07-20 03:53:27 +08:00
|
|
|
// swift-tools-version:5.3
|
2018-12-29 22:41:46 +08:00
|
|
|
// The swift-tools-version declares the minimum version of Swift required to
|
|
|
|
// build this package.
|
2018-12-07 19:21:37 +08:00
|
|
|
|
|
|
|
import PackageDescription
|
|
|
|
|
|
|
|
let package = Package(
|
2019-02-18 18:54:49 +08:00
|
|
|
name: "Tokamak",
|
2019-04-01 16:44:20 +08:00
|
|
|
platforms: [
|
2020-12-04 19:19:14 +08:00
|
|
|
.macOS(.v11),
|
2020-07-20 03:53:27 +08:00
|
|
|
.iOS(.v13),
|
2019-04-01 16:44:20 +08:00
|
|
|
],
|
2018-12-29 05:54:16 +08:00
|
|
|
products: [
|
2018-12-29 22:41:46 +08:00
|
|
|
// Products define the executables and libraries produced by a package,
|
|
|
|
// and make them visible to other packages.
|
2020-06-17 07:58:10 +08:00
|
|
|
.executable(
|
|
|
|
name: "TokamakDemo",
|
|
|
|
targets: ["TokamakDemo"]
|
|
|
|
),
|
2018-12-29 05:54:16 +08:00
|
|
|
.library(
|
2020-06-23 06:01:11 +08:00
|
|
|
name: "TokamakDOM",
|
|
|
|
targets: ["TokamakDOM"]
|
2018-12-29 05:54:16 +08:00
|
|
|
),
|
2020-08-02 04:27:12 +08:00
|
|
|
.library(
|
|
|
|
name: "TokamakStaticHTML",
|
|
|
|
targets: ["TokamakStaticHTML"]
|
|
|
|
),
|
|
|
|
.executable(
|
|
|
|
name: "TokamakStaticDemo",
|
|
|
|
targets: ["TokamakStaticDemo"]
|
|
|
|
),
|
2020-12-27 00:11:06 +08:00
|
|
|
.library(
|
|
|
|
name: "TokamakGTK",
|
|
|
|
targets: ["TokamakGTK"]
|
|
|
|
),
|
|
|
|
.executable(
|
|
|
|
name: "TokamakGTKDemo",
|
|
|
|
targets: ["TokamakGTKDemo"]
|
|
|
|
),
|
|
|
|
.library(
|
|
|
|
name: "TokamakShim",
|
|
|
|
targets: ["TokamakShim"]
|
|
|
|
),
|
2018-12-29 05:54:16 +08:00
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
// Dependencies declare other packages that this package depends on.
|
|
|
|
// .package(url: /* package url */, from: "1.0.0"),
|
2020-09-30 17:17:19 +08:00
|
|
|
.package(
|
|
|
|
url: "https://github.com/swiftwasm/JavaScriptKit.git",
|
2020-12-04 19:19:55 +08:00
|
|
|
.upToNextMinor(from: "0.9.0")
|
2020-09-30 17:17:19 +08:00
|
|
|
),
|
2020-08-19 17:08:00 +08:00
|
|
|
.package(url: "https://github.com/MaxDesiatov/Runtime.git", from: "2.1.2"),
|
2021-01-13 18:40:28 +08:00
|
|
|
.package(url: "https://github.com/TokamakUI/OpenCombine.git", from: "0.12.0-alpha3"),
|
|
|
|
.package(url: "https://github.com/swiftwasm/OpenCombineJS.git", .upToNextMinor(from: "0.0.2")),
|
2018-12-29 05:54:16 +08:00
|
|
|
],
|
|
|
|
targets: [
|
2018-12-29 22:41:46 +08:00
|
|
|
// 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 which this package depends on.
|
2020-07-30 23:48:09 +08:00
|
|
|
.target(
|
|
|
|
name: "CombineShim",
|
|
|
|
dependencies: [.product(
|
|
|
|
name: "OpenCombine",
|
|
|
|
package: "OpenCombine",
|
|
|
|
condition: .when(platforms: [.wasi, .linux])
|
|
|
|
)]
|
|
|
|
),
|
2018-12-29 05:54:16 +08:00
|
|
|
.target(
|
2020-06-23 18:47:54 +08:00
|
|
|
name: "TokamakCore",
|
2020-07-30 23:48:09 +08:00
|
|
|
dependencies: ["CombineShim", "Runtime"]
|
2018-12-29 05:54:16 +08:00
|
|
|
),
|
2020-12-27 00:11:06 +08:00
|
|
|
.target(
|
|
|
|
name: "TokamakShim",
|
|
|
|
dependencies: [
|
|
|
|
.target(name: "TokamakDOM", condition: .when(platforms: [.wasi])),
|
|
|
|
.target(name: "TokamakGTK", condition: .when(platforms: [.linux])),
|
|
|
|
]
|
|
|
|
),
|
|
|
|
.systemLibrary(
|
|
|
|
name: "CGTK",
|
|
|
|
pkgConfig: "gtk+-3.0",
|
|
|
|
providers: [
|
|
|
|
.apt(["libgtk+-3.0", "gtk+-3.0"]),
|
|
|
|
// .yum(["gtk3-devel"]),
|
|
|
|
.brew(["gtk+3"]),
|
|
|
|
]
|
|
|
|
),
|
2021-01-12 19:09:25 +08:00
|
|
|
.systemLibrary(
|
|
|
|
name: "CGDK",
|
|
|
|
pkgConfig: "gdk-3.0",
|
|
|
|
providers: [
|
|
|
|
.apt(["libgtk+-3.0", "gtk+-3.0"]),
|
|
|
|
// .yum(["gtk3-devel"]),
|
|
|
|
.brew(["gtk+3"]),
|
|
|
|
]
|
|
|
|
),
|
2020-12-27 00:11:06 +08:00
|
|
|
.target(
|
|
|
|
name: "TokamakGTKCHelpers",
|
|
|
|
dependencies: ["CGTK"]
|
|
|
|
),
|
|
|
|
.target(
|
|
|
|
name: "TokamakGTK",
|
2021-01-12 19:09:25 +08:00
|
|
|
dependencies: ["TokamakCore", "CGTK", "CGDK", "TokamakGTKCHelpers", "CombineShim"]
|
2020-12-27 00:11:06 +08:00
|
|
|
),
|
|
|
|
.target(
|
|
|
|
name: "TokamakGTKDemo",
|
2020-12-27 03:21:01 +08:00
|
|
|
dependencies: ["TokamakGTK"],
|
|
|
|
resources: [.copy("logo-header.png")]
|
2020-12-27 00:11:06 +08:00
|
|
|
),
|
2019-03-12 19:37:22 +08:00
|
|
|
.target(
|
2020-08-02 04:27:12 +08:00
|
|
|
name: "TokamakStaticHTML",
|
|
|
|
dependencies: [
|
|
|
|
"TokamakCore",
|
|
|
|
]
|
2019-03-12 19:37:22 +08:00
|
|
|
),
|
2020-04-12 04:58:24 +08:00
|
|
|
.target(
|
|
|
|
name: "TokamakDOM",
|
2020-11-06 05:37:56 +08:00
|
|
|
dependencies: [
|
|
|
|
"CombineShim",
|
2020-11-26 17:01:54 +08:00
|
|
|
"OpenCombineJS",
|
2020-11-06 05:37:56 +08:00
|
|
|
"TokamakCore",
|
|
|
|
"TokamakStaticHTML",
|
|
|
|
.product(
|
|
|
|
name: "JavaScriptKit",
|
|
|
|
package: "JavaScriptKit",
|
|
|
|
condition: .when(platforms: [.wasi])
|
2020-11-09 20:27:17 +08:00
|
|
|
),
|
2020-11-06 05:37:56 +08:00
|
|
|
]
|
2020-04-12 04:58:24 +08:00
|
|
|
),
|
2020-08-02 04:27:12 +08:00
|
|
|
.target(
|
|
|
|
name: "TokamakDemo",
|
2020-11-06 05:37:56 +08:00
|
|
|
dependencies: [
|
|
|
|
"TokamakShim",
|
|
|
|
.product(
|
|
|
|
name: "JavaScriptKit",
|
|
|
|
package: "JavaScriptKit",
|
|
|
|
condition: .when(platforms: [.wasi])
|
2020-11-09 20:27:17 +08:00
|
|
|
),
|
2020-12-04 19:19:55 +08:00
|
|
|
],
|
|
|
|
resources: [.copy("logo-header.png")]
|
2020-08-02 04:27:12 +08:00
|
|
|
),
|
|
|
|
.target(
|
|
|
|
name: "TokamakStaticDemo",
|
|
|
|
dependencies: [
|
|
|
|
"TokamakStaticHTML",
|
|
|
|
]
|
|
|
|
),
|
2018-12-29 05:54:16 +08:00
|
|
|
.target(
|
2019-02-18 18:54:49 +08:00
|
|
|
name: "TokamakTestRenderer",
|
2020-06-23 18:47:54 +08:00
|
|
|
dependencies: ["TokamakCore"]
|
2018-12-29 05:54:16 +08:00
|
|
|
),
|
|
|
|
.testTarget(
|
2019-02-18 18:54:49 +08:00
|
|
|
name: "TokamakTests",
|
2020-11-07 18:11:35 +08:00
|
|
|
dependencies: ["TokamakTestRenderer"]
|
2018-12-29 05:54:16 +08:00
|
|
|
),
|
2021-01-20 13:07:01 +08:00
|
|
|
// FIXME: re-enable when `ViewDeferredToRenderer` conformance conflicts issue is resolved
|
|
|
|
// Currently, when multiple modules that have conflicting `ViewDeferredToRenderer`
|
|
|
|
// implementations are linked in the same binary, only a single one is used with no defined
|
|
|
|
// behavior for that. We need to replace `ViewDeferredToRenderer` with a different solution
|
|
|
|
// that isn't prone to these hard to debug errors.
|
|
|
|
// .testTarget(
|
|
|
|
// name: "TokamakStaticHTMLTests",
|
|
|
|
// dependencies: ["TokamakStaticHTML"]
|
|
|
|
// ),
|
2018-12-29 05:54:16 +08:00
|
|
|
]
|
2018-12-07 19:21:37 +08:00
|
|
|
)
|