Skip to content

Split WebAPIKit into modules manually #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 68 additions & 16 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,20 +1,48 @@
// swift-tools-version:5.3
// swift-tools-version:5.5
Copy link
Contributor Author

@MaxDesiatov MaxDesiatov Aug 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumped due to use of async in the codebase.

// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "WebAPIKit",
platforms: [.macOS(.v10_13)],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumped due to use of certain file APIs in codegen sources.

products: [
.executable(
name: "WebAPIKitDemo",
targets: ["WebAPIKitDemo"]
),
.library(
name: "WebAPIKit",
targets: ["WebAPIKit"]
name: "WebAPIBase",
targets: ["WebAPIBase"]
),
.library(
name: "DOM",
targets: ["DOM"]
),
.library(
name: "WebSockets",
targets: ["WebSockets"]
),
.library(
name: "WebAudio",
targets: ["WebAudio"]
),
.library(
name: "WebAnimations",
targets: ["WebAnimations"]
),
.library(
name: "WebGL1",
targets: ["WebGL1"]
),
.library(
name: "WebGL2",
targets: ["WebGL2"]
),
.library(
name: "WebGPU",
targets: ["WebGPU"]
),
.library(name: "WebIDL", targets: ["WebIDL"]),
.executable(name: "WebIDLToSwift", targets: ["WebIDLToSwift"]),
],
dependencies: [
Expand All @@ -24,32 +52,56 @@ let package = Package(
),
],
targets: [
.target(
.executableTarget(
name: "WebAPIKitDemo",
dependencies: ["WebAPIKit"]
dependencies: ["DOM", "WebGL2"]
),
.target(
name: "WebAPIKit",
dependencies: [
"ECMAScript",
"JavaScriptKit",
.product(name: "JavaScriptEventLoop", package: "JavaScriptKit"),
.product(name: "JavaScriptBigIntSupport", package: "JavaScriptKit"),
]
name: "WebAPIBase",
dependencies: ["ECMAScript"]
),
.target(
name: "DOM",
dependencies: ["WebAPIBase", "ECMAScript"]
),
.target(
name: "WebSockets",
dependencies: ["DOM", "WebAPIBase", "ECMAScript"]
),
.target(
name: "WebAudio",
dependencies: ["DOM", "WebAPIBase", "ECMAScript"]
),
.target(
name: "WebAnimations",
dependencies: ["DOM", "WebAPIBase", "WebAudio", "ECMAScript"]
),
.target(
name: "WebGL1",
dependencies: ["DOM", "WebAPIBase", "WebAudio", "WebAnimations", "ECMAScript"]
),
.target(
name: "WebGL2",
dependencies: ["DOM", "WebAPIBase", "WebAudio", "WebAnimations", "WebGL1", "ECMAScript"]
),
.target(
name: "WebGPU",
dependencies: ["DOM", "WebAPIBase", "WebAudio", "WebAnimations", "WebGL1", "ECMAScript"]
),
// This support library should be moved to JavaScriptKit
.target(name: "ECMAScript", dependencies: [
"JavaScriptKit",
.product(name: "JavaScriptEventLoop", package: "JavaScriptKit"),
.product(name: "JavaScriptBigIntSupport", package: "JavaScriptKit"),
]),
.target(name: "WebIDL"),
.target(
.executableTarget(
name: "WebIDLToSwift",
dependencies: ["WebIDL"]
),
.testTarget(
name: "WebAPIKitTests",
dependencies: ["WebAPIKit"]
dependencies: ["DOM"]
),
]
)
)
Loading